All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan@huawei.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Rientjes <rientjes@google.com>,
	Gu Zheng <guz.fnst@cn.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, Cgroups <cgroups@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] mm/mempolicy: fix sleeping function called from invalid context
Date: Tue, 24 Jun 2014 10:28:12 +0800	[thread overview]
Message-ID: <53A8E23C.4050103@huawei.com> (raw)
In-Reply-To: <20140620210137.GA2059@mtj.dyndns.org>

On 2014/6/21 5:01, Tejun Heo wrote:
> Hello, Li.
> 
> Sorry about the long delay.
> 
> On Tue, Jun 10, 2014 at 10:58:45AM +0800, Li Zefan wrote:
>> Yes, this is a long-standing issue. Besides the race you described, the child
>> task's mems_allowed can be wrong if the cpuset's nodemask changes before the
>> child has been added to the cgroup's tasklist.
>>
>> I remember Tejun once said he wanted to disallow task migration between
>> cgroups during fork, and that should fix this problem.
> 
> I'm having trouble remembering but yeah enforcing stricter behavior
> across fork could be beneficial.  Hmmm... the problem with making
> forks exclusive against migrations is that we'll end up adding more
> locking to the fork path which isn't too nice.
> 
> Hmmm... other controllers (cgroup_freezer) can reliably synchronize
> the child's state to the cgroup it belongs to.  Why can't cpuset?  Is
> there something fundamentally missing in the cgroup API?
> 

cgroup_freezer uses the fork callback. We can also do this for cpuset as
suggested by David, which adds a little bit overhead to the fork path.

David, care to send out a patch?

>>> It needs to be slightly rewritten to work properly without negatively 
>>> impacting the latency of fork().  Do you have the cycles to do it?
>>>
>>
>> Sounds you have other idea?
> 
> I don't think the suggested patch breaks anything more than it was
> broken before and we should probably apply it for the time being.  Li?
> 

Yeah, we should apply Gu Zheng's patch any way.

WARNING: multiple messages have this Message-ID (diff)
From: Li Zefan <lizefan@huawei.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Rientjes <rientjes@google.com>,
	Gu Zheng <guz.fnst@cn.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, Cgroups <cgroups@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] mm/mempolicy: fix sleeping function called from invalid context
Date: Tue, 24 Jun 2014 10:28:12 +0800	[thread overview]
Message-ID: <53A8E23C.4050103@huawei.com> (raw)
In-Reply-To: <20140620210137.GA2059@mtj.dyndns.org>

On 2014/6/21 5:01, Tejun Heo wrote:
> Hello, Li.
> 
> Sorry about the long delay.
> 
> On Tue, Jun 10, 2014 at 10:58:45AM +0800, Li Zefan wrote:
>> Yes, this is a long-standing issue. Besides the race you described, the child
>> task's mems_allowed can be wrong if the cpuset's nodemask changes before the
>> child has been added to the cgroup's tasklist.
>>
>> I remember Tejun once said he wanted to disallow task migration between
>> cgroups during fork, and that should fix this problem.
> 
> I'm having trouble remembering but yeah enforcing stricter behavior
> across fork could be beneficial.  Hmmm... the problem with making
> forks exclusive against migrations is that we'll end up adding more
> locking to the fork path which isn't too nice.
> 
> Hmmm... other controllers (cgroup_freezer) can reliably synchronize
> the child's state to the cgroup it belongs to.  Why can't cpuset?  Is
> there something fundamentally missing in the cgroup API?
> 

cgroup_freezer uses the fork callback. We can also do this for cpuset as
suggested by David, which adds a little bit overhead to the fork path.

David, care to send out a patch?

>>> It needs to be slightly rewritten to work properly without negatively 
>>> impacting the latency of fork().  Do you have the cycles to do it?
>>>
>>
>> Sounds you have other idea?
> 
> I don't think the suggested patch breaks anything more than it was
> broken before and we should probably apply it for the time being.  Li?
> 

Yeah, we should apply Gu Zheng's patch any way.

--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Li Zefan <lizefan@huawei.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Rientjes <rientjes@google.com>,
	Gu Zheng <guz.fnst@cn.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
	Cgroups <cgroups@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] mm/mempolicy: fix sleeping function called from invalid context
Date: Tue, 24 Jun 2014 10:28:12 +0800	[thread overview]
Message-ID: <53A8E23C.4050103@huawei.com> (raw)
In-Reply-To: <20140620210137.GA2059@mtj.dyndns.org>

On 2014/6/21 5:01, Tejun Heo wrote:
> Hello, Li.
> 
> Sorry about the long delay.
> 
> On Tue, Jun 10, 2014 at 10:58:45AM +0800, Li Zefan wrote:
>> Yes, this is a long-standing issue. Besides the race you described, the child
>> task's mems_allowed can be wrong if the cpuset's nodemask changes before the
>> child has been added to the cgroup's tasklist.
>>
>> I remember Tejun once said he wanted to disallow task migration between
>> cgroups during fork, and that should fix this problem.
> 
> I'm having trouble remembering but yeah enforcing stricter behavior
> across fork could be beneficial.  Hmmm... the problem with making
> forks exclusive against migrations is that we'll end up adding more
> locking to the fork path which isn't too nice.
> 
> Hmmm... other controllers (cgroup_freezer) can reliably synchronize
> the child's state to the cgroup it belongs to.  Why can't cpuset?  Is
> there something fundamentally missing in the cgroup API?
> 

cgroup_freezer uses the fork callback. We can also do this for cpuset as
suggested by David, which adds a little bit overhead to the fork path.

David, care to send out a patch?

>>> It needs to be slightly rewritten to work properly without negatively 
>>> impacting the latency of fork().  Do you have the cycles to do it?
>>>
>>
>> Sounds you have other idea?
> 
> I don't think the suggested patch breaks anything more than it was
> broken before and we should probably apply it for the time being.  Li?
> 

Yeah, we should apply Gu Zheng's patch any way.


  reply	other threads:[~2014-06-24  2:28 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  8:28 [PATCH] mm/mempolicy: fix sleeping function called from invalid context Gu Zheng
2014-06-05  8:28 ` Gu Zheng
2014-06-05 14:18 ` Greg KH
2014-06-05 14:18   ` Greg KH
     [not found]   ` <20140605141833.GA26830-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-06-06  9:34     ` Gu Zheng
2014-06-06  9:34       ` Gu Zheng
2014-06-06  9:34       ` Gu Zheng
2014-06-05 20:23 ` Andrew Morton
2014-06-05 20:23   ` Andrew Morton
2014-06-05 20:23   ` Andrew Morton
2014-06-06 10:07   ` Gu Zheng
2014-06-06 10:07     ` Gu Zheng
2014-06-08 22:47     ` David Rientjes
2014-06-08 22:47       ` David Rientjes
2014-06-09  8:48       ` Gu Zheng
2014-06-09  8:48         ` Gu Zheng
2014-06-09  9:13         ` David Rientjes
2014-06-09  9:13           ` David Rientjes
2014-06-09  9:58           ` Gu Zheng
2014-06-09  9:58             ` Gu Zheng
2014-06-10  2:58           ` Li Zefan
2014-06-10  2:58             ` Li Zefan
     [not found]             ` <53967465.7070908-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-06-10 22:16               ` David Rientjes
2014-06-10 22:16                 ` David Rientjes
2014-06-10 22:16                 ` David Rientjes
2014-06-20 21:01             ` Tejun Heo
2014-06-20 21:01               ` Tejun Heo
2014-06-24  2:28               ` Li Zefan [this message]
2014-06-24  2:28                 ` Li Zefan
2014-06-24  2:28                 ` Li Zefan
2014-06-24 20:58                 ` Tejun Heo
2014-06-24 20:58                   ` Tejun Heo
2014-06-25  0:57                   ` Gu Zheng
2014-06-25  0:57                     ` Gu Zheng

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=53A8E23C.4050103@huawei.com \
    --to=lizefan@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.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.