Re: [discuss] [patch 3/3] x86_64: Node local pda take 2 -- node local pda allocation

From: Ravikiran G Thirumalai
Date: Thu Dec 15 2005 - 22:54:57 EST


On Fri, Dec 16, 2005 at 01:19:34AM +0100, Andi Kleen wrote:
>
> And for the APs you allocate the PDA in smpboot.c before actually sending
> the startup IPI to the AP.

You mean wakeup_secondary_via_INIT, called by do_boot_cpu?
That is too late. sched_init happens much earlier, and the per-cpu offset
table for all AP cpus not present is referenced, and I hit an early exception.
sched_init is executed on the BP very early and sched_init does this:

for (i = 0; i < NR_CPUS; i++) {
prio_array_t *array;

rq = cpu_rq(i);

The cpu_rq macro ends up needing per-cpu offset table stored in cpu_pda of
the AP cpus, even before we hit the code to send startup IPIs.
(#define __per_cpu_offset(cpu) (cpu_pda[cpu].data_offset))
This is way before slab is ready. So I either use alloc_bootmem before
sched_init in setup_arch, or keep the static boot_cpu_pda.

Am I missing something?

Thanks,
Kiran
-
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/