Re: [PATCH v6 04/12] x86/smpboot.c: Don't offline CPU0 if any irq cannot be migrated out of it and remove CPU0 check in smp_callin()
From: Tony Luck
Date: Fri May 11 2012 - 14:42:22 EST
On Fri, May 11, 2012 at 5:05 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>> + if (cpuid == 0)
>> + identify_boot_cpu_online();
> No, this is not how we do things.
> If this is required, then hell we do it at boot time and not at a
> random place in the cpu hotplug code.
Open to better suggestions for placement. Sometimes we do need
special cases because on x86 the system isn't symmetrical, cpu0
really is treated differently by h/w and f/w and we have to live with this.
Biggest code impact of that is the extra code to bring cpu0 back online
using NMI instead of INIT. We can't use INIT because if cpu0 gets one,
it just resets the whole machine :-( But obviously we'd like to avoid
special cases where there is a sane way to do so.
> This is as fricking wrong as it gets. We already know that at boot
> time when we initialize the irq chips. There is no need to iterate
> over the whole irq descriptors just to figure that out.
We *knew* it at boot time ... but that information will be stale if
we hot plugged new devices and bound their interrupts to cpu0.
Do we need to maintain some parallel table of this information, or
is there a better way to check this?
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/