Re: [PATCH] x86/smpboot: Fix __max_logical_packages estimate

From: Prarit Bhargava
Date: Thu Sep 07 2017 - 17:18:31 EST




On 09/06/2017 02:36 PM, Prarit Bhargava wrote:
> A system booted with a small number of cores enabled per package
> panics because the estimate of __max_logical_packages is too low.
> This occurs when the total number of active cores across all packages
> is less than the maximum core count for a single package.
>
> ie) On a 4 package system with 20 cores/package where only 4 cores
> are enabled on each package, the value of __max_logical_packages is
> calculated as DIV_ROUND_UP(16 / 20) = 1 and not 4.
>
> Improve the estimate of __max_logical_packages by comparing the current
> estimate to the number of SMBIOS type 4 Processor Information structures.
> If __max_logical_packages is still insufficient during boot use the largest
> possible value of Package ID.

If I move this calculation to native_smp_cpus_done() I can eliminate a chunk
of code and use boot_cpu_data.booted_cores to get a correct value.

I'll resubmit with a new patch.

P.