Status of hyperthreading in FreeBSD

Ivan Voras ivoras at
Mon Dec 22 20:25:41 UTC 2008

Sam Fourman Jr. wrote:
>> as far as i know, just enabling smp will allow ht to function. also, i don't
>> know if intel changed ht in the new atom processor, they could have.
> is FreeBSD's smp special in some way that it would be the exception to
> the following statement.
> I know there was a lot of changes made in the new ULE2 scheduler maybe
> that is why?
> /*
> Hyper-threading relies on support in the operating system as well as
> the CPU. Conventional multiprocessor support is not enough to take
> advantage of hyper-threading.[1] For example, even though Windows 2000
> supports multiple CPUs, Intel does not recommend that hyper-threading
> be enabled under that operating system.
> */
> I found this in wikipedia at the following link

Yes, system respond variously to hyperthreading but it's mostly in two

a) Granularity of locking - systems with "big locks" like FreeBSD's
Giant was when HTT was new don't scale well in multi-CPU configurations
("logical" CPUs) and simply using HTT can expose and increase these
inefficiencies. Modern FreeBSD locking is "good enough" for 8 cores in
7.x and it's improving in 8.x.

b) Behaviour in multi-core (or multi-CPU) case when individual CPUs or
cores support HTT. This is a scheduler issue - if the scheduler isn't
aware that some logical CPU's are "fake" and some are not (i.e. if it
treats all of them equally) it could move processes or threads from one
CPU or CPU core to another when it would be much better to move it from
one "fake" (hyperthreaded) CPU to another within the same "real" CPU.

There are more similar issues here, but none of them (including those I
described) are applicable to Atom since a) locking in FreeBSD is good
enough for it in recent releases (even in 6.x) and b) there are only two
"fake" logical CPUs and they really can be treated equally.

Now, with Nehalem design (i7) the system can have a quad-core CPU
(actually, several of those) with each core supporting hyperthreading. A
system with 16 logical CPUs (2 x quadcore x HTT) isn't really strange
any more. The scheduler knows about HTT, so the issues under "a)" are
much more noticable.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-questions mailing list