How is hyperthreading handled on amd64?

Bill Moran wmoran at
Mon Mar 13 14:43:58 UTC 2006

On Mon, 13 Mar 2006 14:37:49 +0000
Pete French <petefrench at> wrote:

> > After building a kernel with SMP, I do see 2 logical processors,
> > and top(1) shows both of them doing their thing.  However,
> > machdep.hypterthreading_allowed is set to 0.  Is the amd64 kernel
> > ignoring this value, or is top(1) reporting incorrectly?
> It seems to be a bug - if you have an SMP kernel you cant turn off
> hyperthreading, no matter which knobs you twiddle. Not amd64 specific
> either. Even with all the hyperthreading variables off and with the
> masks showing that processes should not be scheduled on the second CPU's
> I still see stuff on 0, 1, 2 and 3.

I don't see this behaviour on i386 - my desktop, for example uses only
CPU 0 if the sysctl is 0, and switches between 0 and 1 when the sysctl
is 1.

Also doesn't explain the lack of any performance improvement with ht
enabled.  I'm aware of the argument that HT is really multiprocessers,
thus the performance increase isn't all one would expect.  However,
in i386 systems, enabling HT results in a _noticeable_ performance
improvement under most loads.

Bill Moran
Collaborative Fusion Inc.

More information about the freebsd-amd64 mailing list