From: Nick Piggin <npiggin@suse.de>
To: David Rientjes <rientjes@google.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Miao Xie <miaox@cn.fujitsu.com>,
Lee Schermerhorn <lee.schermerhorn@hp.com>
Subject: Re: [regression] cpuset,mm: update tasks' mems_allowed in time (58568d2)
Date: Mon, 22 Feb 2010 23:12:22 +1100 [thread overview]
Message-ID: <20100222121222.GV9738@laptop> (raw)
In-Reply-To: <alpine.DEB.2.00.1002190143040.6293@chino.kir.corp.google.com>
On Fri, Feb 19, 2010 at 02:06:45AM -0800, David Rientjes wrote:
> On Fri, 19 Feb 2010, Nick Piggin wrote:
> > But it doesn't matter if stores are done under lock, if the loads are
> > not. masks can be multiple words, so there isn't any ordering between
> > reading half and old mask and half a new one that results in an invalid
> > state. AFAIKS.
> >
>
> It doesn't matter for MAX_NUMNODES > BITS_PER_LONG because
> task->mems_alllowed only gets updated via cpuset_change_task_nodemask()
> where the added nodes are set and then the removed nodes are cleared. The
> side effect of this lockless access to task->mems_allowed means we may
> have a small race between
>
> nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems);
>
> and
>
> tsk->mems_allowed = *newmems;
>
> but the penalty is that we get an allocation on a removed node, which
> isn't a big deal, especially since it was previously allowed.
If you have a concurrent reader without any synchronisation, then what
stops it from loading a word of the mask before stores to add the new
nodes and then loading another word of the mask after the stores to
remove the old nodes? (which can give an empty mask).
--
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>
next prev parent reply other threads:[~2010-02-22 12:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-18 13:49 Nick Piggin
2010-02-18 21:38 ` David Rientjes
2010-02-19 3:31 ` Nick Piggin
2010-02-19 10:06 ` David Rientjes
2010-02-22 11:53 ` Miao Xie
2010-02-22 12:06 ` Nick Piggin
2010-02-23 1:48 ` Miao Xie
2010-02-22 22:06 ` David Rientjes
2010-02-23 7:32 ` Miao Xie
2010-02-23 8:55 ` David Rientjes
2010-02-23 9:23 ` Miao Xie
2010-02-23 22:31 ` David Rientjes
2010-02-24 9:35 ` Miao Xie
2010-02-24 21:08 ` David Rientjes
2010-02-25 1:18 ` Miao Xie
2010-02-22 12:12 ` Nick Piggin [this message]
2010-02-22 22:00 ` David Rientjes
2010-02-23 8:25 ` Miao Xie
2010-02-23 8:44 ` David Rientjes
2010-02-24 9:49 ` Miao Xie
2010-02-24 21:06 ` David Rientjes
2010-02-19 7:51 ` KOSAKI Motohiro
2010-02-19 9:42 ` David Rientjes
2010-02-19 7:56 ` KAMEZAWA Hiroyuki
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=20100222121222.GV9738@laptop \
--to=npiggin@suse.de \
--cc=lee.schermerhorn@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=miaox@cn.fujitsu.com \
--cc=rientjes@google.com \
/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