Skip to content

Commit

Permalink
memcgroup: fix spurious EBUSY on memory cgroup removal
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YAMAMOTO Takashi authored and Linus Torvalds committed Mar 28, 2008
1 parent 8c703d3 commit 1d4a788
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -416,6 +415,7 @@ void mmput(struct mm_struct *mm)
spin_unlock(&mmlist_lock);
}
put_swap_token(mm);
mm_free_cgroup(mm);
mmdrop(mm);
}
}
Expand Down

0 comments on commit 1d4a788

Please sign in to comment.