[Devel] [PATCH RHEL7 COMMIT] mm/filemap: fix ->cache counter leak

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jun 28 17:35:37 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.3.2.vz7.61.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.3.2.vz7.61.6
------>
commit 50749ac0f790a0cd24bb4ae855918fc7555bcc4b
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Thu Jun 28 17:35:37 2018 +0300

    mm/filemap: fix ->cache counter leak
    
    __add_to_page_cache_locked() sometimes uses
    mem_cgroup_cancel_charge() instead of mem_cgroup_cancel_cache_charge()
    which leads to leaking ->cache charge.
    
    Fixes: 2c99f211cfc5 ("mm/memcg: Don't charge anon pages as cache")
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/filemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index be6c37175b20..d54d508e134e 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -743,7 +743,7 @@ static int __add_to_page_cache_locked(struct page *page,
 			/* Leave page->index set: truncation relies upon it */
 			spin_unlock_irq(&mapping->tree_lock);
 			if (!huge)
-				mem_cgroup_cancel_charge(page, memcg);
+				mem_cgroup_cancel_cache_charge(page, memcg);
 			page_cache_release(page);
 		}
 		radix_tree_preload_end();


More information about the Devel mailing list