aboutsummaryrefslogtreecommitdiff
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorJohannes Weiner2016-03-15 14:57:54 -0700
committerLinus Torvalds2016-03-15 16:55:16 -0700
commit74485cf2bc85d2a10c3653fff4fe956db67ce2a9 (patch)
treecf5923bce0b30a95c88a096cf33557336767848d /mm/migrate.c
parent7cf91a98e607c2f935dbcc177d70011e95b8faff (diff)
mm: migrate: consolidate mem_cgroup_migrate() calls
Rather than scattering mem_cgroup_migrate() calls all over the place, have a single call from a safe place where every migration operation eventually ends up in - migrate_page_copy(). Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Suggested-by: Hugh Dickins <hughd@google.com> Acked-by: Vladimir Davydov <vdavydov@virtuozzo.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Mateusz Guzik <mguzik@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 848327d4a7ed..568284ec75d4 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -331,8 +331,6 @@ int migrate_page_move_mapping(struct address_space *mapping,
if (PageSwapBacked(page))
SetPageSwapBacked(newpage);
- mem_cgroup_migrate(page, newpage);
-
return MIGRATEPAGE_SUCCESS;
}
@@ -428,8 +426,6 @@ int migrate_page_move_mapping(struct address_space *mapping,
}
local_irq_enable();
- mem_cgroup_migrate(page, newpage);
-
return MIGRATEPAGE_SUCCESS;
}
@@ -471,8 +467,6 @@ int migrate_huge_page_move_mapping(struct address_space *mapping,
spin_unlock_irq(&mapping->tree_lock);
- mem_cgroup_migrate(page, newpage);
-
return MIGRATEPAGE_SUCCESS;
}
@@ -586,6 +580,8 @@ void migrate_page_copy(struct page *newpage, struct page *page)
end_page_writeback(newpage);
copy_page_owner(page, newpage);
+
+ mem_cgroup_migrate(page, newpage);
}
/************************************************************
@@ -1846,7 +1842,6 @@ fail_putback:
}
mlock_migrate_page(new_page, page);
- mem_cgroup_migrate(page, new_page);
page_remove_rmap(page, true);
set_page_owner_migrate_reason(new_page, MR_NUMA_MISPLACED);