Re: [PATCH] x86, Clean up smp_num_siblings calculation

Prarit Bhargava
2014-06-04T13:12:53Z

<snip code>

> I wonder if this code is in need of an update? I recall reading
> this thread:
>
> http://forum.osdev.org/viewtopic.php?f=1&t=23445
>
> which suggests that we try CPUID with 0xb, and then 0x4 _before_
> relying on the EBX[23:16] of the older CPUID 0x1.
>
> AFAICT, the 0xb and 0x4 didn't exist when AP-485 was written ~2002.
>
> http://datasheets.chipdb.org/Intel/x86/CPUID/24161821.pdf

FWIW, I agree -- this whole chunk can be rewritten and I'll do that in [v3].

>
> Also, there was a discussion of masking the "ht" flag in /proc/cpuinfo
> for when it is "off" -- since the common sense interpretation of it
> doesn't match the implementation in the specification:
>
> http://codemonkey.org.uk/2009/11/10/common-hyperthreading-misconception/
> https://lkml.org/lkml/2009/11/13/33
>
> ...but I don't think that ever happened, even though Ingo thought it
> would probably be OK if there was no obvious fallout.

I have spoken to a few people about this to see if we anticipate any fallout
from this. The only concern that anyone raised is that some admin might get
confused by the lack of the ht flag in /proc/cpuinfo. I think that's bogus
because it would have been the admin that disabled HT in the first place. So
AFAICT it should be safe to do. I'm going to put together a 2/2 of patch only
for the removal of ht if (smp_num_siblings == 1) and we'll see if the
maintainers like it or not.

P.