aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c5
-rw-r--r--mm/migrate.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 6424ba0fce83..8ab841031436 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2896,7 +2896,7 @@ int mem_cgroup_prepare_migration(struct page *page,
2896 2896
2897/* remove redundant charge if migration failed*/ 2897/* remove redundant charge if migration failed*/
2898void mem_cgroup_end_migration(struct mem_cgroup *mem, 2898void mem_cgroup_end_migration(struct mem_cgroup *mem,
2899 struct page *oldpage, struct page *newpage) 2899 struct page *oldpage, struct page *newpage, bool migration_ok)
2900{ 2900{
2901 struct page *used, *unused; 2901 struct page *used, *unused;
2902 struct page_cgroup *pc; 2902 struct page_cgroup *pc;
@@ -2905,8 +2905,7 @@ void mem_cgroup_end_migration(struct mem_cgroup *mem,
2905 return; 2905 return;
2906 /* blocks rmdir() */ 2906 /* blocks rmdir() */
2907 cgroup_exclude_rmdir(&mem->css); 2907 cgroup_exclude_rmdir(&mem->css);
2908 /* at migration success, oldpage->mapping is NULL. */ 2908 if (!migration_ok) {
2909 if (oldpage->mapping) {
2910 used = oldpage; 2909 used = oldpage;
2911 unused = newpage; 2910 unused = newpage;
2912 } else { 2911 } else {
diff --git a/mm/migrate.c b/mm/migrate.c
index 5b7d1fd29621..46fe8cc13d67 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -768,7 +768,7 @@ skip_unmap:
768 768
769uncharge: 769uncharge:
770 if (!charge) 770 if (!charge)
771 mem_cgroup_end_migration(mem, page, newpage); 771 mem_cgroup_end_migration(mem, page, newpage, rc == 0);
772unlock: 772unlock:
773 unlock_page(page); 773 unlock_page(page);
774 774