[Devel] [PATCH RHEL8 COMMIT] ve/memcg: Honor changing per-memcg s[un]reclaimable counters to bytes in per-CT /proc/meminfo

Konstantin Khorenko khorenko at virtuozzo.com
Wed Aug 18 20:57:35 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-305.3.1.vz8.7.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-305.3.1.vz8.7.7
------>
commit 26a7e039a26f5407e3c90e4d61b5ad266904b116
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Wed Aug 18 13:48:01 2021 +0300

    ve/memcg: Honor changing per-memcg s[un]reclaimable counters to bytes in per-CT /proc/meminfo
    
    RHEL8.4 has following ms commit backported:
    d42f3245c7e2 ("mm: memcg: convert vmstat slab counters to bytes")
    
    So, update places were we use per-memcg counters NR_SLAB_[UN]RECLAIMABLE_B
    accordingly.
    
    https://jira.sw.ru/browse/PSBM-132893
    Fixes: 12417a598bbc ("ve/memcg: Fix /proc/meminfo virtualization
    (eliminate double recursion)")
    
    To_merge: 38a2f168a441 ("ve/proc: virtualize /proc/meminfo in a Container")
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 mm/memcontrol.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index efa668101430..8b46f47660d8 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4252,8 +4252,10 @@ void mem_cgroup_fill_meminfo(struct mem_cgroup *memcg, struct meminfo *mi)
 	memset(&mi->pages, 0, sizeof(mi->pages));
 	mem_cgroup_get_nr_pages(memcg, mi->pages);
 
-	mi->slab_reclaimable = memcg_page_state(memcg, NR_SLAB_RECLAIMABLE_B);
-	mi->slab_unreclaimable = memcg_page_state(memcg, NR_SLAB_UNRECLAIMABLE_B);
+	mi->slab_reclaimable = memcg_page_state(memcg, NR_SLAB_RECLAIMABLE_B)
+								>> PAGE_SHIFT;
+	mi->slab_unreclaimable = memcg_page_state(memcg, NR_SLAB_UNRECLAIMABLE_B)
+								>> PAGE_SHIFT;
 	mi->cached = memcg_page_state(memcg, NR_FILE_PAGES);
 	mi->shmem = memcg_page_state(memcg, NR_SHMEM);
 	mi->dirty_pages = memcg_page_state(memcg, NR_FILE_DIRTY);


More information about the Devel mailing list