diff options
author | Ravikiran G Thirumalai <kiran@scalex86.org> | 2006-01-11 22:45:42 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-11 19:04:59 -0800 |
commit | 365ba9179f84244d2ffa98e46ae3cddfeb2ef6ff (patch) | |
tree | b84be7f9f929d8084fa76af2618877439baee841 /arch/x86_64/kernel/smpboot.c | |
parent | df79efde82952edc653fa6eb1338a82b87aa0585 (diff) | |
download | op-kernel-dev-365ba9179f84244d2ffa98e46ae3cddfeb2ef6ff.zip op-kernel-dev-365ba9179f84244d2ffa98e46ae3cddfeb2ef6ff.tar.gz |
[PATCH] x86_64: Allocate PDAs in the local node
Patch uses a static PDA array early at boot and reallocates processor PDA
with node local memory when kmalloc is ready, just before pda_init.
The boot_cpu_pda is needed since the cpu_pda is used even before pda_init for
that cpu is called (to set the static per-cpu areas offset table etc)
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/smpboot.c')
-rw-r--r-- | arch/x86_64/kernel/smpboot.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index 4884ca1..c8169d0 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c @@ -757,6 +757,23 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid) return -1; } + /* Allocate node local memory for AP pdas */ + if (cpu_pda(cpu) == &boot_cpu_pda[cpu]) { + struct x8664_pda *newpda, *pda; + int node = cpu_to_node(cpu); + pda = cpu_pda(cpu); + newpda = kmalloc_node(sizeof (struct x8664_pda), GFP_ATOMIC, + node); + if (newpda) { + memcpy(newpda, pda, sizeof (struct x8664_pda)); + cpu_pda(cpu) = newpda; + } else + printk(KERN_ERR + "Could not allocate node local PDA for CPU %d on node %d\n", + cpu, node); + } + + c_idle.idle = get_idle_for_cpu(cpu); if (c_idle.idle) { |