Hyper threading technology
Upcoming SlideShare
Loading in...5

Hyper threading technology



Hyper-threading or Hyper-Threading Technology(HTT), is actually Intel’s ...

Hyper-threading or Hyper-Threading Technology(HTT), is actually Intel’s
trademark for their multi-threading, but has become a common name for all
processors of this type. It is essentially a cut down version of dual version of dual
core. Execution units on a hyper-threaded CPU share certain elements, such as cache
and pipelines.



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds


Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Hyper threading technology Hyper threading technology Document Transcript

  • INTRODUCTION Hyper-threading or Hyper-Threading Technology(HTT), is actually Intel’s trademark for their multi-threading, but has become a common name for all processors of this type. It is essentially a cut down version of dual version of dual core. Execution units on a hyper-threaded CPU share certain elements, such as cache and pipelines. The operating system sees a single hyper-threaded processor as two separate logical CPUs. Threads can be scheduled to execute on any of these logical processors. The main strength of hyper-threading is that it allows for flexible scheduling of all available execution slots, which increases efficiency by keeping the execution core as busy as possible. All that is required to take advantage of this technology is symmetric multiprocessing support in the operating system .Hyper- threaded processors still share the same cache; it is possible for applications performance to actually degrade if both threads are contending for the CPU cache at the same time. Microprocessor designers mainly give emphasis to two main factors-SPEED and PARALLELISM in their quest towards efficiency. Notion of thread and process are used by computer programmers and hardware designers in varying contexts. Various operating systems and architecture give different definitions to them. A process is a program in execution which has a memory associated with it and a thread is an actual running component of a process, a process can be a multi- threaded. 1
  • Parallelism- initial microprocessors in the 80x86 series supported one instruction at a time. Also, the pre-dominant operating system during those days – MS DOS – supported only one process at a time. Pentium and Pentium –Pro series had increased number of execution cores. Their super-scalar architecture and pipelining resulted in a certain degree of parallelism. But no processor had the capability to execute two instructions from different threads simultaneously. Intel Hyper-Threading technology allows multithreaded operating systems to view a single physical processor as if it were two logical processors. A processor that in cooperates this technology shares CPU resources among multiple threads, thereby enabling faster enterprise-server response times and providing additional CPU processing power to handle larger workloads. As a result server performance can improve. The amazing growth of the internet and telecommunications is powered by ever-faster systems demanding increasingly higher levels of processor performance. To keep up with this demand we cannot rely entirely on traditional approaches to processor design. Microarchitecture techniques used to achieve past processor performance improvement –super-pipelining, branch prediction, super scalar execution, out-of order execution, caches-have made microprocessors increasingly more complex, have more transistor counts and power are increasing at rates greater than processor performance. Processor architects are therefore looking foe ways to improve performance at a greater rate than transistor counts and power dissipation. Hyper-Threading Technology is form of simultaneously multithreading technology(SMT) introduced by intel. Architecturally, a processor with Hyper- Threading Technology consist of two logical processors, each of which has its own processor architectural state. After power-up and initialization, each logical 2
  • processor can be individually halted, interrupted or directed to execute a specified thread, independently from the other logical processor on the chip. Unlike a traditional dual processor(DP) configuration that uses two separated physical processors, the logical processors in a processor with Hyper-Threading Technology share the execution resources of the processor core. These resources include the execution engine, the caches, the system-bus interface and the firmware Hyper-Threading Technology represents a new approach to improving the instruction throughput of processors that are targeted for servers, high performance workstations and desktops . It also provides a view into the future of microprocessor design where the performance of a processor when executing a specific type of application or the space and power requirements of a physical processor within a server may be as important as its raw processing speed. 3
  • Hyper-Threading Technology is feasible for platforms ranging from mobile processors to servers. Its introduction into market segments other than servers is gated only by the availability and prevalence of threaded applications and workloads in these markets. Although existing operating systems and application codes will run correctly on a processor with Hyper-Threading Technology, some relatively simple code practices are recommended to get the optimum benefit from Hyper-Threading Technology. Hyper-Threading Technology does not deliver multiprocessor scaling, Typically applications make use of about 35% of the internal processor execution resources. The ideas behind Hyper-Threading Technology is to enable better processor usage and to achieve about 50 percent utilization of resources. 4
  • ARCHITECTURE OF PROCESSOR WITH HYPER-THREADING TECHNOLOGY A Processor with Hyper-Threading Technology may provide a performance gain of 30 percent when executing multi-threaded operating system and application code over that of a comparable Intel architecture processor without Hyper-Threading Technology. When placed in a multiprocessor based system, the increase in computing power generally scales linearly as the number of physical processors in a system is increased; although as in any multiprocessor system, the scalability of performance is highly dependent on the nature of the application. Two logical processors do not provide the same level of performance as a dual processor-based system. Each logical processor has:-  Its own architecture state.  Executes its own code stream concurrently.  Can be interred and halted independently. Two logical processors share the same • Execution engine and catches, and Firmware and system bus interfaces. 5
  • Why Hyper threading??? Even with the optimised pipelining architecture and increased number of execution units available with modern microprocessors like Pentium and athlon,only one-third of the resources’ were being used at a time. This is because of the inability of the processor to execute more than one thread at a time. Even after applying the intricacies of out of order Execution and advanced branch prediction logic, instruction from a single thread are far below the maximum utilisation potential of a processor resulting in wastage of resources. Single Threaded CPU 6
  • In this figure-The processor has seven execution paths in the execution core. Red colour indicates executing threads and white spaces are blank slots. Processor uses just one-third of its available potential. Superthreading An alternative mechanism called Super threading, implemented in some microprocessors provided some capability to execute multiple threads at a time. But it also had its limitations. All instructions in one pipeline stage of a superthreaded processor have to be from the same thread. Superthreading involved limited amount of context switching too. This technology also didn’t eliminate the wastage of resources completely. Super threaded CPU The Red and Yellow colours indicate executing threads. Each of the six pipeline stages has one thread. 7
  • Multiprocessor systems Using more than one processor in a system directly provided thread level parallelism. But this was a costly solution and required special on board support for multiple processors. These systems also required some type of synchronising mechanism so that both processors function in unison. The overhead for this synchronization and the frequent collision for the need of resources slowed down such implementation considerably. Due to these reasons, multiprocessor systems remain confined to special purpose implementations and dedicated systems. Hyperthreading, introduced by Intel provided the solution for this problem. 8
  • What is Hyper Threading ??? Hyperthreding is super threading without the restriction that each pipeline stage or clock cycle must contain instructions from the same thread. Vacant execution slots in each pipeline stage is filled by instructions from another thread ,enabling thread level parallelism. This can be done as long as there is no collision of resources required by two threads. Inside the processor Since more than one thread is being run at the same time, certain architectural features are replicated, some are shared and some are partitioned. The replicated resources are instructions pointer ,return stack pointer etc...Caches and execution units are shared. Partitioned resources include scheduling queues, load-store and reorder buffers. Another subtle feature is that when only one thread is executing, all shared and partitioned resources are combined to give maximum throughput. These additional resources in a hyper threaded Pentium 4 or Xenon processors increased the processor die area by just five percent. Hyperthreading’s strength is that it allows the scheduling logic maximum flexibility to fill the execution slots, thereby making more efficient use of available execution resources by keeping the execution core busier. 9
  • From Operating System’s View When viewed from OS or user level, the hyper threaded processor is split up into two or more logical processors and threads can be scheduled to execute on any of the two logical processors and threads can be scheduled to execute on any of the two logical processors as they are free. Operating system schedules the threads approximately into the available logical processors. Scheduling is done in such a way that two running threads won’t request for a resources simultaneously as far as possible. It is a must that operating system support hyper threading. Presently the number of logical processors supported by most operating systems and underlying hardware is two. Latest operating systems like Windows XP and Red Hat Linux 9 support hyper threading. 10
  • Multithreading and Message-passing Applications In general, processors enabled with Hyper-Threading technology can improve the performance of applications with high degree of parallelism. Previous studies have shown that the Hyper-Threading technology improves multi-threaded applications’ performance by the range of 10 to 30 percentages depending on the characteristics of the applications. These studies also suggest that the potential gain is only obtained if the application is multi-threaded by any means of parallelization techniques. A multithreading program is capable of creating multiple processes, or threads, at a time without having to have multiple copies of the program running in the computer. With the addition of Hyper-Threading support in Linux kernels 2.4.9-31 and above, Linux cluster practitioners have started to assess its performance impact on their applications. In our area of interest, high performance computing (HPC) clusters, applications are commonly implemented by using standard message-passing Perfomance Hyperthreading technology improves overall performance in two ways, First in speeds up applications that are already multithreaded. In this case, each logical processor will run software threads from the application. Second, It speeds up a workload consisiting of multiple applications by multitasking.In this case, each logical processor will likely run threads from different applications. With a resource sharing policy matched to the traffic and performance requirements of each recource, hyperthreading technology can increase resource utilisation and improve performance. Intel is committed to this new and challenging microarchitecture direction. 11
  • HYPER-THREADING TECHNOLOGY ARCHITECTURE Hyper-threading technology makes a single physical processor appear as multiple logical processors. To do this, there is one copy of the architecture state for each logical processor, and the logical processors share a single set of physical execution resources. From a software or architecture perspective, this means operating systems and the user programs can schedule processes or threads to logical processors as they would on conventional physical processors as they would on conventional physical processors in a multiprocessor system .From a micro architecture perspective, this means that instructions from logical processors will persist and execute simultaneously on shared execution resources. Processor with Hyper technology 12
  • Multiprocessor system with two physical processors that are not Hyper- Threading capable, but multiprocessor system with two physical processors that are Hyper-Threading Technology-capable. With two copies of the architectural state on each physical processor ,the system appears to have four logical processors. 13
  • The hyperthreading technology implementation on the Netburst microarchitecture has two logical processors on each physical processor. Each logical processor maintains a complete sat of the architectural state. The architectural state consists of registers, including general purpose registers, and those for control, the advanced programmable interrupt controller (APIC), and some for machine state. From a software perspective ,duplication of the architectural state makes each physical processor has its own interrupt controller, or APIC, which handles just the interrupts sent to its specific logical processor. Hyperthreading Technology is fully compatible with existing software and hardware. 14
  • DIFFERENCE BETWEEN HYPERTHREADING AND MULTITHREADING Hyper-Threading Technology uses the process- and thread-level parallelism found in contemporary operating systems and high-performance applications by implementing two logical processors on a single chip. This configuration allows a thread to be executed on each logical processor. Instructions from both threads are simultaneously dispatched for execution by the processor core. The processor core executes these two threads concurrently, using out-of-order instruction scheduling to keep as many of its execution units as possible busy during each clock cycle. 15
  • IMPLEMENTATION Of HYPER THREADING TECHNOLOGY The first implementation of Hyper-Threading Technology is being made available on intel Xenon processor family for dual and multiprocessor servers, with two logical processors per physical processor. By more efficiently using exiting processor resources resources, the intel Xenon processor family can significantly improve performance at virtually the same system cost. This implementation of Hyper-Threading Technology added lees than 5% to the relative chip size and maximum power requirements, but can provide performance benefits much greater than that. Each logical processor maintains a complete set of the architecture state. The architecture state consists of registers including the general-purpose registers, the control registers, the advanced programmable interrupt controller (APIC) registers, and some machine state registers. From a software perspective, once the architecture state is duplicated, the processor appears to be two processors .The number of transistors to store the architecture state is an extremely small fraction of the total Logical processor share nearly all other resources on the physical processor, such as caches, execution units, branch predictors, control logic and buses. Each logical processor has its own interrupt controller or APIC .Interrupts sent to a specific logical processor are handled only by that logical processor. 16
  • SOFTWARE ON A HYPERTHREADED PROCESSOR To get full advantage out of hyper threaded processor, an application must not only be multithreaded, but the individual threads must be coded in such a way that they should not raise the request for one resource simultaneously. For example, if two threads of an application request disk access at the same time, hyperthreading won’t be of much help Of course no sensible programmer will write a code having such conflicts. But to write optimised code on a hyper threaded processor, programmer must have a clear knowledge about the shared resources and possible conflicts. Logical view of Hyper-Threading. 17
  • Threads from different processes It is not possible to write optimised hyperthreaded code considering the other applications that will be running on the system. Programmer of one application will be oblivious to the internals and resources requirements of another application. And in normal case,it will be difficult to anticipate the applications running in tandem. For example, coder of a text editor will not be aware of the antivirus tool or messenger system running on a computer. So in the of threads from different processors, it is possible only to hope for the best. But some improvements are likely in this scenario. This is because the processor is unaware of the process-thread relation. It is does not take care or does not know, which thread is from which process. It tries to execute the threads presented to it as fast as possible, inducing into the hyper threading mechanism. Programmer’s Challenge Full benefits of hyper threading will be available only when some general purpose code library supporting hyper threading becomes available. Also there will be some security issues with this new methodology. This hyper threaded programming style is yet to be popular. And it is written in the assembly level. If some high level language or paradigm supports this new style, coding will be easier and benefits will come along. 18
  • Operating system and applications. A system with processors that use Hyper-Threading Technology appears to the Operating System and applicaton software as having twice the number of processors than it physically has operating systems manage logical processors as they do physical processors, scheduling runnable tasks or threads to logical processors. However, for best performance,the operating system should implement two optimizations. The first is to use the HALT instruction if one logical processor is active and the other is not. HALT will allow the processor to transition to either the STO- or ST1-mode. An operating system that does not use this optimization would execute on the idle logical processor a sequence of instruction that repeatedly checks for work to do. This so-called “idle loop” can consume significant execution resources that could otherwise be used to make faster progress on the other active logical processor. The second optimization is in scheduling software threads to logical processors. In general, for best performance, the operating system should schedule threads to logical processors on different physical processors before scheduling multiple threads to the same physical processor. This optimization allows software threads to use different physical execution resources when possible. 19
  • Exploring the impact of Hyper-Threading on Web Workloads Intel Hyper-Threading technology allows multithreaded operating systems to view a single physical processor as if it were two logical processors. A processor that incorporates this technology shares CPU resources among multi threads,thereby enabling faster enterprise-server response times and providing additional CPU processing power to handle larger workloads. As a result,server performance can improve. If using Hyper-Threading technology ,a dell PowerEdge 6600 server with four CPUs would expose eight logical CPUs to operating system. Hyperthreading must be enabled in the BIOS for the operating system to recognize the logical processors. Microsoft Windows 2000 Server and Windows .Net server operating systems support Hyper-Threading with no modifications. Recent versions of the Red Hat Linux Operating System,including versions 7.3 and Advanced Server 2.1,also auto- detect and enable Hyper-Threading Support. For Red Hat Linux 7.1 and 7.2,administrators should first upgrade the kernel to the latest errata package. They can then enable Hyper- Threading by passing the acpismp=force flag through the boot loader to determine whether Hyper-Threading is enable under Linux,check/proc/cpuinfo; it should show twice the number of physical CPUs in the server. 20
  • Conclusion Intel’s Hyper –Threading Technology brings the concept of simultaneous multi-threading to the Intel Architecture. This is a significant new technology direction for Intel’s Future processors. It will become increasingly important going forward as it adds a new techniques for obtaining additional performance for lower transistor and power costs. This promising technology has the potential to influence the computing world in a big way. But for that, software support is essential. Also, owing to the pitfalls of this technology, it is quite possible that another innovation providing enhanced parallelism come along and displace this altogether. The potential for Hyper-Threading Technology is tremendous; our current implementation has only just begun to tap into this potential. Hyper-Threading Technology is expected to be viable from mobile processors to servers ;its introduction into market segments other than servers is only gated by the availability and prevalence of threaded applications and workloads in those market. 21
  • References [1] Tau Leng, Ph.D. , “Intel Hyperthreading technology to Achieve Computational Efficiency ”, November 2003. [2] Onur Celebioglu , “Intel Hyperthreading technology to Achieve Computational Efficiency” , November 2003. [3] Rizwan Ali, “Intel Hyperthreading technology to Achieve Computational Efficiency ”, November 2003. [4] Jenwei Hsieh, Ph.D. , “Intel Hyperthreading technology to Achieve Computational Efficiency” , November 2003. [5] Tau Leng, Rizwan Ali, Jenwei Hsieh, Victor Mashayekhi, Reza Rooholamini , “ An Empirical Study of Hyper-Threading in High Performance Computing Clusters ”, Dell Computer Corp, May 2012. [6] Decipher Information Systems ,”Hyper-threaded and Dual-Core CPU Technology ”,June 2006 . [7] Intel, “Intel® Hyper-Threading Technology ”,May 2012. [8] Intel, “Intel Hyper-Threading Technology -Technical User’s Guide ”, Januvary 2003. [9] Deborah T. Marr, Desktop Products Group, Intel Corp, “Hyper-Threading Technology Architecture and Microarchitecture ” Januvary 2002. [10] Lin Chao, “Intel Technology Journal ”,February 2002 . [11] Introduction to Hyperthreading-Jon “Hannibal” stokes. [12] Intel Corp., Ultrabook,SmartPhone,Laptop,Desktop,Server and Embedded, Available URL: “http://developer.intel.com” 22