Re: [PATCH 03/12] x86-64: Convert irqstacks to per-cpu

From: Brian Gerst
Date: Sun Jan 18 2009 - 13:16:48 EST

On Sun, Jan 18, 2009 at 11:39 AM, Tejun Heo <tj@xxxxxxxxxx> wrote:
> From: Brian Gerst <brgerst@xxxxxxxxx>
> Move the irqstackptr variable from the PDA to per-cpu. Make the
> stacks themselves per-cpu, removing some specific allocation code.
> Add a seperate flag (is_boot_cpu) to simplify the per-cpu boot
> adjustments.
> tj: * sprinkle some underbars around.
> * irq_stack_ptr is not used till traps_init(), no reason to
> initialize it early. On SMP, just leaving it NULL till proper
> initialization in setup_per_cpu_areas() works. Dropped
> is_boot_cpu and early irq_stack_ptr initialization.

And it adds more #ifdefs. All these conditional initializations on
CONFIG_SMP are really cluttering up the code. It also conflicts with
one of my goals with these patches: have as much state as possible
already prepared when a cpu boots. For the boot cpu this means static
initialization. For secondary cpus, that means setting up the values
in setup_per_cpu_areas(). This eliminates any window where the state
isn't ready yet, as you've already seen with per_cpu_offset.

And is_boot_cpu was a worthwhile optimization on its own. I had plans
on using it in more places later.

Brian Gerst
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at