United States-English

Mostly Color

Are hyperthreads good for you?

Published 21 February 2007, 04:29 PM

Although new architectures always sound good and are hailed for a number of advancements, computers are only as good as the people who program them. Computer science really peaked in the 60s and 70s, but unfortunately most of that knowledge has disappeared, in large part because the most experienced computer scientists were pushed into early retirement plans before they could pass on their knowledge.

In the case of hyperthreading this corporate behavior had two consequences. The first is that many operating systems see the threads as CPUs, which they are not because only critical resources like registers are duplicated. This error leads the scheduling algorithms in the OS to miscompute the available capacity and leads to “missing MIPS.”

The second consequence is that the art of concurrent programming has been mostly lost. Although for example the Cedar system had beautifully implemented threads, it had been very difficult to achieve (it cost Dough Wyatt a lot of sweat and tears until the last deadlock in the threaded viewer system was squelched). Today only few programmers know how to work with threads, and then often get it wrong.

Because the software I use cannot reliably exploit hyperthreading, I have turned it off. Maybe this is also why Intel’s latest processors are not hyperthreaded.

For more details, read the following paper: Neil J. Gunther, The virtualization spectrum from hyperthreads to grids, Proceedings of the Computer Measurement Group (CMG) 32nd International Conference, Reno (NV), December 3-8, 2006.

PS: Here are the hyperlinks to the two articles mentined in comment number 3 by reader RocketRoo:

Technorati tags: ,
Social bookmarking: DiggDigg del.icio.usdel.icio.us NowPublicNowPublic redditreddit NewsvineNewsvine GoogleGoogle

Posted By GiordanoBeretta | 3 Comments | Trackbacks | Permalink
Filed under:


Comments

Hyperthreading (HTT or MT in Intel parlance) is primarily a way to exhaust the execution unit by soaking up any remaining idle cycles. For a processor like the Xeon, there are 2 ports (or AS registers in Intel parlance) available to the same execution unit. When HTT is disabled, only one AS register is accessible to the OS run-queue, so scheduling works the same way as it does for a single CPU with time-slicing. When HTT is ENabled, the OS has to know how to schedule work onto both AS registers. These now act like 1-deep thread buffers. Provided different applications are appropriately threaded (and that's a big assumption and may not work---as GB discovered), one app's threads can be scheduled onto to one of the AS buffers (say AS0), while another app's threads can be scheduled onto the other AS buffer (say AS1). When a thread stalls on A0, the exec unit would normally become idle, but with HTT on, the exec unit can service the AS1 buffer until the AS0 becomes ready again. Actually, Intel does not tell us what the exact scheduling discipline is inside the Xeon. This is all well and good if you're on AS0, but not so wonderfull if you're on AS1 because you spend a lot of time waiting for A0 to stall. Moreover, from the standpoint of capacity analysis for SERVERS using Xeon parts, the OS is fooled into thinking the 2 ports AS0 and AS1 represent 2 *virtual* CPUS or VPUs which potentially offer twice the CPU capacity of a non-HTT CPU, i.e., 200%. In reality, this 200% capacity cannot be realized because the physical exec unit is generally more than 50% busy. Best case controlled measurements show that the exec unit only has about 25% idle cycles (1/4) available for register AS1, and therefore one never sees more than 150% (virtual) capacity consumed. This has led sys admins and capacity planners on a wild goose chase looking for the remaining 50% virtual cycles (1/4) that are not really there. A similar effect is also seen in Meso-VMs such as VMWare and Xen. This is also described in more detail in Gunther's paper.
# Wednesday, February 21, 2007 11:10 PM by redrooz_at_yahoo_com
Dear RocketRoo, thank you for your clarification. Although I drew the correct conclusion from Gunther's paper, I did not fully grasp the details. For us in Labs this means that when we transfer color technology into products we have to make sure we make full use of concurrency and the engineers can fully understand it. Fortunately there are still a few gray-haired people here and we stand a good chance to beat the competition.
# Thursday, February 22, 2007 04:18 PM by Giordano Beretta
Welcome. Here are some more links on virtualization that may be of interest to you and your group. http://www.kernelthread.com/publications/virtualization/ gives an introductory overview to VMs and Herb Sutter's Dr. Dobbs article http://www.gotw.ca/publications/concurrency-ddj.htm explaining how we fell off the Moore's law curve and why new tools for *concurrent programming* are required for multicores. This point of view got the attention of Bill Gates.
# Thursday, February 22, 2007 05:17 PM by redrooz_at_yahoo_com

Leave a Comment

(required)  
(optional)
(required)  


Type the digits above:
Information disclosed in this community becomes public. Exercise caution when deciding to disclose your personal information. HP reserves the right, but is not obligated to, edit or remove your comment if it contains personally identifiable information or other content HP deems unacceptable.  Opinions expressed are your personal opinions or those of the original authors, and not of HP. Please see HP's web Terms of Use for more details.