Quality of service scheduling for simultaneous multi-threaded processors
A method and system for providing quality of service guarantees for simultaneous multithreaded processors are disclosed. Hardware and operating system communicate with one another providing information relating to thread attributes for threads executing on processing elements. The operating system controls scheduling of the threads based at least partly on the information communicated and provides quality of service guarantees.
Latest IBM Patents:
This invention was made with Government support under Contract No.: NBCH020056 (DARPA) awarded by Defense, Advanced Research Projects Agency. The Government has certain rights in this invention.
FIELD OF THE INVENTIONThe present disclosure generally relates to computer processing and particularly to multithreaded processing.
BACKGROUND OF THE INVENTIONAs the number of available transistors has increased, processor-chip architects have turned to multithreaded processors such as simultaneous multithreaded (SMT) processors as a way to continue to increase performance. Generally, SMT processors permit multiple threads to execute instructions using the same set of functional units within a given core. However, this means that the different hardware threads then compete for use of those functional units. One class of shared resources includes the execution units or functional units such as the integer units, floating-point units, load-store units, and the like. It is predicted that SMT processor will become a commonplace platform for the next generation of processor chips. However, because of its capability to allow sharing of processor resources, SMT technique in processors introduces a new degree of complexity in scheduling.
Real-time concerns have long been researched and implemented in operating systems. However, with the advent of multimedia applications such as mpeg players, Quality of Service (QOS) concerns have been addressed more seriously by a much wider range of operating systems. Now, most operating systems provide some notion of QOS to the applications.
However, when it comes to multithreaded processing, the current operating systems' quality of service schedulers cannot adequately handle threads executing on an SMT processor. This is because the threads interfere with each other, for example, by more than one thread trying to use greater than ½ of the available floating point units, or by colliding in their use of the L1 cache. Because this happens dynamically, it is difficult to predict the performance degradation the interference causes, and thus precludes the ability to make quality of service guarantees. In addition, conventional SMT processor hardware does not provide the operating system with a capability to understand the crucial attributes of a thread on the SMT processor.
Without significantly under utilizing an SMT processor, the operating system cannot provide QOS guarantees. Without knowledge of the characteristics of the threads running on an SMT processor, an operating system would not be able to provide QOS guarantees if it schedules more than one thread on a given SMT core. There is no mechanism currently available for providing information about the functional unit utilization per thread. What is needed is a method and system for the hardware and the operating system on multithreaded processors such as SMT processors to communicate information about the threads on the processors, so that for example, an operating system may provide QOS guarantees.
BRIEF SUMMARY OF THE INVENTIONA method and system for providing quality of service scheduling in multithreaded processing are disclosed. The method in one aspect includes identifying one or more hardware resources utilized by a thread in simultaneous multithreaded processing, and communicating the identified one or more hardware resource used by the thread. The resource usage may be recorded for an individual thread or a set of threads. Thus, in another aspect, the step of identifying may include identifying one or more hardware resources utilized by a set of threads in simultaneous multithreaded processing. In one aspect, hardware identifies the thread's use of resources.
The step of communicating may include storing information pertaining to the identified one or more hardware resource utilization. Hardware, for instance, may store the information in a register accessible by an operating system. The one or more hardware resources for example may include but are not limited to one or more processing elements, functional units, or cache memory, or combination thereof. Examples of processing elements and functional units may include but are not limited to a floating point unit, an integer unit, an arithmetic logic unit, a shifter, a register, a load-store unit, or combination thereof. Examples of cache memory may include but are not limited to cache line and cache sub-levels.
The method in another aspect may include scheduling one or more threads based on information associated with the identified one or more hardware resource utilization. In one aspect, the software or operating system performs the scheduling. The method in yet another aspect may include reserving one or more hardware resources for a thread based on information associated with the identified one or more hardware resource utilization. The step of reserving may be performed by the software or operating system. In one aspect, the step of reserving may include storing one or more data bits in a register accessible by hardware, the data bits identifying which one or more hardware resources to reserve for a thread. In another aspect, the method may further include analyzing information associated with the identified one or more hardware resource utilization by a thread. Still yet in another aspect, the method may include restricting one or more hardware resources from a thread based on information associated with the identified one or more hardware resource utilization.
A system for providing quality of service scheduling in multithreaded processing in one aspect may include a hardware controller on a processor operable to track a thread's use of one or more hardware resources in simultaneous multithreaded processing. The hardware controller may be further operable to communicate information associated with the use of one or more hardware resources per thread. Software or an operating system is operable to access the information and schedule one or more threads based on the information. In one aspect, the communication between the software and the hardware about information associated with one or more threads may be performed using software thread identifier to hardware thread identifier mapping.
Further features as well as the structure and operation of various embodiments are described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers indicate identical or functionally similar elements.
In an exemplary embodiment of the present disclosure, the hardware provides information as to which hardware threads executing on a core are using or have used which processing elements or functional units or the like on the core. The hardware may also provide information pertaining to memory utilization of a hardware thread, for instance, the hardware thread's use of L1 cache on the core. Additional characteristics or attributes of the hardware threads may be provided. The operating system uses this information to predict resource availability for scheduled applications, to reserve a particular processing element for a given thread, and to otherwise guarantee quality of service to applications. In another embodiment, the information may be provided for a given set of hardware threads, and the operating system or the like may use the information to predict resource availability and reserve processing elements for a given set of hardware threads.
In one embodiment, the mapping between the threads that the operating system schedules and the hardware threads that the hardware receives and executes, is kept, for example, in a series of registers associated with the hardware threads.
Referring to
In an exemplary embodiment, the operating system or the like uses the logged information to determine and predict resource availability for a given thread, control to an extent what resources can be allocated to what threads, and otherwise provide reasonable quality of service guarantees to applications or the like.
At 406, based on the analysis, the operating system communicates to the hardware to reserve certain resources for a given thread, to restrict other resources for another thread, etc. For instance, the logged information may provide that this particular type of application requires certain functional units and processing elements to execute. In turn, the operating system may decide that it needs to reserve those functional units and processing elements for one or more threads associated with that particular application in order to meet the guaranteed quality of service. The operating system in one embodiment may communicate such reservation requests for functional units, processing elements or caches to the hardware, for example, by using another register. The operating system, for example, may fill in a table such as the one shown in
In one embodiment, the register at 612 may store information regarding various characterization or attributes of a thread. For instance, it stores the usage information such as whether a hardware thread used one or more of the processing elements, the amount of usage of various resources on the core, the amount of cache usage, etc. The operating system in one embodiment accesses the information, performs analysis based on the information and makes scheduling decisions that would fulfill quality of service guarantees. The register at 614 may store information pertaining to requests from the operating system as to how the processing elements or other resources on the core should be allocated to the running threads. For instance, the operating system may request to reserve one or more functional units for a given thread. Similarly, the operating system may request to restrict one or more functional units for a given thread. Still yet, the operating system may request that a number of cache bytes or partitions be reserved for a given thread. The operating system may request such reservations or restrictions based on the analysis and scheduling decisions that is has made from using the information stored in the utilization register 612.
The operating system may reserve a particular processing element for a given thread or given set of threads, may reserve functional units for a given thread or given set of threads, and may reserve cache lines and sub-levels for data. Similarly, the operating system may restrict a given thread from using a particular processing element, functional unit, or cache sub-level. By reserving the needed resources or otherwise controlling the use of the resources on a given core, the operating system is able to meet the quality of service requirements.
In addition, by using the logged information characterizing a given thread's attributes and resource usage, the operating system is able to make decisions as to which threads should or should not be scheduled together or near each other. For example, the operating system may determine how much each thread makes uses of the different processing elements on the core, evaluate the threads the operating system has to schedule, decide whether scheduling certain threads together would meet the promised quality of service, and schedule the threads accordingly.
In an exemplary embodiment of the present disclosure the characterization and usage information about different threads executing on a given core are obtained and gathered during the real time processing of the hardware threads. In another embodiment, the execution environment may be modeled and simulated to obtain the information. Similarly, the operating system's reserving and restricting may be also modeled and simulated, and the performance results from such simulation may be used, for example, for benchmarking.
The embodiments described above are illustrative examples and it should not be construed that the present invention is limited to these particular embodiments. Thus, various changes and modifications may be effected by one skilled in the art without departing from the spirit or scope of the invention as defined in the appended claims.
Claims
1. A method of providing quality of service scheduling in multithreaded processing, comprising:
- identifying one or more hardware resources utilized by a thread in simultaneous multithreaded processing;
- communicating the identified one or more hardware resource utilization; and
- allowing reservation of the one or more hardware resources utilized by a thread in the simultaneous multithreaded processing.
2. The method of claim 1, wherein the step of identifying includes identifying one or more hardware resources utilized by a set of threads in simultaneous multithreaded processing.
3. The method of claim 1, wherein the step of identifying is performed by hardware.
4. The method of claim 1, wherein the step of communicating includes storing information pertaining to the identified one or more hardware resource utilization.
5. The method of claim 1, wherein the one or more hardware resources include one or more processing elements, functional units or cache memory or combination thereof.
6. The method of claim 1, wherein the one or more hardware resources includes at least a floating point unit, an integer unit, an arithmetic logic unit, a shifter, a register, a load-store unit, cache memory or combination thereof.
7. The method of claim 1, further including:
- scheduling one or more threads based on information associated with the identified one or more hardware resource utilization.
8. The method of claim 7, wherein the step of scheduling is performed by an operating system.
9. The method of claim 1, further including:
- reserving one or more hardware resources for a thread based on information associated with the identified one or more hardware resource utilization.
10. The method of claim 9, wherein the step of reserving is performed by an operating system.
11. The method of claim 9, wherein the step of reserving includes storing one or more data bits in a register accessible by hardware, the data bits identifying which one or more hardware resources to reserve for a thread.
12. The method of claim 1, wherein the step of communicating includes storing in a register accessible by an operating system, one or more data bits that identify one or more hardware resource utilization by a thread.
13. The method of claim 12, wherein the step of storing is performed by hardware.
14. The method of claim 1, further including:
- analyzing information associated with the identified one or more hardware resource utilization by a thread.
15. The method of claim 1, further including:
- communicating between software and hardware information associated with one or more threads by using software thread identifier to hardware thread identifier mapping.
16. The method of claim 1, further including:
- restricting one or more hardware resources from a thread based on information associated with the identified one or more hardware resource utilization.
17. A method of providing quality of service scheduling in multithreaded processing, comprising:
- accessing information associated with hardware resource utilization per thread in simultaneous multithreaded processing; and
- scheduling one or more threads based on the information.
18. The method of claim 17, further including:
- analyzing the information to determine at least one of memory utilization pattern, thread affinity concern, thread interference issue, and other thread resource behavior affecting utilization, and the step of scheduling includes scheduling one or more threads based on at least one of memory utilization pattern, thread affinity concern, thread interference issue, and other thread resource utilization affection behavior.
19. A method of providing quality of service scheduling in multithreaded processing, comprising:
- accessing information associated with a thread's use of one or more hardware resources on a core in simultaneous multithreaded processing; and
- reserving one or more hardware resources based on the accessed information.
20. A system for providing quality of service scheduling in multithreaded processing, comprising:
- a hardware controller on a processor operable to track a thread's use of one or more hardware resources in simultaneous multithreaded processing, the hardware controller further operable to communicate information associated with the use of one or more hardware resources per thread; and
- an operating system operable to access the information and schedule one or more threads based on the information.
Type: Application
Filed: Jul 19, 2006
Publication Date: Jan 24, 2008
Applicant: International Business Machines Corporation (Armonk, NY)
Inventors: Orran Y. Krieger (Newton, MA), Bryan S. Rosenburg (Cortlandt Manor, NY), Robert B. Tremaine (Stormville, NY), Robert W. Wisniewski (Ossining, NY)
Application Number: 11/488,977
International Classification: G06F 9/46 (20060101);