Hyperthreading problems.

Dave Hart davehart at gmail.com
Sun Nov 7 13:27:31 PST 2004


> :FWIW, it was same in freebsd 4-STABLE around .8 or .9 sub-version.
> :
> :Yury
> 
>    Yah.  Someone will have to do a bit of research to see where it was
>    fixed.  I seem to recall that the hyperthread support is flagged by
>    the BIOS but not actually disabled, so it is probably a matter of
>    recognizing the flag and not starting up those APs.
> 
>                                        -Matt
>                                        Matthew Dillon

I read a Microsoft paper discussing Intel hyperthreading support in
recent NT releases, which discussed both the technical issues as well
as the CPU licensing issues.  One of the bits of advice to OEMs from
Microsoft is to make sure their BIOS orders the list of logical CPUs
given to the OS in some sort of MP table (probably ACPI), and elide
from that list disabled virtual CPUs.

The ordering requirement has to do with enabling users of older OSes
(say Windows 2000) with minimal or no hyperthreading support, and more
importantly here, which consume one licensed CPU per virtual CPU, to
get the most out of their physical processors and to be able to
disable hyperthreading.  The recommended MP table CPU list order is
then all of the first logical processors on all physical processors,
then all the second logical processors on all physical processors, if
hyperthreading is enabled in the BIOS.

The result is that Windows 2000 licensed for 4 processors running on a
system with 4 hyperthreading-aware processors will use only the first
logical processor on each physical processor regardless of
hyperthreading being enabled in the BIOS.  Or alternatively, a Windows
2000 licensed for 4 processors running on a system with 3
hyperthreading-enabled processors will use two logical processors on
one physical, and only the first logical processor on each of the
remaining two physical processors.  This is all driven by Windows
using the (logical) processors in the order specified by the BIOS,
which I beleive would omit secondary logical processors if
hyperthreading is disabled in the BIOS options.

One possible explanation is that DragonFly (and recent FreeBSD
apparently) are not using the MP table Microsoft is discussing with
BIOS authors to enumerate CPUs to start.  I am not an expert on ACPI
or its legacy alternatives, so I'm just throwing out an idea here.

I dug around a bit and can't find the paper on microsoft.com, but I
bet it's still there somewhere.

Dave Hart





More information about the Bugs mailing list