The commit is pushed to "branch-rh10-6.12.0-55.13.1.vz10.2.x-ovz" and will 
appear at g...@bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.el10
------>
commit 3d9f76014032918d41ef7070bec9d31950ea2416
Author: Konstantin Khorenko <khore...@virtuozzo.com>
Date:   Tue Jul 29 14:27:38 2025 +0200

    mm/memcontrol: do not uncharge cache folio for root memcg
    
    We do not account/limit memcg::memory,::memsw for root memcg,
    so don't we do that for cache.
    
    And memory.cache.current,memory.cache.max files are not available for
    root memcg as well.
    
    But there is one place - uncharge_folio() - where we forgot to put cache
    accounting under !mem_cgroup_is_root() check, so fix this.
    
    Fixes: 6a2ca4d515c5 ("mm: Memory cgroup page cache limit")
    https://virtuozzo.atlassian.net/browse/VSTOR-111756
    
    Signed-off-by: Konstantin Khorenko <khore...@virtuozzo.com>
    Signed-off-by: Pavel Tikhomirov <ptikhomi...@virtuozzo.com>
    
    Feature: mm: Memory cgroup page cache limit
---
 mm/memcontrol.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f0b53e5f4d243..8a4fdef58743e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5499,11 +5499,12 @@ static void uncharge_folio(struct folio *folio, struct 
uncharge_gather *ug)
                folio->memcg_data = 0;
                obj_cgroup_put(objcg);
        } else {
-               if (folio_memcg_cache(folio))
-                       ug->nr_pgcache += nr_pages;
                /* LRU pages aren't accounted at the root level */
-               if (!mem_cgroup_is_root(memcg))
+               if (!mem_cgroup_is_root(memcg)) {
                        ug->nr_memory += nr_pages;
+                       if (folio_memcg_cache(folio))
+                               ug->nr_pgcache += nr_pages;
+               }
                ug->pgpgout++;
 
                WARN_ON_ONCE(folio_unqueue_deferred_split(folio));
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to