From: YAMAMOTO Takashi Date: Fri, 28 Mar 2008 21:15:50 +0000 (-0700) Subject: memcgroup: fix spurious EBUSY on memory cgroup removal X-Git-Tag: v2.6.25-rc8~61 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d4a788f15302877ff2cb08f22009e290a36a209;p=linux-2.6 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: YAMAMOTO Takashi Acked-by: Balbir Singh Cc: KAMEZAWA Hiroyuki Cc: Paul Menage Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/fork.c b/kernel/fork.c index dd249c37b3..9c042f9015 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -394,7 +394,6 @@ void __mmdrop(struct mm_struct *mm) { BUG_ON(mm == &init_mm); mm_free_pgd(mm); - mm_free_cgroup(mm); destroy_context(mm); free_mm(mm); } @@ -416,6 +415,7 @@ void mmput(struct mm_struct *mm) spin_unlock(&mmlist_lock); } put_swap_token(mm); + mm_free_cgroup(mm); mmdrop(mm); } }