All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	"Aneesh Kumar K.V"
	<aneesh.kumar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	mhocko-AlSwsSmVLrQ@public.gmane.org,
	kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org,
	liwanp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org
Subject: Re: [PATCH] cgroup: Don't drop the cgroup_mutex in cgroup_rmdir
Date: Fri, 27 Jul 2012 14:15:12 +0800	[thread overview]
Message-ID: <501231F0.8050505@huawei.com> (raw)
In-Reply-To: <20120720200542.GD21218-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

On 2012/7/21 4:05, Tejun Heo wrote:

> Hey, Peter.
> 
> On Fri, Jul 20, 2012 at 05:45:40PM +0200, Peter Zijlstra wrote:
>>> So, Peter, why does cpuset mangle with cgroup_mutex?  What guarantees
>>> does it need?  Why can't it work on "changed" notification while
>>> caching the current css like blkcg does?
>>
>> I've no clue sorry.. /me goes stare at this stuff.. Looks like something
>> Paul Menage did when he created cgroups. I'll have to have a hard look
>> at all that to untangle this. Not something obvious to me.
> 
> Yeah, it would be great if this can be untangled.  I really don't see
> any other reasonable way out of this circular locking mess.  If cpuset
> needs stable css association across certain period, the RTTD is
> caching the css by holding its ref and synchronize modifications to
> that cache, rather than synchronizing cgroup operations themselves.
> 


The cgroup core was extracted from cpuset, so they are deeply tangled.

There are several issues to resolve with regard to removing cgroup lock from cpuset.

- there are places that the cgroup hierarchy is travelled. This should be
easy, as cpuset can be made to maintain its hierarchy.

- cpuset disallows clearing cpuset.mems/cpuset.cpus if the cgroup is not empty,
which can be guaranteed only by cgroup lock.

- cpuset disallows a task be attached to a cgroup with empty cpuset.mems/cpuset.cpus,
which again can be guarantted only by cgroup lock.

- cpuset may move tasks from a cgroup to another cgroup (Glauber mentioned this).

- maybe other cases I overlooked..

WARNING: multiple messages have this Message-ID (diff)
From: Li Zefan <lizefan@huawei.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	akpm@linux-foundation.org, mhocko@suse.cz,
	kamezawa.hiroyu@jp.fujitsu.com, liwanp@linux.vnet.ibm.com,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	glommer@parallels.com
Subject: Re: [PATCH] cgroup: Don't drop the cgroup_mutex in cgroup_rmdir
Date: Fri, 27 Jul 2012 14:15:12 +0800	[thread overview]
Message-ID: <501231F0.8050505@huawei.com> (raw)
In-Reply-To: <20120720200542.GD21218@google.com>

On 2012/7/21 4:05, Tejun Heo wrote:

> Hey, Peter.
> 
> On Fri, Jul 20, 2012 at 05:45:40PM +0200, Peter Zijlstra wrote:
>>> So, Peter, why does cpuset mangle with cgroup_mutex?  What guarantees
>>> does it need?  Why can't it work on "changed" notification while
>>> caching the current css like blkcg does?
>>
>> I've no clue sorry.. /me goes stare at this stuff.. Looks like something
>> Paul Menage did when he created cgroups. I'll have to have a hard look
>> at all that to untangle this. Not something obvious to me.
> 
> Yeah, it would be great if this can be untangled.  I really don't see
> any other reasonable way out of this circular locking mess.  If cpuset
> needs stable css association across certain period, the RTTD is
> caching the css by holding its ref and synchronize modifications to
> that cache, rather than synchronizing cgroup operations themselves.
> 


The cgroup core was extracted from cpuset, so they are deeply tangled.

There are several issues to resolve with regard to removing cgroup lock from cpuset.

- there are places that the cgroup hierarchy is travelled. This should be
easy, as cpuset can be made to maintain its hierarchy.

- cpuset disallows clearing cpuset.mems/cpuset.cpus if the cgroup is not empty,
which can be guaranteed only by cgroup lock.

- cpuset disallows a task be attached to a cgroup with empty cpuset.mems/cpuset.cpus,
which again can be guarantted only by cgroup lock.

- cpuset may move tasks from a cgroup to another cgroup (Glauber mentioned this).

- maybe other cases I overlooked..

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2012-07-27  6:15 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 21:26 + hugetlb-cgroup-simplify-pre_destroy-callback.patch added to -mm tree akpm
     [not found] ` <20120718212637.133475C0050-gd0R4GGuC+lfGOtoag0VdhPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2012-07-19 11:39   ` Michal Hocko
2012-07-19 11:39     ` Michal Hocko
2012-07-19 12:21     ` Aneesh Kumar K.V
     [not found]       ` <87r4s8gcwe.fsf-6yE53ggjAfyqSkle7U1LjlaTQe2KTcn/@public.gmane.org>
2012-07-19 12:38         ` Michal Hocko
2012-07-19 12:38           ` Michal Hocko
     [not found]           ` <20120719123820.GG2864-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2012-07-19 13:48             ` Aneesh Kumar K.V
2012-07-19 13:48               ` Aneesh Kumar K.V
     [not found]               ` <87ipdjc15j.fsf-6yE53ggjAfyqSkle7U1LjlaTQe2KTcn/@public.gmane.org>
2012-07-19 14:09                 ` [PATCH] cgroup: Don't drop the cgroup_mutex in cgroup_rmdir Aneesh Kumar K.V
2012-07-19 14:09                   ` Aneesh Kumar K.V
     [not found]                   ` <1342706972-10912-1-git-send-email-aneesh.kumar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2012-07-19 16:50                     ` Tejun Heo
2012-07-19 16:50                       ` Tejun Heo
2012-07-20 15:45                       ` Peter Zijlstra
2012-07-20 20:05                         ` Tejun Heo
2012-07-20 20:05                           ` Tejun Heo
2012-07-20 22:07                           ` Glauber Costa
     [not found]                           ` <20120720200542.GD21218-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-07-27  6:15                             ` Li Zefan [this message]
2012-07-27  6:15                               ` Li Zefan
     [not found]                               ` <501231F0.8050505-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-07-30 18:25                                 ` Tejun Heo
2012-07-30 18:25                                   ` Tejun Heo
2012-07-20  7:51                     ` Michal Hocko
2012-07-20  7:51                       ` Michal Hocko
2012-07-20 19:49                     ` Tejun Heo
2012-07-20 19:49                       ` Tejun Heo
2012-07-20  1:05                 ` + hugetlb-cgroup-simplify-pre_destroy-callback.patch added to -mm tree Kamezawa Hiroyuki
2012-07-20  1:05                   ` Kamezawa Hiroyuki
     [not found]                   ` <5008AEC2.9090707-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-07-20  1:20                     ` Kamezawa Hiroyuki
2012-07-20  1:20                       ` Kamezawa Hiroyuki
     [not found]                       ` <5008B25D.5000902-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-07-20  8:01                         ` Michal Hocko
2012-07-20  8:01                           ` Michal Hocko
2012-07-20  8:08                           ` Kamezawa Hiroyuki
2012-07-20  8:06               ` Michal Hocko
2012-07-20 19:18                 ` Aneesh Kumar K.V
2012-07-20 19:56                   ` Tejun Heo
     [not found]                     ` <20120720195643.GC21218-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-07-21  2:14                       ` Kamezawa Hiroyuki
2012-07-21  2:14                         ` Kamezawa Hiroyuki
2012-07-21  2:46                         ` Tejun Heo
2012-07-21  4:05                           ` Kamezawa Hiroyuki
     [not found]                             ` <500A2A79.5030705-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-07-22 17:34                               ` Tejun Heo
2012-07-22 17:34                                 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=501231F0.8050505@huawei.com \
    --to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=aneesh.kumar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
    --cc=htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=liwanp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.