linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.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 02:13:57 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1406090209460.24247@chino.kir.corp.google.com> (raw)
In-Reply-To: <539574F1.2060701@cn.fujitsu.com>

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

  reply	other threads:[~2014-06-09  9:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  8:28 Gu Zheng
2014-06-05 14:18 ` Greg KH
2014-06-06  9:34   ` Gu Zheng
2014-06-05 20:23 ` Andrew Morton
2014-06-06 10:07   ` Gu Zheng
2014-06-08 22:47     ` David Rientjes
2014-06-09  8:48       ` Gu Zheng
2014-06-09  9:13         ` David Rientjes [this message]
2014-06-09  9:58           ` Gu Zheng
2014-06-10  2:58           ` Li Zefan
2014-06-10 22:16             ` David Rientjes
2014-06-20 21:01             ` Tejun Heo
2014-06-24  2:28               ` Li Zefan
2014-06-24 20:58                 ` Tejun Heo
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=alpine.DEB.2.02.1406090209460.24247@chino.kir.corp.google.com \
    --to=rientjes@google.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=lizefan@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox