Hyper-threading under Linux

Steve_L_Smith@Dell.com Steve_L_Smith at Dell.com
Thu Dec 19 02:50:00 CST 2002

There have been a couple of threads on this topic lately, so I thought I'd
add my perspective.

Hyper-threading is an attempt to maximise the usage of physical cpu
resources, based on the assumption that many applications are not CPU bound,
therefore they have spare resources available. By creating two virtual
processors for every physical processor, and using some trickery to save
architectural states for each process, you are often able to get better
performance from a set of applications with HT enabled. This is generally
true for applications such as databases where I/O is often the bottleneck;
while one process is waiting for data, another process can utilise the cpu
without the normal flushing required where hyperthreading is not enabled.
However, for CPU intensive applications (esp. scientific and technical
codes) this is not the case, the CPU is already heavily loaded and all
hyperthreading does is add overhead.

Some things to note:
1) with HT on, you share the cache of a single physical processor between
two virtual processors, so the likelihood is that your cache miss rate will

2) the Linux standard scheduler is not good at processor affinity, i.e.
locking a process to a given processor and being aware that two virtual
processors may actually be on one physical processor. Assume you have a dual
processor system with HT on, and you run two processes. Process 1 may be
assigned to virtual processor 1 which is on physical processor 1, and
process 2 may be assigned to virtual processor 2 which is also on physical
processor 1! Result - physical processor 2 is idle whereas physical
processor 1 is heavily overloaded! HT really does require strong processor
affinity to work well. There is a patch that provides a fully-HT aware
scheduler, from Ingo Molnar

3) Each virtual processor may consume a software licence for your
application! If you have a 2-cpu licence for an application and run it on a
system with 4 virtual processors, you might a) run out of licences, b) find
your two processes fighting for resource on 1 physical processor, c) get
half the performance you would get with HT off.

So no simple answer to whether it is good or not - depends on your apps and
workload mix.

There are some articles on HT in the latest issue of Power Solutions -


Steve Smith
HPC Business Manager
Dell Campus, Cain Road, Bracknell, RG12 1FA, UK
Direct: +44 1344 372037
Switchboard: +44 1344 812000
Fax: +44 1344 372359
Mobile: +44 7802 594874
email: steve_l_smith at dell.com

More information about the Linux-PowerEdge mailing list