[Devel] [PATCH vz8 5/5] ve/mm: Honor changing per-memcg s[un]reclaimable counters to bytes in heuristic check for memory overcommit

Konstantin Khorenko khorenko at virtuozzo.com
Wed Aug 18 14:29:29 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: 6a57bb1da875 ("ve/mm: add heuristic check for memory overcommit")

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index b5cdbb7818c8..989dc23d05b8 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4326,7 +4326,7 @@ static int mem_cgroup_enough_memory(struct mem_cgroup *memcg, long pages)
 	free = memcg->memsw.max - page_counter_read(&memcg->memory);
 
 	/* reclaimable slabs */
-	free += memcg_page_state(memcg, NR_SLAB_RECLAIMABLE_B);
+	free += memcg_page_state(memcg, NR_SLAB_RECLAIMABLE_B) >> PAGE_SHIFT;
 
 	/* assume file cache is reclaimable */
 	free += memcg_page_state(memcg, NR_FILE_PAGES);
-- 
2.28.0



More information about the Devel mailing list