Re: [BUG] set_mempolicy(MPOL_INTERLEAV) cause kernel panic

From: David Rientjes
Date: Mon Jul 27 2009 - 13:56:10 EST


On Sat, 25 Jul 2009, KAMEZAWA Hiroyuki wrote:

> _Direct_ use of task->mems_allowed is only in cpuset and mempolicy.
> If no policy is used, it's not checked.
> (See alloc_pages_current())
>
> memory hotplug's notifier just updates top_cpuset's mems_allowed.
> But it doesn't update each task's ones.

That's not true, cpuset_track_online_nodes() will call
scan_for_empty_cpusets() on top_cpuset, which works from the root to
leaves updating each cpuset's mems_allowed by intersecting it with
node_states[N_HIGH_MEMORY]. This is done as part of the MEM_OFFLINE
callback in the cpuset code, so N_HIGH_MEMORY represents the nodes still
online.

The nodemask for each task is updated to reflect the removal of a node and
it calls mpol_rebind_mm() with the new nodemask.

This is admittedly pretty late to be removing mems from cpusets (and
mempolicies) when the unplug has already happened. We should look at
doing the rebind for MEM_GOING_OFFLINE.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/