Re: [patch] cpusets: avoid looping when storing to mems_allowed if one node remains set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]