Reviewed-by: Pavel Tikhomirov <[email protected]>

On 09.06.2021 13:54, Konstantin Khorenko wrote:
During tmpfs default size virtualization we occasionally
overwrite 'totalram_pages' global value used for host.

Fix it.

Fixes: b563045c1998 ("shmem/ve: virtualize tmpfs default size")
https://jira.sw.ru/browse/PSBM-130518

Signed-off-by: Konstantin Khorenko <[email protected]>
---
  mm/shmem.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 377a038ff24f..e9c8de20440b 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -111,16 +111,17 @@ static unsigned long tmpfs_ram_pages(void)
  {
        struct ve_struct *ve = get_exec_env();
        struct cgroup_subsys_state *css;
+       unsigned long ve_ram_pages;
if (ve_is_super(ve))
                return totalram_pages;
css = ve_get_init_css(ve, memory_cgrp_id);
-       totalram_pages = min(totalram_pages,
+       ve_ram_pages = min(totalram_pages,
                        mem_cgroup_total_pages(mem_cgroup_from_css(css)));
        css_put(css);
- return totalram_pages;
+       return ve_ram_pages;
  }
static unsigned long shmem_default_max_blocks(void)


--
Best regards, Tikhomirov Pavel
Software Developer, Virtuozzo.
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to