diff options
author | YAMAMOTO Takashi <yamamoto@valinux.co.jp> | 2008-03-28 22:15:50 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-28 22:45:21 +0100 |
commit | 1d4a788f15302877ff2cb08f22009e290a36a209 (patch) | |
tree | 51d2733fb81a75903e4b0f8a5d2ce9f903361ff0 | |
parent | in_atomic(): document why it is unsuitable for general use (diff) | |
download | linux-1d4a788f15302877ff2cb08f22009e290a36a209.tar.xz linux-1d4a788f15302877ff2cb08f22009e290a36a209.zip |
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 <yamamoto@valinux.co.jp>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index dd249c37b3a3..9c042f901570 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); } } |