[Devel] [PATCH RHEL8 COMMIT] 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 20:58:30 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 2c43f671b7aa76fa13ec78f722989d0525db047d
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Wed Aug 18 13:48:01 2021 +0300

    ve/mm: Honor changing per-memcg s[un]reclaimable counters to bytes in heuristic check for memory overcommit
    
    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);


More information about the Devel mailing list