]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
powerpc/pseries: Use stop machine to update cpu maps
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Wed, 24 Apr 2013 06:02:13 +0000 (06:02 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 26 Apr 2013 06:08:24 +0000 (16:08 +1000)
commit30c05350c39de6c17132cfee649518b842d89dd5
tree542873ddbdb3e1bd9a31882e77b33c3b9766ec9a
parent5d88aa85c00bb4026dd986430dc496effc637d42
powerpc/pseries: Use stop machine to update cpu maps

The new PRRN firmware feature allows CPU and memory resources to be
transparently reassigned across NUMA boundaries. When this happens, the
kernel must update the node maps to reflect the new affinity information.

Although the NUMA maps can be protected by locking primitives during the
update itself, this is insufficient to prevent concurrent accesses to these
structures. Since cpumask_of_node() hands out a pointer to these
structures, they can still be modified outside of the lock. Furthermore,
tracking down each usage of these pointers and adding locks would be quite
invasive and difficult to maintain.

The approach used is to make a list of affected cpus and call stop_machine
to have the update routine run on each of the affected cpus allowing them
to update themselves. Each cpu finds itself in the list of cpus and makes
the appropriate updates. We need to have each cpu do this for themselves to
handle calls to vdso_getcpu_init() added in a subsequent patch.

Situations like these are best handled using stop_machine(). Since the NUMA
affinity updates are exceptionally rare events, this approach has the
benefit of not adding any overhead while accessing the NUMA maps during
normal operation.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/numa.c