aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/memcontrol.h5
-rw-r--r--mm/memcontrol.c5
-rw-r--r--mm/migrate.c2
3 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 067115ce6b3e..6a576f989437 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -98,7 +98,7 @@ extern int
98mem_cgroup_prepare_migration(struct page *page, 98mem_cgroup_prepare_migration(struct page *page,
99 struct page *newpage, struct mem_cgroup **ptr); 99 struct page *newpage, struct mem_cgroup **ptr);
100extern void mem_cgroup_end_migration(struct mem_cgroup *mem, 100extern void mem_cgroup_end_migration(struct mem_cgroup *mem,
101 struct page *oldpage, struct page *newpage); 101 struct page *oldpage, struct page *newpage, bool migration_ok);
102 102
103/* 103/*
104 * For memory reclaim. 104 * For memory reclaim.
@@ -251,8 +251,7 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
251} 251}
252 252
253static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, 253static inline void mem_cgroup_end_migration(struct mem_cgroup *mem,
254 struct page *oldpage, 254 struct page *oldpage, struct page *newpage, bool migration_ok)
255 struct page *newpage)
256{ 255{
257} 256}
258 257
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