The commit is pushed to "branch-rh10-6.12.0-55.13.1.2.x.vz10-ovz" and will 
appear at [email protected]:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.2.10.vz10
------>
commit ce702e965843e8f5d47cbd4ad439a4a1ef6a61eb
Author: Pavel Tikhomirov <[email protected]>
Date:   Mon Oct 6 12:46:00 2025 +0800

    mm/memcontrol: switch to memory refcount to track memory overcommit on 
cgroup-v2
    
    The memsw counter is unavailable in cgroup-v2, we have swap and memory
    to choose from, let's put failcount on memory. Although actually it's for
    memory + swap + file + reclaimable, but putting this failcount on swap
    looks less intuitive.
    
    Fixes: 8117828baaa09 ("ve/mm: add heuristic check for memory overcommit")
    
    https://virtuozzo.atlassian.net/browse/VSTOR-105819
    Signed-off-by: Pavel Tikhomirov <[email protected]>
    
    Feature: mm: per-CT memory overcommit heuristic
---
 mm/memcontrol.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index cba985e5d3d1d..6e1f2816931fa 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3419,10 +3419,14 @@ int ve_enough_memory(long pages)
 
        css = ve_get_init_css(ve, memory_cgrp_id);
        memcg = mem_cgroup_from_css(css);
-       ret = mem_cgroup_enough_memory(memcg, pages);
 
-       if (unlikely(ret < 0))
-               memcg->memsw.failcnt++;
+       ret = mem_cgroup_enough_memory(memcg, pages);
+       if (unlikely(ret < 0)) {
+               if (cgroup_subsys_on_dfl(memory_cgrp_subsys))
+                       memcg->memory.failcnt++;
+               else
+                       memcg->memsw.failcnt++;
+       }
 
        css_put(css);
        return ret;
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to