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

Submitted by Andrey Ryabinin on Aug. 30, 2017, 10:38 a.m.

Details

Message ID 20170830103840.9414-1-aryabinin@virtuozzo.com
State New
Series "mm/migrate: add missing memcg charge"
Headers show

Commit Message

Andrey Ryabinin Aug. 30, 2017, 10:38 a.m.
Fixes: b3c711a7287f ("ms/mm: memcontrol: rewrite uncharge API")
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/migrate.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

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 */