[Devel] [PATCH rh7] mm/migrate: add missing memcg charge

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Aug 30 13:38:40 MSK 2017


Fixes: b3c711a7287f ("ms/mm: memcontrol: rewrite uncharge API")
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/migrate.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/migrate.c b/mm/migrate.c
index 6b7349ca368c..c629762fbfd5 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2383,6 +2383,9 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate,
 
 	inc_mm_counter(mm, MM_ANONPAGES);
 	page_add_new_anon_rmap(page, vma, addr);
+	mem_cgroup_commit_charge(page, memcg, false);
+	if (!is_zone_device_page(page))
+		lru_cache_add_active_or_unevictable(page, vma);
 	set_pte_at(mm, addr, ptep, entry);
 
 	/* Take a reference on the page */
-- 
2.13.5



More information about the Devel mailing list