[Devel] [PATCH vz8 3/5] 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 14:29:27 MSK 2021


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);
-- 
2.28.0



More information about the Devel mailing list