Your Linux Data Center Experts

Hyper-threading is a kind of neat technology where a single CPU acts, in some ways, like it is a pair of SMP CPUs. While you don't get the same raw increase in CPU cycles that you can with a true SMP setup, there are some benefits which I've rarely heard spoken about.

With a real SMP setup, if you are running two CPU-intensive processes, each one effectively gets the full performance of a single CPU. With Hyper-threading, in that same situation, each of the processes only gets 50% of the full performance of the (only) CPU. So, clearly in that case SMP is a huge win over hyper-threading.

However, there is a big win for Hyper-threading as well. Multi-tasking operating systems will, when given a CPU-intensive task and a non-intensive task, switch between those two tasks on the order of tens to hundreds of times. In other words, on a CPU-busy system there may be a scheduler latency of tens of milliseconds. While this may not sound like much, I if you have several processes working together, like X windows and an editor and a kernel, you can quickly get up to hundreds of milliseconds of scheduler latency. Van Jacobson says that humans tend to notice delays of 400ms or more.

This is why you may have noticed that your system was sluggish when running CPU-intensive low-priority jobs like the or Folding clients. Even though they're low priority, they will contribute to scheduler latency.

Hyper-threading, acts kind of like an extremely inexpensive context switch. Some tests I've run suggest that a hyper-threading CPU can switch between two CPU-intensive tasks tens of thousands of times per second. It's like having a system with a scheduler latency, between two processes, below a tenth of a millisecond.

That's a pretty big gain for a multi-tasking system.

comments powered by Disqus

Join our other satisfied clients. Contact us today.