Re: [PATCH] x86: skip delays during SMP initialization similar to Xen

From: Ingo Molnar
Date: Thu May 14 2015 - 13:57:41 EST



* "Jan H. Schönherr" <jschoenh@xxxxxxxxx> wrote:

> Ingo, do you want an updated version of the original patch, which
> takes care not get stuck, when the INIT deassertion is skipped, or
> do you prefer to address delays "one by one" as you wrote elsewhere?

So I'm not against improving this code at all, but instead of this
hard to follow mixing of old and new code, I'd find the following
approach cleaner and more acceptable: create a 'modern' and a 'legacy'
SMP-bootup variant function, and do a clean separation based on the
CPU model cutoff condition used by Len's patches:

/* if modern processor, use no delay */
if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) ||
((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF)))
init_udelay = 0;

Then in the modern variant we can become even more aggressive and
remove these kinds of delays as well:

udelay(300);
udelay(200);

plus I'd suggest making these poll loops in smpboot.c loops narrower:

udelay(100);

udelay(100);

because every iteration is 0.1 msecs - if we hit these poll loops then
it adds up with a few dozen CPUs.

Thanks,

Ingo
--
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/