Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-11-04 Thread Li Zefan
On 2012/11/1 3:44, Tejun Heo wrote: > Because ->pre_destroy() could fail and can't be called under > cgroup_mutex, cgroup destruction did something very ugly. > > 1. Grab cgroup_mutex and verify it can be destroyed; fail otherwise. > > 2. Release cgroup_mutex and call ->pre_destroy(). > >

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-11-02 Thread Kamezawa Hiroyuki
(2012/11/01 4:44), Tejun Heo wrote: > Because ->pre_destroy() could fail and can't be called under > cgroup_mutex, cgroup destruction did something very ugly. > >1. Grab cgroup_mutex and verify it can be destroyed; fail otherwise. > >2. Release cgroup_mutex and call ->pre_destroy(). > >

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-11-02 Thread Kamezawa Hiroyuki
(2012/10/31 13:22), Tejun Heo wrote: > Because ->pre_destroy() could fail and can't be called under > cgroup_mutex, cgroup destruction did something very ugly. > >1. Grab cgroup_mutex and verify it can be destroyed; fail otherwise. > >2. Release cgroup_mutex and call ->pre_destroy(). > >

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-11-01 Thread Michal Hocko
On Wed 31-10-12 14:27:25, Tejun Heo wrote: > Hey, Michal. > > On Wed, Oct 31, 2012 at 10:23:59PM +0100, Michal Hocko wrote: > > > + for_each_subsys(cgrp->root, ss) > > > + if (ss->pre_destroy) > > > + WARN_ON_ONCE(ss->pre_destroy(cgrp)); > > > > Do you think that BUG_ON wo

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-10-31 Thread Tejun Heo
Hey, Michal. On Wed, Oct 31, 2012 at 10:23:59PM +0100, Michal Hocko wrote: > > + for_each_subsys(cgrp->root, ss) > > + if (ss->pre_destroy) > > + WARN_ON_ONCE(ss->pre_destroy(cgrp)); > > Do you think that BUG_ON would be too harsh? Yeah, I do think so. In general,

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-10-31 Thread Michal Hocko
On Wed 31-10-12 12:44:06, Tejun Heo wrote: [...] > diff --git a/kernel/cgroup.c b/kernel/cgroup.c > index f22e3cd..66204a6 100644 > --- a/kernel/cgroup.c > +++ b/kernel/cgroup.c [...] > @@ -4122,13 +4079,30 @@ static int cgroup_rmdir(struct inode *unused_dir, > struct dentry *dentry) > } >

[PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-10-31 Thread Tejun Heo
Because ->pre_destroy() could fail and can't be called under cgroup_mutex, cgroup destruction did something very ugly. 1. Grab cgroup_mutex and verify it can be destroyed; fail otherwise. 2. Release cgroup_mutex and call ->pre_destroy(). 3. Re-grab cgroup_mutex and verify it can still be d

[PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-10-31 Thread Tejun Heo
Because ->pre_destroy() could fail and can't be called under cgroup_mutex, cgroup destruction did something very ugly. 1. Grab cgroup_mutex and verify it can be destroyed; fail otherwise. 2. Release cgroup_mutex and call ->pre_destroy(). 3. Re-grab cgroup_mutex and verify it can still be d

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-10-31 Thread Michal Hocko
On Tue 30-10-12 21:22:41, Tejun Heo wrote: > Because ->pre_destroy() could fail and can't be called under > cgroup_mutex, cgroup destruction did something very ugly. You are referring to a commit in the comment but I would rather see it here. > 1. Grab cgroup_mutex and verify it can be destroye

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-10-31 Thread Glauber Costa
On 10/31/2012 08:22 AM, Tejun Heo wrote: > Because ->pre_destroy() could fail and can't be called under > cgroup_mutex, cgroup destruction did something very ugly. > > 1. Grab cgroup_mutex and verify it can be destroyed; fail otherwise. > > 2. Release cgroup_mutex and call ->pre_destroy(). >

[PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-10-30 Thread Tejun Heo
Because ->pre_destroy() could fail and can't be called under cgroup_mutex, cgroup destruction did something very ugly. 1. Grab cgroup_mutex and verify it can be destroyed; fail otherwise. 2. Release cgroup_mutex and call ->pre_destroy(). 3. Re-grab cgroup_mutex and verify it can still be d