Commit 1d4a788f authored by YAMAMOTO Takashi's avatar YAMAMOTO Takashi Committed by Linus Torvalds

memcgroup: fix spurious EBUSY on memory cgroup removal

Call mm_free_cgroup earlier.  Otherwise a reference due to lazy mm switching
can prevent cgroup removal.
Signed-off-by: default avatarYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8c703d35
...@@ -394,7 +394,6 @@ void __mmdrop(struct mm_struct *mm) ...@@ -394,7 +394,6 @@ void __mmdrop(struct mm_struct *mm)
{ {
BUG_ON(mm == &init_mm); BUG_ON(mm == &init_mm);
mm_free_pgd(mm); mm_free_pgd(mm);
mm_free_cgroup(mm);
destroy_context(mm); destroy_context(mm);
free_mm(mm); free_mm(mm);
} }
...@@ -416,6 +415,7 @@ void mmput(struct mm_struct *mm) ...@@ -416,6 +415,7 @@ void mmput(struct mm_struct *mm)
spin_unlock(&mmlist_lock); spin_unlock(&mmlist_lock);
} }
put_swap_token(mm); put_swap_token(mm);
mm_free_cgroup(mm);
mmdrop(mm); mmdrop(mm);
} }
} }
......
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