]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Dynamically allocate pacas
authorMichael Ellerman <michael@ellerman.id.au>
Thu, 28 Jan 2010 13:23:22 +0000 (13:23 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 9 Mar 2010 00:52:52 +0000 (11:52 +1100)
commit0ba00dd5f05fef8b3b1ef2de853fcc708ebb140f
treefade4f3afd6324b46e27f3c8702935a7edc2fe21
parent3b605b12ed54a51a35761d2575c8685d8730ab11
powerpc: Dynamically allocate pacas

On 64-bit kernels we currently have a 512 byte struct paca_struct for
each cpu (usually just called "the paca"). Currently they are statically
allocated, which means a kernel built for a large number of cpus will
waste a lot of space if it's booted on a machine with few cpus.

We can avoid that by only allocating the number of pacas we need at
boot. However this is complicated by the fact that we need to access
the paca before we know how many cpus there are in the system.

The solution is to dynamically allocate enough space for NR_CPUS pacas,
but then later in boot when we know how many cpus we have, we free any
unused pacas.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/paca.h
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/paca.c
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/platforms/iseries/exception.S