RE: [patch v2 21/30] x86/cpu/topology: Use topology bitmaps for sizing

From: Michael Kelley
Date: Mon Feb 12 2024 - 14:49:26 EST


From: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Sent: Monday, February 12, 2024 8:41 AM
>
> On Fri, Jan 26 2024 at 21:22, Thomas Gleixner wrote:
> > On Fri, Jan 26 2024 at 07:07, Zhang, Rui wrote:
> >> Say, on my Adlerlake platform, which has 4 Pcores with HT + 8 Ecores,
> >> cnta is 12, cntb is 16, and smp_num_siblings is set to 1 erroneously.
> >>
> >> I think we should use
> >> smp_num_siblings = DIV_ROUND_UP(cntb, cnta);
> >> here.
> >
> > Indeed. That's more than obvious.
>
> I pushed out a new version which addresses this and also the fallout
> Michael and Sohil reported:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git topo-full-v3
>
> I let the robot chew on it before posting it in the next days.
>

I've tested the topo-full-v3 tag on a Hyper-V guest, and can confirm
that the Rejected CPU count is now correct when nr_cpus=1 is on the
kernel boot line. And as expected, these messages are now emitted
when a kdump kernel boots on other than CPU 0:

[ 0.339622] CPU topo: Boot CPU APIC ID not the first enumerated APIC ID: 2c > 0
[ 0.342993] CPU topo: Crash kernel detected. Disabling real BSP to prevent machine INIT

Earlier, I did a variety of tests on topo-full-v2, and didn't see any other
problems, but I did not repeat those tests on topo-full-v3. So overall,

Tested-by: Michael Kelley <mhklinux@xxxxxxxxxxx>

Tangentially and FWIW, you probably remember our discussion last
fall about Hyper-V, where in some circumstances the APIC IDs in the
guest ACPI tables don't match the APIC ID reported by the CPUID
instruction, resulting in Linux guest "APIC id mismatch" warnings. That
problem appears to be fixed now in the Azure public cloud, and your
full set of topo revisions no longer causes mangled scheduler domains
in those circumstances.

There may be nooks and crannies in the Azure fleet that haven't gotten
the update for whatever reason, but everything I tested is good. The
on-premises Hyper-V as part of the latest Windows 11 has *not* been
updated. I don't have access to a Windows Server instance to test, but
it's probably not updated either. Hopefully they will both be updated
in the coming months.

Michael