Commit 59d1d256 authored by Johannes Weiner's avatar Johannes Weiner Committed by Linus Torvalds
Browse files

mm: memcg: remove mem_cgroup_move_account_page_stat()

It used to disable preemption and run sanity checks but now it's only
taking a number out of one percpu counter and putting it into another.
Do this directly in the callsite and save the indirection.
Signed-off-by: default avatarJohannes Weiner <>
Acked-by: default avatarMichal Hocko <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 7af467e8
......@@ -3744,16 +3744,6 @@ void mem_cgroup_split_huge_fixup(struct page *head)
static void mem_cgroup_move_account_page_stat(struct mem_cgroup *from,
struct mem_cgroup *to,
unsigned int nr_pages,
enum mem_cgroup_stat_index idx)
/* Update stat data for mem_cgroup */
__this_cpu_sub(from->stat->count[idx], nr_pages);
__this_cpu_add(to->stat->count[idx], nr_pages);
* mem_cgroup_move_account - move account of the page
* @page: the page
......@@ -3799,13 +3789,19 @@ static int mem_cgroup_move_account(struct page *page,
move_lock_mem_cgroup(from, &flags);
if (!anon && page_mapped(page))
mem_cgroup_move_account_page_stat(from, to, nr_pages,
if (!anon && page_mapped(page)) {
if (PageWriteback(page))
mem_cgroup_move_account_page_stat(from, to, nr_pages,
if (PageWriteback(page)) {
mem_cgroup_charge_statistics(from, page, anon, -nr_pages);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment