[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1109131503520.11120@chino.kir.corp.google.com>
Date: Tue, 13 Sep 2011 15:06:04 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Miao Xie <miaox@...fujitsu.com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Nick Piggin <npiggin@...e.de>,
Paul Menage <paul@...lmenage.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [patch] cpusets: avoid looping when storing to mems_allowed if
one node remains set
On Tue, 13 Sep 2011, Miao Xie wrote:
> This patch is dangerous if the task has a bind memory policy that was set
> to be neither MPOL_F_STATIC_NODES nor MPOL_F_RELATIVE_NODES, because the
> memory policy use node_remap() to rebind the allowed nodes, but node_remap()
> may make the old mask and the new mask nonoverlapping. So at this condition,
> the task may also see an empty node mask.
>
The vast majority of cpuset users are not going to have mempolicies at
all, the cpuset itself is the only policy they need to take advantage of
the NUMA locality of their machine. I'd be find with checking for
!tsk->mempolicy in this exception as well since we already hold
task_lock(tsk), but I think the real fix would be to make sure that an
empty nodemask is never returned by mempolicies. Something like ensuring
that if the preferred node is MAX_NUMNODES (since it is determined by
using first_node() over a possibly racing empty nodemask) that the first
online node is returned during the race and that
node_states[N_HIGH_MEMORY] is returned if an MPOL_BIND or MPOL_INTERLEAVE
mask is empty. Thoughts?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists