powerpc/nohash: Allocate stale_map[cpu] on CPU_UP_PREPARE not CPU_ONLINE
authorMichael Ellerman <michael@ellerman.id.au>
Mon, 4 Apr 2011 20:57:27 +0000 (20:57 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 20 Apr 2011 07:01:18 +0000 (17:01 +1000)
commitf5be2dc0bd8d27a39d84a89e4ff90ba38cd2b285
tree525b1c356df5d1c977dc952c4501f79ff1325db3
parentde300974761d92f71cb583730ac9e1d4eb1b7156
powerpc/nohash: Allocate stale_map[cpu] on CPU_UP_PREPARE not CPU_ONLINE

Currently we allocate the stale_map for a cpu when it comes online,
this leaves open a small window where a process can be scheduled
on the cpu before the stale_map is allocated. Instead allocate
the stale_map at CPU_UP_PREPARE time, that way it will be always
available before tasks start running.

It is possible the cpu fails to come up, in which case we should free
the stale_map, so add a CPU_UP_CANCELED case to do that.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/mmu_context_nohash.c