How can I disable hyperthreads, but NOT smp ?

RW rwmaillists at googlemail.com
Wed Sep 21 00:00:28 UTC 2011


On Tue, 20 Sep 2011 22:28:18 +0100
Richard Collyer wrote:

> On 20/09/2011 21:34, Jason Usher wrote:
> > FreeBSD 6.4-RELEASE system with two physical CPUs, each of which
> > are HT capable.  From dmesg:
> >
> > cpu0 (BSP): APIC ID: 0
> > cpu1 (AP): APIC ID: 1
> > cpu2 (AP): APIC ID: 6
> > cpu3 (AP): APIC ID: 7
> >
> > I also see this:
> >
> > machdep.hyperthreading_allowed: 0

> > How can I disable HT completely, but still retain ALL the benefits
> > of SMP ?
> >
> > Thanks.
> 
> It's usually a setting in the BIOS to disable Hyperthreading then 
> reconfigure the kernel to only use 2 cores (which it might do 
> automatically).
> 
> Hyperthreading is outside the world of FreeBSD. As far as it knows
> there is still 4 "logical processors".

It's not completely outside; an OS should still be able to determine
which logical CPUs are on the same core. And, presumably
machdep.hyperthreading_allowed=0 tells  the scheduler not to use the
additional logical CPUs. I'm wondering if hyperthreading is unused, but
the full set of logical CPU is still displayed, or perhaps 6.4 is
failing to recognise the hardware.




More information about the freebsd-questions mailing list