From: Gu Zheng <guz.fnst@cn.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Tejun Heo <tj@kernel.org>,
linux-mm@kvack.org, Cgroups <cgroups@vger.kernel.org>,
stable@vger.kernel.org, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] mm/mempolicy: fix sleeping function called from invalid context
Date: Mon, 9 Jun 2014 17:58:17 +0800 [thread overview]
Message-ID: <53958539.1070904@cn.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1406090209460.24247@chino.kir.corp.google.com>
Hi David,
On 06/09/2014 05:13 PM, David Rientjes wrote:
> On Mon, 9 Jun 2014, Gu Zheng wrote:
>
>>> I think your patch addresses the problem that you're reporting but misses
>>> the larger problem with cpuset.mems rebinding on fork(). When the
>>> forker's task_struct is duplicated (which includes ->mems_allowed) and it
>>> races with an update to cpuset_being_rebound in update_tasks_nodemask()
>>> then the task's mems_allowed doesn't get updated.
>>
>> Yes, you are right, this patch just wants to address the bug reported above.
>> The race condition you mentioned above inherently exists there, but it is yet
>> another issue, the rcu lock here makes no sense to it, and I think we need
>> additional sync-mechanisms if want to fix it.
>
> Yes, the rcu lock is not providing protection for any critical section
> here that requires (1) the forker's cpuset to be stored in
> cpuset_being_rebound or (2) the forked thread's cpuset to be rebound by
> the cpuset nodemask update, and no race involving the two.
>
>> But thinking more, though the current implementation has flaw, but I worry
>> about the negative effect if we really want to fix it. Or maybe the fear
>> is unnecessary.:)
>>
>
> It needs to be slightly rewritten to work properly without negatively
> impacting the latency of fork(). Do you have the cycles to do it?
>
To be honest, I'm busy with other schedule. And if you(or other
guys) have proper proposal, please go ahead.
To Tejun, Li and Andrew:
Any comment? Or could you apply this *bug fix* first?
Regards,
Gu
--
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: Gu Zheng <guz.fnst@cn.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Tejun Heo <tj@kernel.org>, <linux-mm@kvack.org>,
Cgroups <cgroups@vger.kernel.org>, <stable@vger.kernel.org>,
Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] mm/mempolicy: fix sleeping function called from invalid context
Date: Mon, 9 Jun 2014 17:58:17 +0800 [thread overview]
Message-ID: <53958539.1070904@cn.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1406090209460.24247@chino.kir.corp.google.com>
Hi David,
On 06/09/2014 05:13 PM, David Rientjes wrote:
> On Mon, 9 Jun 2014, Gu Zheng wrote:
>
>>> I think your patch addresses the problem that you're reporting but misses
>>> the larger problem with cpuset.mems rebinding on fork(). When the
>>> forker's task_struct is duplicated (which includes ->mems_allowed) and it
>>> races with an update to cpuset_being_rebound in update_tasks_nodemask()
>>> then the task's mems_allowed doesn't get updated.
>>
>> Yes, you are right, this patch just wants to address the bug reported above.
>> The race condition you mentioned above inherently exists there, but it is yet
>> another issue, the rcu lock here makes no sense to it, and I think we need
>> additional sync-mechanisms if want to fix it.
>
> Yes, the rcu lock is not providing protection for any critical section
> here that requires (1) the forker's cpuset to be stored in
> cpuset_being_rebound or (2) the forked thread's cpuset to be rebound by
> the cpuset nodemask update, and no race involving the two.
>
>> But thinking more, though the current implementation has flaw, but I worry
>> about the negative effect if we really want to fix it. Or maybe the fear
>> is unnecessary.:)
>>
>
> It needs to be slightly rewritten to work properly without negatively
> impacting the latency of fork(). Do you have the cycles to do it?
>
To be honest, I'm busy with other schedule. And if you(or other
guys) have proper proposal, please go ahead.
To Tejun, Li and Andrew:
Any comment? Or could you apply this *bug fix* first?
Regards,
Gu
next prev parent reply other threads:[~2014-06-09 9:58 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 [this message]
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
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=53958539.1070904@cn.fujitsu.com \
--to=guz.fnst@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan@huawei.com \
--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.