[Devel] [PATCH rh7 2/3] mm/filemap: fix ->cache counter leak

Andrey Ryabinin aryabinin at virtuozzo.com
Tue Jun 26 19:03:53 MSK 2018


__add_to_page_cache_locked() sometimes uses
mem_cgroup_cancel_charge() instead of mem_cgroup_cancel_cache_charge()
which leads to leaking ->cache charge.

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();
-- 
2.16.4



More information about the Devel mailing list