Jump to content

Hyper-threading

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Themcman1 (talk | contribs) at 20:48, 29 April 2010 (→‎History: irrelevant). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Intel's Hyper-Threading Technology scheme.

Hyper-threading (officially Hyper-Threading Technology, and abbreviated HT Technology, HTT or HT) is Intel's term for its simultaneous multithreading implementation in their Atom, Core i3, Core i5, Core i7, Itanium, Pentium 4 and Xeon CPUs.

Hyper-threading is an Intel-proprietary technology used to improve parallelization of computations (doing multiple tasks at once) performed on PC microprocessors. For each processor core that is physically present, the operating system addresses two virtual processors, and shares the workload between them when possible. Hyper-threading requires not only that the operating system support multiple processors, but also that it be specifically optimised for HTT, and Intel recommends disabling HTT when using operating systems that have not been so optimized.[1]

Details

Intel Pentium 4 processor that incorporates Hyper-Threading Technology[2]

Hyper-threading works by duplicating certain sections of the processor—those that store the architectural state—but not duplicating the main execution resources. This allows a hyper-threading processor to appear as two "logical" processors to the host operating system, allowing the operating system to schedule two threads or processes simultaneously. When execution resources would not be used by the current task in a processor without hyper-threading, and especially when the processor is stalled, a hyper-threading equipped processor can use those execution resources to execute another scheduled task. (The processor may stall due to a cache miss, branch misprediction, or data dependency.)

This technology is transparent to operating systems and programs. All that is required to take advantage of hyper-threading is symmetric multiprocessing (SMP) support in the operating system, as the logical processors appear as standard separate processors.

It is possible to optimize operating system behavior on multi-processor hyper-threading capable systems. For example, consider an SMP system with two physical processors that are both hyper-threaded (for a total of four logical processors). If the operating system's process scheduler is unaware of hyper-threading it will treat all four processors as being the same. If only two processes are eligible to run it might choose to schedule those processes on the two logical processors that happen to belong to one of the physical processors; that processor would become extremely busy while the other would be idle, leading to poorer performance than is possible with better scheduling. This problem can be avoided by improving the scheduler to treat logical processors differently from physical processors; in a sense, this is a limited form of the scheduler changes that are required for NUMA systems.

History

Hyper-Threading was first introduced in the Foster MP-based Xeon in 2002. It appeared on the 3.06 GHz Northwood-based Pentium 4 in the same year, and then appeared in every Pentium 4 HT, Pentium 4 Extreme Edition and Pentium Extreme Edition processor. Previous generations of Intel's processors based on the Core microarchitecture do not have Hyper-Threading, because the Core microarchitecture is a descendant of the P6 microarchitecture used in iterations of Pentium since the Pentium Pro through the Pentium III and the Celeron (Covington, Mendocino, Coppermine and Tualatin-based) and the Pentium II Xeon and Pentium III Xeon models.

Intel released the Nehalem (Core i7) in November 2008 in which hyper-threading makes a return. The first generation Nehalem contains 4 cores and effectively scales 8 threads. Since then, both 2- and 6-core models have been released, scaling 4 and 12 threads respectively.[3]

The Intel Atom is an in-order processor with hyper-threading, for low power mobile PCs and low-price desktop PCs.[4]

The Itanium 9300 launched with eight threads per processor (2 threads per core) through enhanced hyper-threading technology. Poulson, the next-generation Itanium, is scheduled to have additional hyper-threading enhancements.[5]

The Intel Xeon 5500 server chips also utilize two-way hyper-threading[6][7]

Performance

The advantages of hyper-threading are listed as: improved support for multi-threaded code, allowing multiple threads to run simultaneously, improved reaction and response time.

According to Intel the first implementation only used 5% more die area than the comparable non-hyperthreaded processor, but the performance was 15–30% better.

Intel claims up to a 30% performance improvement compared with an otherwise identical, non-simultaneous multithreading Pentium 4. Tomshardware.com states "In Some Cases a P4 running at 3.0 GHz with HT on can even beat a P4 running at 3.6 GHz without HT turned on".[8][9] Intel also claims significant performance improvements with a hyper-threading-enabled Pentium 4 processor in some artificial intelligence algorithms. The performance improvement seen is very application-dependent, however when running two programs that require full attention of the processor it can actually seem like one or both of the programs slows down slightly when Hyper Threading Technology is turned on. This is due to the replay system of the Pentium 4 tying up valuable execution resources, equalizing the processor resources between the two programs which adds a varying amount of execution time. (The Pentium 4 Prescott core gained a replay queue, which reduces execution time needed for the replay system. This is enough to completely overcome that performance hit.)

Drawback History

When the Intel Pentium 4 3.06 GHz HT was released it was difficult for some application programmers to decide whether it was best to use Hyper Threading technology or not for their specific applications[10], because some programmers at the time were still testing their programs on an Operating System that was not optimized for Hyper Threading technology at the time (e.g. Windows 2000) [11]. Furthermore most computers at the time had Single-threaded processors instead of Bi-threaded processors.

In 2006, hyper-threading was criticised for being energy-inefficient. For example, specialist low-power CPU design company ARM has stated SMT can use up to 46% more power than dual core designs. Dual core processors are different from Dual CPU. Furthermore, they claim SMT increases cache thrashing by 42%, whereas dual core results in a 37% decrease.[12]

Security

In May 2005 Colin Percival demonstrated that a malicious thread operating with limited privileges can monitor the execution of another thread through their influence on a shared data cache, allowing for the theft of cryptographic keys.[13] Note that while the attack described in the paper was demonstrated on an Intel Pentium 4 processor with HTT, the same techniques could theoretically apply to any system where caches are shared between two or more non-mutually-trusted execution threads; see also side channel attack.

See also

References

Security
Performance

Replay: Unknown Features of the NetBurst Core [2]