Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Li Zefan
On 2014/4/16 11:50, Eric W. Biederman wrote: > Kay Sievers writes: > >> On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan wrote: >>> On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Li Zefan
On 2014/4/16 11:33, Kay Sievers wrote: > On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan wrote: >> On 2014/4/15 5:44, Tejun Heo wrote: >>> cgroup users often need a way to determine when a cgroup's >>> subhierarchy becomes empty so that it can be cleaned up. cgroup >>> currently provides release_agent

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Kay Sievers
On Tue, Apr 15, 2014 at 8:50 PM, Eric W. Biederman wrote: > Kay Sievers writes: > >> On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan wrote: >>> On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Eric W. Biederman
Kay Sievers writes: > On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan wrote: >> On 2014/4/15 5:44, Tejun Heo wrote: >>> cgroup users often need a way to determine when a cgroup's >>> subhierarchy becomes empty so that it can be cleaned up. cgroup >>> currently provides release_agent for it;

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Kay Sievers
On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan wrote: > On 2014/4/15 5:44, Tejun Heo wrote: >> cgroup users often need a way to determine when a cgroup's >> subhierarchy becomes empty so that it can be cleaned up. cgroup >> currently provides release_agent for it; unfortunately, this mechanism >> is

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Li Zefan
Hi Tejun, On 2014/4/15 5:44, Tejun Heo wrote: > cgroup users often need a way to determine when a cgroup's > subhierarchy becomes empty so that it can be cleaned up. cgroup > currently provides release_agent for it; unfortunately, this mechanism > is riddled with issues. > > * It delivers

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Li Zefan
On 2014/4/16 0:52, Tejun Heo wrote: > On Tue, Apr 15, 2014 at 10:54:50AM -0400, Tejun Heo wrote: >> Hello, >> >> On Tue, Apr 15, 2014 at 08:57:21AM +0800, Li Zefan wrote: >>> Is cgroup.tree_populated a better name? >>> >>> cgroup.subtree_control controls child cgroups only, but .subtree_populated

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Tejun Heo
On Tue, Apr 15, 2014 at 10:54:50AM -0400, Tejun Heo wrote: > Hello, > > On Tue, Apr 15, 2014 at 08:57:21AM +0800, Li Zefan wrote: > > Is cgroup.tree_populated a better name? > > > > cgroup.subtree_control controls child cgroups only, but .subtree_populated > > shows 1 if there're tasks in the

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Tejun Heo
Hello, On Tue, Apr 15, 2014 at 08:57:21AM +0800, Li Zefan wrote: > Is cgroup.tree_populated a better name? > > cgroup.subtree_control controls child cgroups only, but .subtree_populated > shows 1 if there're tasks in the cgroup or its children, so the two > are a bit inconsistent to me. Yes,

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Tejun Heo
Hello, On Tue, Apr 15, 2014 at 08:57:21AM +0800, Li Zefan wrote: Is cgroup.tree_populated a better name? cgroup.subtree_control controls child cgroups only, but .subtree_populated shows 1 if there're tasks in the cgroup or its children, so the two are a bit inconsistent to me. Yes, good

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Tejun Heo
On Tue, Apr 15, 2014 at 10:54:50AM -0400, Tejun Heo wrote: Hello, On Tue, Apr 15, 2014 at 08:57:21AM +0800, Li Zefan wrote: Is cgroup.tree_populated a better name? cgroup.subtree_control controls child cgroups only, but .subtree_populated shows 1 if there're tasks in the cgroup or its

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Li Zefan
On 2014/4/16 0:52, Tejun Heo wrote: On Tue, Apr 15, 2014 at 10:54:50AM -0400, Tejun Heo wrote: Hello, On Tue, Apr 15, 2014 at 08:57:21AM +0800, Li Zefan wrote: Is cgroup.tree_populated a better name? cgroup.subtree_control controls child cgroups only, but .subtree_populated shows 1 if

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Li Zefan
Hi Tejun, On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides release_agent for it; unfortunately, this mechanism is riddled with issues. * It delivers events by

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Kay Sievers
On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan lize...@huawei.com wrote: On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides release_agent for it; unfortunately, this

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Eric W. Biederman
Kay Sievers k...@vrfy.org writes: On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan lize...@huawei.com wrote: On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Kay Sievers
On Tue, Apr 15, 2014 at 8:50 PM, Eric W. Biederman ebied...@xmission.com wrote: Kay Sievers k...@vrfy.org writes: On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan lize...@huawei.com wrote: On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Li Zefan
On 2014/4/16 11:33, Kay Sievers wrote: On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan lize...@huawei.com wrote: On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-15 Thread Li Zefan
On 2014/4/16 11:50, Eric W. Biederman wrote: Kay Sievers k...@vrfy.org writes: On Tue, Apr 15, 2014 at 7:48 PM, Li Zefan lize...@huawei.com wrote: On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-14 Thread Li Zefan
On 2014/4/15 5:44, Tejun Heo wrote: > cgroup users often need a way to determine when a cgroup's > subhierarchy becomes empty so that it can be cleaned up. cgroup > currently provides release_agent for it; unfortunately, this mechanism > is riddled with issues. > > * It delivers events by

[PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-14 Thread Tejun Heo
cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides release_agent for it; unfortunately, this mechanism is riddled with issues. * It delivers events by forking and execing a userland binary specified as

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-14 Thread Li Zefan
On 2014/4/15 5:44, Tejun Heo wrote: cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides release_agent for it; unfortunately, this mechanism is riddled with issues. * It delivers events by forking and

[PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-14 Thread Tejun Heo
cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides release_agent for it; unfortunately, this mechanism is riddled with issues. * It delivers events by forking and execing a userland binary specified as

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-11 Thread Li Zefan
> Ah, you're right, cgroup_task_migrate() sets CGRP_RELEASABLE > explicitly. I was confused because put_css_set_locked() sets > CGRP_RELEASABLE only if @taskexit is set. Will drop that part from > the description. > "If the notify_on_release flag is enabled (1) in a cgroup, then whenever the

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-11 Thread Li Zefan
Ah, you're right, cgroup_task_migrate() sets CGRP_RELEASABLE explicitly. I was confused because put_css_set_locked() sets CGRP_RELEASABLE only if @taskexit is set. Will drop that part from the description. If the notify_on_release flag is enabled (1) in a cgroup, then whenever the last

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-10 Thread Tejun Heo
Hello, On Thu, Apr 10, 2014 at 09:04:24AM -0500, Serge Hallyn wrote: > Except for the keeping state. If the userspace agent crashes when it > was meant to drop 100 cgroups when they become empty, then when it > restarts those 100 cgroups may never be freed. Of course userspace > can do things

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-10 Thread Serge Hallyn
Quoting Tejun Heo (t...@kernel.org): > Hey, Serge. > > On Thu, Apr 10, 2014 at 05:08:55AM +0200, Serge E. Hallyn wrote: > > Quoting Tejun Heo (t...@kernel.org): > > > * It delivers events by forking and execing a userland binary > > > specified as the release_agent. This is a long deprecated

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-10 Thread Tejun Heo
Hey, Serge. On Thu, Apr 10, 2014 at 05:08:55AM +0200, Serge E. Hallyn wrote: > Quoting Tejun Heo (t...@kernel.org): > > * It delivers events by forking and execing a userland binary > > specified as the release_agent. This is a long deprecated method of > > notification delivery. It's

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-10 Thread Tejun Heo
Hey, Serge. On Thu, Apr 10, 2014 at 05:08:55AM +0200, Serge E. Hallyn wrote: Quoting Tejun Heo (t...@kernel.org): * It delivers events by forking and execing a userland binary specified as the release_agent. This is a long deprecated method of notification delivery. It's extremely

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-10 Thread Serge Hallyn
Quoting Tejun Heo (t...@kernel.org): Hey, Serge. On Thu, Apr 10, 2014 at 05:08:55AM +0200, Serge E. Hallyn wrote: Quoting Tejun Heo (t...@kernel.org): * It delivers events by forking and execing a userland binary specified as the release_agent. This is a long deprecated method of

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-10 Thread Tejun Heo
Hello, On Thu, Apr 10, 2014 at 09:04:24AM -0500, Serge Hallyn wrote: Except for the keeping state. If the userspace agent crashes when it was meant to drop 100 cgroups when they become empty, then when it restarts those 100 cgroups may never be freed. Of course userspace can do things about

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-09 Thread Serge E. Hallyn
Quoting Tejun Heo (t...@kernel.org): > cgroup users often need a way to determine when a cgroup's > subhierarchy becomes empty so that it can be cleaned up. cgroup > currently provides release_agent for it; unfortunately, this mechanism > is riddled with issues. Thanks, Tejun. > * It delivers

[PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-09 Thread Tejun Heo
cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides release_agent for it; unfortunately, this mechanism is riddled with issues. * It delivers events by forking and execing a userland binary specified as

[PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-09 Thread Tejun Heo
cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides release_agent for it; unfortunately, this mechanism is riddled with issues. * It delivers events by forking and execing a userland binary specified as

Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy

2014-04-09 Thread Serge E. Hallyn
Quoting Tejun Heo (t...@kernel.org): cgroup users often need a way to determine when a cgroup's subhierarchy becomes empty so that it can be cleaned up. cgroup currently provides release_agent for it; unfortunately, this mechanism is riddled with issues. Thanks, Tejun. * It delivers events