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

Submitted by Konstantin Khorenko on Aug. 30, 2017, 11:24 a.m.

Details

Message ID 201708301124.v7UBOmUo013899@finist_ce7.work
State New
Series "mm/migrate: add missing memcg charge"
Headers show

Commit Message

Konstantin Khorenko Aug. 30, 2017, 11:24 a.m.
The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.1.1.el7
------>
commit 1c1c763d7424c872265d60007d6050cf3a394386
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Wed Aug 30 14:24:48 2017 +0300

    mm/migrate: add missing memcg charge
    
    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 6b7349c..c629762f 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 */