US8533719B2 - Cache-aware thread scheduling in multi-threaded systems - Google Patents

Cache-aware thread scheduling in multi-threaded systems Download PDF

Info

Publication number
US8533719B2
US8533719B2 US12/754,143 US75414310A US8533719B2 US 8533719 B2 US8533719 B2 US 8533719B2 US 75414310 A US75414310 A US 75414310A US 8533719 B2 US8533719 B2 US 8533719B2
Authority
US
United States
Prior art keywords
thread
cache
processor core
processor
executing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active, expires
Application number
US12/754,143
Other versions
US20110246995A1 (en
Inventor
Alexandra Fedorova
David Vengerov
Kishore Kumar Pusukuri
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oracle International Corp
Original Assignee
Oracle International Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oracle International Corp filed Critical Oracle International Corp
Priority to US12/754,143 priority Critical patent/US8533719B2/en
Assigned to ORACLE INTERNATIONAL CORPORATION reassignment ORACLE INTERNATIONAL CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: FEDOROVA, ALEXANDRA, PUSUKURI, KISHORE KUMAR, VENGEROV, DAVID
Publication of US20110246995A1 publication Critical patent/US20110246995A1/en
Application granted granted Critical
Publication of US8533719B2 publication Critical patent/US8533719B2/en
Active legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5033Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering data affinity
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This disclosure generally relates to techniques for predictively scheduling threads in a multi-threaded computer system. More specifically, this disclosure relates to techniques for determining and using thread characterizations and predicted performance impacts while making cache-aware thread-scheduling decisions.
  • Chip multi-threading (CMT) techniques provide an alternative way to improve processor performance.
  • CMT processors include multiple processor cores which can simultaneously execute multiple software threads, thereby allowing multi-threaded applications to achieve increased performance by utilizing multiple processor threads, without any increase in processor clock frequency.
  • Multi-core processor architectures typically include one or more caches or memories that are shared among multiple threads and/or cores. For instance, depending on their cache access characteristics, two threads that share a cache may interfere with each others' cache data and cause pipeline resource contention that can reduce the performance of both threads. Also, a “cache-intensive” thread with a high cache miss rate may negatively affect a second “cache-sensitive” thread that re-uses cache data and dramatically suffers in performance when this cache data is displaced by other threads. Unfortunately, it is hard to predict ahead of time whether two threads that share a common cache will interoperate favorably or interfere with each other.
  • the disclosed embodiments provide a system that facilitates predictively scheduling threads in a multi-threaded processor.
  • the system executes a first thread in a processor core that is associated with a shared cache.
  • the system measures one or more metrics to characterize the first thread.
  • the system uses the characterization of the first thread and a characterization for a second thread to predict a performance impact that would occur if the second thread were to simultaneously execute in a second processor core that is also associated with the cache. If the predicted performance impact indicates that executing the second thread on the second processor core will improve performance for the multi-threaded processor, the system executes the second thread on the second processor core.
  • the system measures one or more of the following metrics over a time interval: the number of cycles elapsed per second for a processor core; the average instructions executed per cycle (or per time interval) by a thread; the average cache accesses per instruction (or per time interval) for the thread; and the average cache misses per instruction (or per time interval) for the thread.
  • the system uses the measured metrics to determine whether a thread is cache-intensive, cache-sensitive, and/or cache-insensitive.
  • the system simultaneously gathers metrics for the first thread, the second thread, and a third thread.
  • the first and third thread execute on processor cores that share the shared cache, while the second thread executes on another processor core which uses a different cache.
  • the system then uses the gathered metrics to characterize all three threads, and considers the characterizations and metrics from the threads when predicting the performance impact of swapping the second and the third threads.
  • the system estimates the performance impact of a migration by predicting a degradation in the average instructions executed per cycle for one or more of the first thread, the second thread, and the third thread.
  • the system can gather data for thread characteristics and associated performance impacts by periodically migrating one or more threads between processor cores of the multi-threaded processor.
  • the system may instead (or also) opportunistically gather data during normal multi-threaded execution in the multi-threaded processor.
  • the system uses online thread characteristic and performance data to facilitate scheduling threads across processor cores.
  • the system uses application-independent scheduling techniques that are self-managing across changing data sets, changing data access patterns, and changing user requests.
  • the system includes a forecasting system that uses the gathered data to predict performance impacts for different thread-scheduling decisions.
  • the system can use statistical feedback from measured metrics, thread characteristics, and thread interactions to update parameters of this forecasting system.
  • the system facilitates improving the overall instruction throughput for the chip multi-threaded processor.
  • the system may also facilitate (and/or prioritize) reducing the power consumed by the chip multi-threaded processor while executing a set of threads.
  • a processor core in the multi-threaded processor can execute multiple threads simultaneously.
  • the above-mentioned processor core and second processor core may be a single processor core that can simultaneously execute both the first thread and the second thread.
  • the system predicts the performance impact associated with simultaneously executing the first thread and the second thread on this single processor core.
  • FIG. 1 illustrates an exemplary computing device that includes a set of shared structures for caching memory data in accordance with an embodiment.
  • FIG. 2 illustrates an exemplary potential scheduling change for the exemplary computing device of FIG. 1 in accordance with an embodiment.
  • FIG. 3 presents a flow chart that illustrates the process of predictively scheduling a thread in a multi-threaded processor in accordance with an embodiment.
  • FIG. 4 illustrates a computing environment in accordance with an embodiment.
  • FIG. 5 illustrates an exemplary computing device that includes a processor with structures that support predictive thread scheduling in accordance with an embodiment.
  • non-transitory computer-readable storage medium which may be any device or non-transitory medium that can store code and/or data for use by a computer system.
  • the non-transitory computer-readable storage medium includes, but is not limited to, volatile memory, non-volatile memory, magnetic and optical storage devices such as disk drives, magnetic tape, CDs (compact discs), DVDs (digital versatile discs or digital video discs), or other media capable of storing code and/or data now known or later developed.
  • the methods and processes described in the detailed description section can be embodied as code and/or data, which can be stored in a non-transitory computer-readable storage medium as described above.
  • a computer system reads and executes the code and/or data stored on the non-transitory computer-readable storage medium, the computer system performs the methods and processes embodied as data structures and code and stored within the non-transitory computer-readable storage medium.
  • modules or apparatus may include, but are not limited to, an application-specific integrated circuit (ASIC) chip, a field-programmable gate array (FPGA), a dedicated or shared processor that executes a particular software module or a piece of code at a particular time, and/or other programmable-logic devices now known or later developed.
  • ASIC application-specific integrated circuit
  • FPGA field-programmable gate array
  • the hardware modules or apparatus When activated, they perform the methods and processes included within them.
  • CMT chip multi-threading
  • the memory subsystem of a processor may include a number of specialized hardware structures that cache frequently accessed data, perform address translations, and generally speed up memory accesses.
  • specialized hardware structures may include multiple levels of caches, and at least one of these multiple levels of caches is often shared across multiple cores.
  • the memory subsystem may also include a number of other hardware structures that may be shared by two or more processor cores (e.g., pre-fetch hardware, a memory controller, and a memory bus).
  • Processors can swap out a stalled thread (e.g., a thread that is waiting for data from the memory subsystem), thereby allowing other threads to execute while the stalled thread's memory request completes.
  • a stalled thread e.g., a thread that is waiting for data from the memory subsystem
  • memory access speeds have not kept up with processor speed improvements, and as mentioned above, in some instances chip multi-threading techniques can increase the contention and load for shared structures.
  • shared memory resources can become a bottleneck that reduces overall thread performance.
  • FIG. 1 illustrates an exemplary computing device 100 that includes a set of shared structures for caching memory data.
  • Computing device 100 can include a CMT processor 102 with two or more processor cores 104 - 106 , each of which includes a processor core pipeline 108 and a level-one (L1) cache 110 .
  • Processor cores 104 - 106 share a level-two (L2) cache 112 .
  • Instructions executed in a core pipeline 108 that reference memory addresses trigger a request to an L1 cache 110 .
  • a miss in an L1 cache 110 results in a request to the shared L2 cache 112 , which returns the needed cache data to the requesting L1 cache 110 .
  • a miss in shared L2 cache 112 results in a request to main memory 114 .
  • multiple threads may execute in different processor cores, or even execute simultaneously in a single processor core.
  • two threads executing in processor core 104 may share both an L1 cache 110 as well as the shared L2 cache 112 .
  • two threads executing in processor core 104 and processor core 106 respectively share L2 cache 112 .
  • sharing of cache structures between multiple threads can lead to contention and decreased instruction throughput for CMT processor 102 .
  • the memory hierarchy illustrated in FIG. 1 is exemplary, and different implementations may have additional cache levels as well as different granularities of sharing for cache structures.
  • Cache intensity relates to frequency of cache accesses; “cache-intensive” threads tend to perform more cache accesses (e.g., regularly access cache data) than non-cache-intensive threads.
  • Cache sensitivity relates to the cache re-use behavior of a thread.
  • the cache accesses of threads that are “cache-sensitive” tend to heavily re-use cached data, and thus the thread will suffer in performance if the thread's cached data has been displaced by other threads.
  • Threads that are cache-intensive but “cache-insensitive” typically perform many cache accesses, but do not re-use data (e.g., such threads regularly access new data instead of re-using data already loaded in the cache, and thus have a high cache miss rate).
  • a thread's cache intensity and sensitivity may change in time (e.g., depending on a given workload or other application factors).
  • a thread-scheduling policy that schedules a cache-intensive, cache-insensitive thread to share a cache with a cache-intensive, cache-sensitive thread may degrade performance; the cache access patterns of the cache-insensitive thread may repeatedly displace the cached data of the cache-sensitive thread, thereby substantially increasing the miss rate of the cache-sensitive thread.
  • the cache-sensitive thread may touch its cached data sufficiently frequently to keep the data in the shared cache, thereby avoiding additional performance degradation.
  • the IPC of threads depends on many factors that are unrelated to resource sharing and/or difficult to measure at the operating-system (OS) level.
  • the actual IPC will depend on both the thread's properties and the properties of potential “co-runner thread(s)” (e.g., one or more additional threads that execute simultaneously and share some resource, such as a cache, with the first thread).
  • the cache miss rate for a thread can be a good indicator (and predictor) of the “stress” that a given application imposes on bottleneck shared memory resources.
  • a cache-intensive, cache-insensitive application thread typically has a high cache miss rate, which corresponds with the relatively high amount of stress placed on the memory hierarchy by frequent memory accesses to new memory data (e.g., the thread doesn't re-use cached data much, and thus is not as affected when its data is evicted from the cache, but the frequent cache misses from the memory accesses to un-cached data cause contention for lower-level memory structures).
  • a cache-intensive, cache-sensitive thread that re-uses cache data heavily (when such data is not displaced from the cache) has a lower cache miss rate, which corresponds with high sensitivity to cache contention but less stress imposed on the lower-level memory structures (because more of the memory requests are serviced by the cache). If the data of the thread is evicted from the cache, however, the thread will have more misses and a high average miss rate, which corresponds to more stress on shared memory resources. Threads that are non-cache-intensive typically have a very low cache miss rate, which corresponds to a minor effect on memory contention.
  • Embodiments of the present invention involve techniques for predicting thread combinations that will improve the instruction throughput of a CMT processor. Note that, while the following sections describe techniques that involve two or more threads that share a cache, the described techniques are not limited to shared caches, and can be applied to any shared resource.
  • Embodiments of the present invention involve techniques for improving the way in which threads are scheduled in a CMT processor.
  • An automated system learns how to predict the performance degradation in the measured IPC values of two threads when they are scheduled on processor cores that share a common cache. Such “cache-aware” predictions are then used to automatically assign threads to cores in an attempt to maximize the total IPC for all threads in the system.
  • the system uses learning techniques to predict the percentage change in IPC for a thread when a co-runner changes.
  • the system can measure the percent degradation in IPC for threads when co-runners change to detect threads that consistently cause a large IPC degradation in their co-runners; such behavior is characteristic for cache-intensive threads, which tend to degrade the instruction throughput of their co-runners.
  • the system can determine threads that have a consistently larger percentage degradation in IPC across all possible co-runners; such behavior is expected for cache-sensitive threads.
  • the system can predict which threads are cache-intensive and which are cache-sensitive. The system can then use such predictions to group threads in a way that improves the overall IPC across all threads.
  • the system continuously monitors a set of metrics for each executing thread. For instance, the system may use processor hardware counters to measure for a thread the average cache accesses for a time interval (e.g., a second), the average cache misses for the time interval, and/or the average number of instructions for the time interval.
  • a time interval e.g., a second
  • the system may use these raw metrics directly (e.g., accesses-per-second (APS), misses-per-second (MPS), and instructions per second (IPS)), or normalize some of the metrics to get per-instruction values (e.g., accesses-per-instruction (API), misses-per-instruction (MPI), and instructions per cycle (IPC)—note that the corresponding raw (per-second) and normalized (per instruction or cycle) terms indicate substantially similar underlying trends, and can be used interchangeably throughout the present disclosure). Note that in some processors measuring MPS may be difficult, but IPS, which declines when many misses occur, may also be used to get a rough estimate of MPS and APS.
  • API accesses-per-instruction
  • MPI misses-per-instruction
  • IPC instructions per cycle
  • the system uses the above-described metrics to estimate the cache-intensity and cache-sensitivity of a thread.
  • Experimental results indicate that several grouped values for such characteristics correspond with certain values for thread MPI and API relative to the MPI and API values observed for other threads in the system.
  • a combination of high MPI and high API metric values for a thread is a sign of a cache-intensive thread (which tends to cause high IPC degradation for other co-runner threads).
  • a combination of low MPI and high API metric values for a thread is a sign of a cache-sensitive thread (whose IPC may decrease significantly in percentage terms for some specific types of co-scheduled threads). Threads with low API metric values typically do not have high MPI metrics and thus do not cause much memory or cache contention (i.e., are non-cache-intensive).
  • the described techniques for characterizing thread cache behavior can predict not only a percentage change in the IPC of a thread when its co-runners are changed, but can also predict the absolute IPC of a thread as a function of the properties of its co-runners.
  • additional input variables used for making such predictions can be a thread's previous IPC observed with other previous co-runners and the difference in the average MPI between the current co-runners and the previous co-runners.
  • Embodiments of the present invention involve a rule-based predictive forecasting system that uses the thread metrics and/or resource-usage characterizations of multiple threads to predict changes in IPC for possible thread-scheduling decisions.
  • This forecasting system can use measured metrics to predict which threads will cause relatively more “stress” (e.g., contention) for the cache/memory hierarchy and how each particular thread will respond to different co-runners.
  • the forecasting system can then use this information to group threads together across resources in a way that reduces overall resource contention, thereby improving the absolute IPC for all threads. For instance, the forecasting system can be used to predict the percentage degradation in the IPC of a given thread if its co-runner is changed from a first thread to a second thread, based on the API and MPI of the three threads in question.
  • the forecasting system uses the sum of the miss rates for two or more threads as an estimate of “stress” for a portion of the processor.
  • the forecasting system can track this value over time, and strive to make predictive scheduling choices that minimize this value. For instance, when contemplating changing a co-runner for a thread, the system may predict the change in stress by looking at the cache miss rate and cache access rate for the thread as well as the miss rate of the current co-runner and the miss rate of the proposed co-runner.
  • FIG. 2 illustrates an exemplary potential scheduling change for the exemplary computing device 100 of FIG. 1 .
  • two threads (thread 1 200 and thread 2 202 ) execute on processor core 104 and share an L1 cache 110
  • two other threads (thread 3 204 and thread 4 206 ) execute on processor core 106
  • a scheduling change that swaps thread 2 202 and thread 3 204
  • the forecasting system would need to consider the predicted change in IPC for all four threads.
  • the forecasting system may consider: the cache miss rate MPI 1 and cache access rate API 1 for thread 1 200 ; the cache miss rate MPI 2 and cache access rate API 2 for thread 2 202 ; and the cache miss rate MPI 3 and cache access rate API 3 for thread 3 204 .
  • the forecasting system would consider MPI 2 , API 2 , MPI 1 , API 1 , MPI 4 , and API 4 . Note that in some instances the forecasting system may not need to consider the API of every thread.
  • the forecasting system may only need to consider a subset of the metrics (e.g., only MPI 1 , API 1 , MPI 2 and MPI 3 , and not API 2 and API 3 ) when predicting a percentage change in the IPC 1 of thread 1 200 .
  • a subset of the metrics e.g., only MPI 1 , API 1 , MPI 2 and MPI 3 , and not API 2 and API 3 .
  • a beneficial scheduling change in this scenario would result in a prediction (and hopefully a corresponding actual improvement if the change is executed) in the overall instruction rate for all four threads (e.g., the sum of the post-switch IPCs for all threads would be larger than the sum of the pre-switch IPCs).
  • FIG. 3 presents a flow chart that illustrates the process of predictively scheduling threads in a multi-threaded processor.
  • the system executes a first thread in a processor core that is associated with a shared cache (operation 300 ).
  • the system measures one or more metrics to characterize the first thread (operation 310 ).
  • the system uses the characterization of the first thread and a characterization for a second thread to predict a performance impact that would occur if the second thread were to simultaneously execute in a second processor core that is also associated with the cache (operation 320 ). If the predicted performance impact indicates that executing the second thread on the second processor core will improve performance for the multi-threaded processor (operation 330 ), the system executes the second thread on the second processor core (operation 340 ); otherwise, the process ends.
  • the forecasting system includes a fuzzy rulebase to track data points and predict changes in the IPC of threads.
  • the forecasting system may involve a linear combination of basis functions of the form
  • each function ⁇ j i (y) is a function on the domain of values for x.
  • k 6
  • x 1 APS t
  • x 2 MPI t
  • x 3 APS current-co-runner
  • x 4 MPIcurrent -co-runner
  • x 5 APS new-candidate-co-runner
  • x 6 MPI new-candidate-co-runner .
  • the forecasting system can plug the current metrics for the threads into the fuzzy rulebase to predict the total IPC change for a thread migration being considered.
  • the forecasting system considers the total sum of the miss rates (e.g., the total MPS/MPI) for all threads as an estimate of overall stress in the system.
  • the forecasting system may take the existing stress as an input, and then strive to predict scheduling changes that will result in a reduced stress, thereby maximizing the instruction throughput for the computing environment.
  • the forecasting system may also consider other factors, such as thread fairness and reducing power usage. For instance, the system may be configured to sometimes make scheduling changes that reduce the overall possible instruction throughput to ensure that a given thread is able to make progress.
  • the parameters of the fuzzy rulebase can be tuned during operation of the forecasting system based on predicted and observed performance. For instance, the system may first use the fuzzy rulebase to make a set of predictions, and then, after making a thread-scheduling change: 1) compare the observed performance changes with the predicted performance changes, and 2) update the parameters of the fuzzy rulebase to more accurately reflect the observed performance changes.
  • parameters in the forecasting system can be updated after every data point (e.g., for every set of measured metrics) to configure and continuously adjust the statistical model of the system based on changes in behavior.
  • the forecasting system may also make use of neural network techniques.
  • training the forecasting system involves using one or more data-gathering techniques to gather data points for thread metrics, characterizations, and interactions.
  • the data-gathering techniques and the number of initial data points needed, may vary based on factors such as the computing environment, application characteristics, and administrator preferences. For instance, one data-gathering technique may quickly generate data points by periodically (e.g., every second) re-shuffling groups of threads. Such a forced migration may introduce some additional system overhead, but also allows the forecasting system to quickly build a model of thread metrics and characterizations and to begin making beneficial scheduling predictions.
  • the system may gather data more slowly (and with lower overhead) during normal execution (e.g., based on normal non-predictive scheduling, start, stop, and migration of threads). Note that thread data can be gathered in parallel (for multiple threads at once) or sequentially, as desired.
  • the system may passively gather data for an initial interval, and then begin predictive scheduling when a threshold of data has been gathered. For instance, the system may first initiate a series of forced migrations until a certain number of data points have been gathered (e.g., 100 data points), and then begin cache-aware scheduling using predictions. Alternatively, the system may already use predictions even during initial training. In this scenario, the predictions may initially be somewhat rough and/or erroneous, but become more tuned and beneficial as more data is gathered.
  • One example involves training and using a forecasting system that includes a fuzzy rulebase to make scheduling decisions for a four-core processor that can simultaneously execute four threads.
  • the four processor cores are split into two pairs of cores, with each pair sharing a separate cache.
  • the forecasting system can gather data by:
  • threads 1 and 2 that are both cache-intensive and cache-sensitive, and two other threads that are cache-intensive but cache-insensitive (threads 3 and 4 ). All four threads access their respective caches frequently, but threads 1 and 2 tend to re-use cached data, while threads 3 and 4 tend to access new data, and hence cause relatively more memory contention. In such a situation, it may not be clear what the best scheduling strategy would be.
  • one heuristic might be to equalize the cache miss rate for the two caches by separating the two cache-insensitive threads (e.g., by pairing threads 1 and 3 on a first cache, and threads 2 and 4 on a second cache).
  • Such a grouping may lead to improved performance if cache-sensitive threads 1 and 2 are able to access a small set of needed blocks sufficiently frequently to keep such blocks pinned in their caches (e.g., via an LRU cache replacement strategy), and the rest of the cache spaces are available to cache-insensitive threads 3 and 4 .
  • the cached data of threads 1 and 2 is frequently displaced, their instruction throughput could drop dramatically.
  • an alternate heuristic might group threads 1 and 2 together to share a cache, with threads 3 and 4 sharing the second cache.
  • such a grouping might also lead to problems if the combined working sets of threads 1 and 2 interfere with each other (e.g., displace each other from their shared cache).
  • Another general factor to consider is that a high level of contention for the memory bus may lead to a saturation of the memory bus that causes a non-linear decrease in performance.
  • the described forecasting system can gather metric data for all four threads, and then use historical metric and interaction data to find a good balance for the specific blend of threads and hardware that are present. More specifically, the forecasting system can gather data for different degrees of cache intensity and cache sensitivity, and use this data to formulate a beneficial scheduling prediction that maximizes the total instruction throughput for all four threads. For example, the forecasting system may determine from the available data that grouping two moderately cache-intensive threads together is beneficial, but that grouping two highly cache-intensive threads together should be avoided due to an associated predicted decline in performance.
  • the inputs to the forecasting system are not specific thread or application identifiers, but are instead general thread characteristics (e.g., IPC, MPC, APC).
  • general thread characteristics e.g., IPC, MPC, APC.
  • the statistical model that maps thread characteristics to predicted performance changes is purely based on miss rate and access rate, the general prediction principle is application-independent (e.g., operates only using such miss rates, and independent of any application-specific identifiers).
  • the characteristics of a thread may change over time due to changes in workload or other factors (e.g., changes in applications, user patterns, and/or time-of-day behavior), but such changes are simply measured and then input into the forecasting system as additional data points.
  • the described system is self-managing, and detects and adjusts to changes in an “online” manner (e.g., during operation, without involving a preceding, offline set of profiling runs).
  • the described techniques can be scaled to arbitrary numbers of threads (e.g., all of the threads in a server, cluster, etc.), unlike other scheduling heuristics that attempt to sample different thread schedules before arriving at scheduling decisions.
  • the preceding example can be extended to N threads running on N cores, and then extended to K threads running on N cores, with the forecasting system gathering and benefiting from metrics and characterization data that is gathered for all of those threads.
  • the forecasting system can typically use existing processor hardware counters to gather measured values. For instance, an operating system command may be available to start tracking for processes and return measured values (e.g., a “cpuTrack” command that takes an interval setting, and returns the values of the hardware counters).
  • the system may use other hardware and/or software counters instead of (and/or in addition to) MPI, API, and IPC as inputs to the forecasting system.
  • system entities could be configured to include the forecasting system and to manage thread scheduling and migrations.
  • aspects of the forecasting system might be included in the operating system kernel, scheduler, and/or in a customized user-level process. Some or all aspects of the forecasting system may also be implemented using additional processor hardware.
  • the described techniques can be applied to systems in which each processor core can simultaneously execute more than two threads. For instance, in some embodiments, the described techniques may collect MPI, API, and IPC information from two or more co-runner threads in a processor core, and then average these metrics over the co-runners. In some embodiments, the described techniques may also be applied to systems with more than two cores. In an architecture where more than two cores are present, the described techniques may additionally involve choosing two cores between which possible migrations should be evaluated (e.g., by choosing cores randomly, or by sequentially choosing all cores and considering only their neighboring cores for possible migrations).
  • embodiments of the present invention involve techniques for predicting thread combinations that will improve the performance of a CMT processor.
  • An automated rule-based forecasting system learns how to predict the performance degradation in the measured instruction throughput of two threads when they are scheduled on processor cores that share a common resource.
  • the forecasting system uses such cache-aware predictions to schedule threads into beneficial groupings, thereby improving the overall instruction throughput for the computing environment.
  • cache-aware techniques for predicting thread combinations that will improve performance can be incorporated into a wide range of computing devices in a computing environment.
  • FIG. 4 illustrates a computing environment 400 in accordance with an embodiment of the present invention.
  • Computing environment 400 includes a number of computer systems, which can generally include any type of computer system based on a microprocessor, a mainframe computer, a digital signal processor, a portable computing device, a personal organizer, a device controller, or a computational engine within an appliance. More specifically, referring to FIG. 4 , computing environment 400 includes clients 410 - 412 , users 420 and 421 , servers 430 - 450 , network 460 , database 470 , devices 480 , and appliance 490 .
  • Clients 410 - 412 can include any node on a network that includes computational capability and includes a mechanism for communicating across the network. Additionally, clients 410 - 412 may comprise a tier in an n-tier application architecture, wherein clients 410 - 412 perform as servers (servicing requests from lower tiers or users), and wherein clients 410 - 412 perform as clients (forwarding the requests to a higher tier).
  • servers 430 - 450 can generally include any node on a network including a mechanism for servicing requests from a client for computational and/or data storage resources.
  • Servers 430 - 450 can participate in an advanced computing cluster, or can act as stand-alone servers.
  • computing environment 400 can include a large number of compute nodes that are organized into a computing cluster and/or server farm.
  • server 440 is an online “hot spare” of server 450 .
  • Users 420 and 421 can include: an individual; a group of individuals; an organization; a group of organizations; a computing system; a group of computing systems; or any other entity that can interact with computing environment 400 .
  • Network 460 can include any type of wired or wireless communication channel capable of coupling together computing nodes. This includes, but is not limited to, a local area network, a wide area network, or a combination of networks. In one embodiment of the present invention, network 460 includes the Internet. In some embodiments of the present invention, network 460 includes phone and cellular phone networks.
  • Database 470 can include any type of system for storing data in non-volatile storage. This includes, but is not limited to, systems based upon magnetic, optical, or magneto-optical storage devices, as well as storage devices based on flash memory and/or battery-backed up memory. Note that database 470 can be coupled: to a server (such as server 450 ), to a client, or directly to a network. In some embodiments of the present invention, database 470 is used to store information related to virtual machines and/or guest programs. Alternatively, other entities in computing environment 400 may also store such data (e.g., servers 430 - 450 ).
  • Devices 480 can include any type of electronic device that can be coupled to a client, such as client 412 . This includes, but is not limited to, cell phones, personal digital assistants (PDAs), smart-phones, personal music players (such as MP3 players), gaming systems, digital cameras, portable storage media, or any other device that can be coupled to the client. Note that, in some embodiments of the present invention, devices 480 can be coupled directly to network 460 and can function in the same manner as clients 410 - 412 .
  • Appliance 490 can include any type of appliance that can be coupled to network 460 . This includes, but is not limited to, routers, switches, load balancers, network accelerators, and specialty processors. Appliance 490 may act as a gateway, a proxy, or a translator between server 440 and network 460 .
  • FIG. 5 illustrates an exemplary computing device 500 that includes a multi-threaded processor 502 and memory 504 .
  • Multi-threaded processor 502 includes a first processor core 506 , a second processor core 508 , and a cache 510 associated with the two processor cores ( 506 - 508 ).
  • Processor 502 also includes measurement mechanism 512 , prediction mechanism 514 , and scheduling mechanism 516 .
  • Processor 502 uses measurement mechanism 512 , prediction mechanism 514 , and scheduling mechanism 516 to perform predictive, cache-aware thread scheduling.
  • processor 502 uses measurement mechanism 512 to measure one or more metrics to characterize a first thread executing in processor core 506 .
  • Processor 502 then invokes prediction mechanism 514 , which uses the characterization of the first thread and a characterization of a second thread to predict a performance impact associated with simultaneously executing the second thread in processor core 508 (or in processor core 506 , if processor core 506 is able to execute multiple threads simultaneously). If the predicted performance impact indicates that executing the second thread on the second processor will improve performance, processor 502 then uses scheduling mechanism 516 to simultaneously execute the second thread on processor core 508 (or on processor core 506 , as described above).
  • some or all aspects of measurement mechanism 512 , prediction mechanism 514 , and/or scheduling mechanism 516 can be implemented as dedicated hardware modules in processor 502 .
  • processor 502 can include one or more specialized circuits for performing the operations of the mechanisms.
  • some or all of the operations of measurement mechanism 512 , prediction mechanism 514 , and/or scheduling mechanism 516 may be performed using general-purpose circuits in processor 502 that are configured using processor instructions.
  • FIG. 5 illustrates measurement mechanism 512 , prediction mechanism 514 , and/or scheduling mechanism 516 as being included in processor 502
  • some or all of these mechanisms are external to processor 502 .
  • these mechanisms may be incorporated into hardware modules external to processor 502 .
  • These hardware modules can include, but are not limited to, processor chips, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), memory chips, and other programmable-logic devices now known or later developed.
  • the hardware modules when the external hardware modules are activated, the hardware modules perform the methods and processes included within the hardware modules.
  • the hardware module includes one or more dedicated circuits for performing the operations described below.
  • the hardware module is a general-purpose computational circuit (e.g., a microprocessor or an ASIC), and when the hardware module is activated, the hardware module executes program code (e.g., BIOS, firmware, etc.) that configures the general-purpose circuits to perform the operations described above.
  • program code e.g., BIOS, firmware, etc.

Abstract

The disclosed embodiments provide a system that facilitates scheduling threads in a multi-threaded processor with multiple processor cores. During operation, the system executes a first thread in a processor core that is associated with a shared cache. During this execution, the system measures one or more metrics to characterize the first thread. Then, the system uses the characterization of the first thread and a characterization for a second, second thread to predict a performance impact that would occur if the second thread were to simultaneously execute in a second processor core that is also associated with the cache. If the predicted performance impact indicates that executing the second thread on the second processor core will improve performance for the multi-threaded processor, the system executes the second thread on the second processor core.

Description

BACKGROUND
1. Field
This disclosure generally relates to techniques for predictively scheduling threads in a multi-threaded computer system. More specifically, this disclosure relates to techniques for determining and using thread characterizations and predicted performance impacts while making cache-aware thread-scheduling decisions.
2. Related Art
Although historic increases in processor clock frequencies have substantially improved application performance, recent increases in clock frequencies have led to diminishing performance gains. For instance, because memory speeds have not advanced at the same rate as processor frequencies, processor threads spend an increasing amount of time waiting for memory accesses to complete. Furthermore, increased clock speeds can dramatically increase power consumption, which can cause heat-dissipation problems.
Chip multi-threading (CMT) techniques provide an alternative way to improve processor performance. CMT processors include multiple processor cores which can simultaneously execute multiple software threads, thereby allowing multi-threaded applications to achieve increased performance by utilizing multiple processor threads, without any increase in processor clock frequency.
However, multi-threading may also introduce additional challenges. Multi-core processor architectures typically include one or more caches or memories that are shared among multiple threads and/or cores. For instance, depending on their cache access characteristics, two threads that share a cache may interfere with each others' cache data and cause pipeline resource contention that can reduce the performance of both threads. Also, a “cache-intensive” thread with a high cache miss rate may negatively affect a second “cache-sensitive” thread that re-uses cache data and dramatically suffers in performance when this cache data is displaced by other threads. Unfortunately, it is hard to predict ahead of time whether two threads that share a common cache will interoperate favorably or interfere with each other.
Hence, what is needed are techniques for scheduling threads without the above-described problems of existing pre-fetching techniques.
SUMMARY
The disclosed embodiments provide a system that facilitates predictively scheduling threads in a multi-threaded processor. During operation, the system executes a first thread in a processor core that is associated with a shared cache. During this execution, the system measures one or more metrics to characterize the first thread. Then, the system uses the characterization of the first thread and a characterization for a second thread to predict a performance impact that would occur if the second thread were to simultaneously execute in a second processor core that is also associated with the cache. If the predicted performance impact indicates that executing the second thread on the second processor core will improve performance for the multi-threaded processor, the system executes the second thread on the second processor core.
In some embodiments, the system measures one or more of the following metrics over a time interval: the number of cycles elapsed per second for a processor core; the average instructions executed per cycle (or per time interval) by a thread; the average cache accesses per instruction (or per time interval) for the thread; and the average cache misses per instruction (or per time interval) for the thread.
In some embodiments, the system uses the measured metrics to determine whether a thread is cache-intensive, cache-sensitive, and/or cache-insensitive.
In some embodiments, the system simultaneously gathers metrics for the first thread, the second thread, and a third thread. The first and third thread execute on processor cores that share the shared cache, while the second thread executes on another processor core which uses a different cache. The system then uses the gathered metrics to characterize all three threads, and considers the characterizations and metrics from the threads when predicting the performance impact of swapping the second and the third threads.
In some embodiments, the system estimates the performance impact of a migration by predicting a degradation in the average instructions executed per cycle for one or more of the first thread, the second thread, and the third thread.
In some embodiments, the system can gather data for thread characteristics and associated performance impacts by periodically migrating one or more threads between processor cores of the multi-threaded processor. Alternatively, the system may instead (or also) opportunistically gather data during normal multi-threaded execution in the multi-threaded processor.
In some embodiments, the system uses online thread characteristic and performance data to facilitate scheduling threads across processor cores.
In some embodiments, the system uses application-independent scheduling techniques that are self-managing across changing data sets, changing data access patterns, and changing user requests.
In some embodiments, the system includes a forecasting system that uses the gathered data to predict performance impacts for different thread-scheduling decisions. The system can use statistical feedback from measured metrics, thread characteristics, and thread interactions to update parameters of this forecasting system.
In some embodiments, the system facilitates improving the overall instruction throughput for the chip multi-threaded processor. Alternatively, the system may also facilitate (and/or prioritize) reducing the power consumed by the chip multi-threaded processor while executing a set of threads.
In some embodiments, a processor core in the multi-threaded processor can execute multiple threads simultaneously. In such a processor, the above-mentioned processor core and second processor core may be a single processor core that can simultaneously execute both the first thread and the second thread. In such an environment, the system predicts the performance impact associated with simultaneously executing the first thread and the second thread on this single processor core.
BRIEF DESCRIPTION OF THE FIGURES
FIG. 1 illustrates an exemplary computing device that includes a set of shared structures for caching memory data in accordance with an embodiment.
FIG. 2 illustrates an exemplary potential scheduling change for the exemplary computing device of FIG. 1 in accordance with an embodiment.
FIG. 3 presents a flow chart that illustrates the process of predictively scheduling a thread in a multi-threaded processor in accordance with an embodiment.
FIG. 4 illustrates a computing environment in accordance with an embodiment.
FIG. 5 illustrates an exemplary computing device that includes a processor with structures that support predictive thread scheduling in accordance with an embodiment.
In the figures, like reference numerals refer to the same figure elements.
DETAILED DESCRIPTION
The following description is presented to enable any person skilled in the art to make and use the embodiments, and is provided in the context of a particular application and its requirements. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present disclosure. Thus, the present invention is not limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The data structures and code described in this detailed description are typically stored on a non-transitory computer-readable storage medium, which may be any device or non-transitory medium that can store code and/or data for use by a computer system. The non-transitory computer-readable storage medium includes, but is not limited to, volatile memory, non-volatile memory, magnetic and optical storage devices such as disk drives, magnetic tape, CDs (compact discs), DVDs (digital versatile discs or digital video discs), or other media capable of storing code and/or data now known or later developed.
The methods and processes described in the detailed description section can be embodied as code and/or data, which can be stored in a non-transitory computer-readable storage medium as described above. When a computer system reads and executes the code and/or data stored on the non-transitory computer-readable storage medium, the computer system performs the methods and processes embodied as data structures and code and stored within the non-transitory computer-readable storage medium.
Furthermore, methods and processes described herein can be included in hardware modules or apparatus. These modules or apparatus may include, but are not limited to, an application-specific integrated circuit (ASIC) chip, a field-programmable gate array (FPGA), a dedicated or shared processor that executes a particular software module or a piece of code at a particular time, and/or other programmable-logic devices now known or later developed. When the hardware modules or apparatus are activated, they perform the methods and processes included within them.
Thread Interference in Multi-Threaded Systems
Increasingly complex software applications continue to motivate improvements in processor technology, both for personal computing devices as well as server-scale computers. For instance, the popularity of large-scale applications and cloud computing depend on the computational support of an ever-growing set of data centers (e.g., server farms). However, the expense of such data centers continues to grow due to equipment costs as well as power and cooling costs. One way to reduce costs and power usage is to consolidate workloads. For instance, chip multi-threading (CMT) processors with multiple processor cores allow multiple applications and/or application threads to execute simultaneously on a given server, thereby reducing the total number of server systems and resources needed in the data center. However, the potential benefits of simultaneously executing multiple applications on a CMT processor can be diminished by negative interactions between co-located threads.
In a processor, high instruction throughput typically involves rapid translation of virtual addresses and fast memory accesses. To achieve such throughput, the memory subsystem of a processor may include a number of specialized hardware structures that cache frequently accessed data, perform address translations, and generally speed up memory accesses. For instance, in modern multi-core processors, such specialized hardware structures may include multiple levels of caches, and at least one of these multiple levels of caches is often shared across multiple cores. The memory subsystem may also include a number of other hardware structures that may be shared by two or more processor cores (e.g., pre-fetch hardware, a memory controller, and a memory bus).
Processors can swap out a stalled thread (e.g., a thread that is waiting for data from the memory subsystem), thereby allowing other threads to execute while the stalled thread's memory request completes. However, memory access speeds have not kept up with processor speed improvements, and as mentioned above, in some instances chip multi-threading techniques can increase the contention and load for shared structures. Hence, shared memory resources can become a bottleneck that reduces overall thread performance.
FIG. 1 illustrates an exemplary computing device 100 that includes a set of shared structures for caching memory data. Computing device 100 can include a CMT processor 102 with two or more processor cores 104-106, each of which includes a processor core pipeline 108 and a level-one (L1) cache 110. Processor cores 104-106 share a level-two (L2) cache 112. Instructions executed in a core pipeline 108 that reference memory addresses trigger a request to an L1 cache 110. A miss in an L1 cache 110 results in a request to the shared L2 cache 112, which returns the needed cache data to the requesting L1 cache 110. A miss in shared L2 cache 112 results in a request to main memory 114.
In some processor architectures, multiple threads may execute in different processor cores, or even execute simultaneously in a single processor core. For instance, two threads executing in processor core 104 may share both an L1 cache 110 as well as the shared L2 cache 112. Alternatively, two threads executing in processor core 104 and processor core 106 respectively share L2 cache 112. Depending on thread and workload characteristics, such sharing of cache structures between multiple threads can lead to contention and decreased instruction throughput for CMT processor 102. Note that the memory hierarchy illustrated in FIG. 1 is exemplary, and different implementations may have additional cache levels as well as different granularities of sharing for cache structures.
Unfortunately, predicting how much contention will arise for a given shared resource is typically difficult, and the presence of a number of different shared resources makes predicting how two applications will affect each other's performance difficult. For instance, one issue when designing thread-scheduling policies for CMT systems is how to efficiently share a last-level cache (e.g., a shared level-two (L2) cache) across threads with potentially different access patterns. Scheduling efforts may need to account for threads that have different levels of cache access “intensity” and “sensitivity.” Cache intensity relates to frequency of cache accesses; “cache-intensive” threads tend to perform more cache accesses (e.g., regularly access cache data) than non-cache-intensive threads. Cache sensitivity relates to the cache re-use behavior of a thread. The cache accesses of threads that are “cache-sensitive” tend to heavily re-use cached data, and thus the thread will suffer in performance if the thread's cached data has been displaced by other threads. Threads that are cache-intensive but “cache-insensitive” typically perform many cache accesses, but do not re-use data (e.g., such threads regularly access new data instead of re-using data already loaded in the cache, and thus have a high cache miss rate). Note that a thread's cache intensity and sensitivity may change in time (e.g., depending on a given workload or other application factors).
A thread-scheduling policy that schedules a cache-intensive, cache-insensitive thread to share a cache with a cache-intensive, cache-sensitive thread may degrade performance; the cache access patterns of the cache-insensitive thread may repeatedly displace the cached data of the cache-sensitive thread, thereby substantially increasing the miss rate of the cache-sensitive thread. However, in some alternative scenarios, (e.g., if the working set of the two threads is small, the cache size is large, and/or the number of cache ways is high), the cache-sensitive thread may touch its cached data sufficiently frequently to keep the data in the shared cache, thereby avoiding additional performance degradation. Unfortunately, it is not clear how to predict ahead of time whether threads will be able to co-exist well on a pair of cores that share a common cache or whether the threads will interfere with each other. Experimental tests have indicated that in some instances the instructions per cycle (IPC, a standard performance metric for a thread scheduler) for a thread may vary by more than 40% when a range of other threads are assigned to share a resource in a multi-core CMT system.
As described above, predicting the specific IPC for a thread that is not executing in isolation is difficult, because the IPC of threads depends on many factors that are unrelated to resource sharing and/or difficult to measure at the operating-system (OS) level. The actual IPC will depend on both the thread's properties and the properties of potential “co-runner thread(s)” (e.g., one or more additional threads that execute simultaneously and share some resource, such as a cache, with the first thread). However, the cache miss rate for a thread can be a good indicator (and predictor) of the “stress” that a given application imposes on bottleneck shared memory resources. For instance, a cache-intensive, cache-insensitive application thread typically has a high cache miss rate, which corresponds with the relatively high amount of stress placed on the memory hierarchy by frequent memory accesses to new memory data (e.g., the thread doesn't re-use cached data much, and thus is not as affected when its data is evicted from the cache, but the frequent cache misses from the memory accesses to un-cached data cause contention for lower-level memory structures). In contract, a cache-intensive, cache-sensitive thread that re-uses cache data heavily (when such data is not displaced from the cache) has a lower cache miss rate, which corresponds with high sensitivity to cache contention but less stress imposed on the lower-level memory structures (because more of the memory requests are serviced by the cache). If the data of the thread is evicted from the cache, however, the thread will have more misses and a high average miss rate, which corresponds to more stress on shared memory resources. Threads that are non-cache-intensive typically have a very low cache miss rate, which corresponds to a minor effect on memory contention.
Note that, while knowledge of thread characteristics and memory re-use profile data (e.g., whether a thread is cache-intensive, cache-sensitive, etc.) can be useful for thread-scheduling decisions, measuring and/or characterizing threads can be challenging and effort-intensive. Performing “offline” measurements and characterizations for threads in isolation (with each thread running independently) often does not result in accurate predictions. Accurate performance and resource usage may depend on specific workloads and on interactions that only occur when two or more threads are executing simultaneously. Furthermore, gathering such data offline involves additional effort for already-overloaded data center managers. However, performing accurate measurements and characterizations “online” (e.g., during normal operation) is equally challenging, because the data gathered may depend on the characteristics of the current co-runner(s) for the thread being characterized, and thus may change based on workloads and other factors. In general, determining how applications will respond to and affect each other in an environment with shared resources is difficult.
Embodiments of the present invention involve techniques for predicting thread combinations that will improve the instruction throughput of a CMT processor. Note that, while the following sections describe techniques that involve two or more threads that share a cache, the described techniques are not limited to shared caches, and can be applied to any shared resource.
Characterizing Threads Based on Detected Degradation
Embodiments of the present invention involve techniques for improving the way in which threads are scheduled in a CMT processor. An automated system learns how to predict the performance degradation in the measured IPC values of two threads when they are scheduled on processor cores that share a common cache. Such “cache-aware” predictions are then used to automatically assign threads to cores in an attempt to maximize the total IPC for all threads in the system.
In some embodiments, the system uses learning techniques to predict the percentage change in IPC for a thread when a co-runner changes. The system can measure the percent degradation in IPC for threads when co-runners change to detect threads that consistently cause a large IPC degradation in their co-runners; such behavior is characteristic for cache-intensive threads, which tend to degrade the instruction throughput of their co-runners. Furthermore, the system can determine threads that have a consistently larger percentage degradation in IPC across all possible co-runners; such behavior is expected for cache-sensitive threads. Hence, by observing the percentage degradation in IPC that a thread causes for other threads, and the percentage degradation caused in the same thread by other co-runner threads, the system can predict which threads are cache-intensive and which are cache-sensitive. The system can then use such predictions to group threads in a way that improves the overall IPC across all threads.
In some embodiments, the system continuously monitors a set of metrics for each executing thread. For instance, the system may use processor hardware counters to measure for a thread the average cache accesses for a time interval (e.g., a second), the average cache misses for the time interval, and/or the average number of instructions for the time interval. The system may use these raw metrics directly (e.g., accesses-per-second (APS), misses-per-second (MPS), and instructions per second (IPS)), or normalize some of the metrics to get per-instruction values (e.g., accesses-per-instruction (API), misses-per-instruction (MPI), and instructions per cycle (IPC)—note that the corresponding raw (per-second) and normalized (per instruction or cycle) terms indicate substantially similar underlying trends, and can be used interchangeably throughout the present disclosure). Note that in some processors measuring MPS may be difficult, but IPS, which declines when many misses occur, may also be used to get a rough estimate of MPS and APS.
In some embodiments, the system uses the above-described metrics to estimate the cache-intensity and cache-sensitivity of a thread. Experimental results indicate that several grouped values for such characteristics correspond with certain values for thread MPI and API relative to the MPI and API values observed for other threads in the system. In particular, a combination of high MPI and high API metric values for a thread is a sign of a cache-intensive thread (which tends to cause high IPC degradation for other co-runner threads). A combination of low MPI and high API metric values for a thread is a sign of a cache-sensitive thread (whose IPC may decrease significantly in percentage terms for some specific types of co-scheduled threads). Threads with low API metric values typically do not have high MPI metrics and thus do not cause much memory or cache contention (i.e., are non-cache-intensive).
Note that the described techniques for characterizing thread cache behavior can predict not only a percentage change in the IPC of a thread when its co-runners are changed, but can also predict the absolute IPC of a thread as a function of the properties of its co-runners. In some embodiments, additional input variables used for making such predictions can be a thread's previous IPC observed with other previous co-runners and the difference in the average MPI between the current co-runners and the previous co-runners.
Predictive Forecasting System for Thread Scheduling
Embodiments of the present invention involve a rule-based predictive forecasting system that uses the thread metrics and/or resource-usage characterizations of multiple threads to predict changes in IPC for possible thread-scheduling decisions. This forecasting system can use measured metrics to predict which threads will cause relatively more “stress” (e.g., contention) for the cache/memory hierarchy and how each particular thread will respond to different co-runners. The forecasting system can then use this information to group threads together across resources in a way that reduces overall resource contention, thereby improving the absolute IPC for all threads. For instance, the forecasting system can be used to predict the percentage degradation in the IPC of a given thread if its co-runner is changed from a first thread to a second thread, based on the API and MPI of the three threads in question.
In some embodiments, the forecasting system uses the sum of the miss rates for two or more threads as an estimate of “stress” for a portion of the processor. The forecasting system can track this value over time, and strive to make predictive scheduling choices that minimize this value. For instance, when contemplating changing a co-runner for a thread, the system may predict the change in stress by looking at the cache miss rate and cache access rate for the thread as well as the miss rate of the current co-runner and the miss rate of the proposed co-runner.
FIG. 2 illustrates an exemplary potential scheduling change for the exemplary computing device 100 of FIG. 1. In FIG. 2, two threads (thread 1 200 and thread 2 202) execute on processor core 104 and share an L1 cache 110, while two other threads (thread 3 204 and thread 4 206) execute on processor core 106, and share a second different L1 cache 110. When considering a scheduling change that swaps thread 2 202 and thread 3 204, the forecasting system would need to consider the predicted change in IPC for all four threads. For instance, in order to estimate the impact of such a swap on the IPC1 of thread 1 200, the forecasting system may consider: the cache miss rate MPI1 and cache access rate API1 for thread 1 200; the cache miss rate MPI2 and cache access rate API2 for thread 2 202; and the cache miss rate MPI3 and cache access rate API3 for thread 3 204. Similarly, to estimate the impact of such a swap on the IPC2 of thread 2 202, the forecasting system would consider MPI2, API2, MPI1, API1, MPI4, and API4. Note that in some instances the forecasting system may not need to consider the API of every thread. For instance, in the first comparison, the forecasting system may only need to consider a subset of the metrics (e.g., only MPI1, API1, MPI2 and MPI3, and not API2 and API3) when predicting a percentage change in the IPC1 of thread 1 200.
In the example of FIG. 2, if MPI2 is high and MPI1 is low, the sum of IPCs for processor core 104 is likely to improve if the swap is made. However, swapping the high-MPI thread 2 202 to processor core 106 is likely to reduce the total IPC for processor core 106. But, if thread 4 206 is cache-insensitive or non-cache-intensive, the change may result in an improvement (or no change) to the total IPC for processor core 106 as well. In general, a beneficial scheduling change in this scenario would result in a prediction (and hopefully a corresponding actual improvement if the change is executed) in the overall instruction rate for all four threads (e.g., the sum of the post-switch IPCs for all threads would be larger than the sum of the pre-switch IPCs).
FIG. 3 presents a flow chart that illustrates the process of predictively scheduling threads in a multi-threaded processor. During operation, the system executes a first thread in a processor core that is associated with a shared cache (operation 300). During such execution, the system measures one or more metrics to characterize the first thread (operation 310). Then, the system uses the characterization of the first thread and a characterization for a second thread to predict a performance impact that would occur if the second thread were to simultaneously execute in a second processor core that is also associated with the cache (operation 320). If the predicted performance impact indicates that executing the second thread on the second processor core will improve performance for the multi-threaded processor (operation 330), the system executes the second thread on the second processor core (operation 340); otherwise, the process ends.
In some embodiments, the forecasting system includes a fuzzy rulebase to track data points and predict changes in the IPC of threads. For instance, the forecasting system may involve a linear combination of basis functions of the form
F ( x ) = i = 1 N p i w i ( x ) ,
where pi (where i=1 . . . , N) are tunable parameters that are adjusted in the course of learning, i is the number of rules, x is a k-dimensional vector of parameters, and wi(x) is a function which provides weights for the parameters. For instance, a function wi(x) may be of the form:
w i(x)=μ1 i(x 1)·μ2 i(x 2)· . . . ·μk i(x k),
where each function μj i(y) is a function on the domain of values for x. For example, for a given thread t in the preceding example (in FIG. 2), k=6, x1=APSt, x2=MPIt, x3=APScurrent-co-runner, x4=MPIcurrent-co-runner, x5=APSnew-candidate-co-runner, and x6=MPInew-candidate-co-runner. Given a set of values for all of the threads being considered, the forecasting system can plug the current metrics for the threads into the fuzzy rulebase to predict the total IPC change for a thread migration being considered.
In some embodiments, the forecasting system considers the total sum of the miss rates (e.g., the total MPS/MPI) for all threads as an estimate of overall stress in the system. The forecasting system may take the existing stress as an input, and then strive to predict scheduling changes that will result in a reduced stress, thereby maximizing the instruction throughput for the computing environment. In some embodiments, the forecasting system may also consider other factors, such as thread fairness and reducing power usage. For instance, the system may be configured to sometimes make scheduling changes that reduce the overall possible instruction throughput to ensure that a given thread is able to make progress.
Note that the parameters of the fuzzy rulebase can be tuned during operation of the forecasting system based on predicted and observed performance. For instance, the system may first use the fuzzy rulebase to make a set of predictions, and then, after making a thread-scheduling change: 1) compare the observed performance changes with the predicted performance changes, and 2) update the parameters of the fuzzy rulebase to more accurately reflect the observed performance changes. For example, a parameter may be updated using a formula such as:
P new =P old +α·E·W,
where the learning rate α, amount of error E, and weight W for the error are used to determine how much to adjust the value of the parameter (P) in response to an observed value that differs from the predicted value. Hence, parameters in the forecasting system can be updated after every data point (e.g., for every set of measured metrics) to configure and continuously adjust the statistical model of the system based on changes in behavior.
Note also that a wide range of other statistical techniques and models may be used to track data points and to predict changes in the IPC of threads. For instance, the forecasting system may also make use of neural network techniques.
In some embodiments, training the forecasting system involves using one or more data-gathering techniques to gather data points for thread metrics, characterizations, and interactions. Note that the data-gathering techniques, and the number of initial data points needed, may vary based on factors such as the computing environment, application characteristics, and administrator preferences. For instance, one data-gathering technique may quickly generate data points by periodically (e.g., every second) re-shuffling groups of threads. Such a forced migration may introduce some additional system overhead, but also allows the forecasting system to quickly build a model of thread metrics and characterizations and to begin making beneficial scheduling predictions. Alternatively, the system may gather data more slowly (and with lower overhead) during normal execution (e.g., based on normal non-predictive scheduling, start, stop, and migration of threads). Note that thread data can be gathered in parallel (for multiple threads at once) or sequentially, as desired. In some embodiments, the system may passively gather data for an initial interval, and then begin predictive scheduling when a threshold of data has been gathered. For instance, the system may first initiate a series of forced migrations until a certain number of data points have been gathered (e.g., 100 data points), and then begin cache-aware scheduling using predictions. Alternatively, the system may already use predictions even during initial training. In this scenario, the predictions may initially be somewhat rough and/or erroneous, but become more tuned and beneficial as more data is gathered.
One example involves training and using a forecasting system that includes a fuzzy rulebase to make scheduling decisions for a four-core processor that can simultaneously execute four threads. In this processor, the four processor cores are split into two pairs of cores, with each pair sharing a separate cache. The forecasting system can gather data by:
    • 1. Running three different combinations of four threads for one second each, while recording the MPS, APS, and change in IPS for each thread.
    • 2. Training the fuzzy rulebase using the gathered data to predict the percentage change in the IPS of a thread based on the six input variables described above.
    • 3. For a testing phase, deploying four new benchmark threads (or keeping the same threads that were used during training)
    • 4. Running the new set of threads for one second and then measuring their MPS, APS, and IPS.
    • 5. Using the trained fuzzy rulebase to perform a migration that is predicted to maximize the average IPS for the four threads (e.g., using the measured absolute IPS value and predicting the percentage change in IPSs for any particular thread migration).
    • 6. Measuring the new values of MPS, APS, and IPS for the threads, and tuning the statistical model as needed based on the observed values.
    • 7. Performing additional thread migrations if the fuzzy rulebase predicts that such migrations will increase the average IPS for the four threads.
    • 8. Repeating steps 6 and 7 until the statistical model cannot find any migrations that are predicted to increase the average IPS for the four threads.
Consider for the example of the previous paragraph two threads (threads 1 and 2) that are both cache-intensive and cache-sensitive, and two other threads that are cache-intensive but cache-insensitive (threads 3 and 4). All four threads access their respective caches frequently, but threads 1 and 2 tend to re-use cached data, while threads 3 and 4 tend to access new data, and hence cause relatively more memory contention. In such a situation, it may not be clear what the best scheduling strategy would be. For instance, in the absence of a forecasting system, one heuristic might be to equalize the cache miss rate for the two caches by separating the two cache-insensitive threads (e.g., by pairing threads 1 and 3 on a first cache, and threads 2 and 4 on a second cache). Such a grouping may lead to improved performance if cache- sensitive threads 1 and 2 are able to access a small set of needed blocks sufficiently frequently to keep such blocks pinned in their caches (e.g., via an LRU cache replacement strategy), and the rest of the cache spaces are available to cache- insensitive threads 3 and 4. However, if the cached data of threads 1 and 2 is frequently displaced, their instruction throughput could drop dramatically. Thus, an alternate heuristic might group threads 1 and 2 together to share a cache, with threads 3 and 4 sharing the second cache. However, such a grouping might also lead to problems if the combined working sets of threads 1 and 2 interfere with each other (e.g., displace each other from their shared cache). Another general factor to consider is that a high level of contention for the memory bus may lead to a saturation of the memory bus that causes a non-linear decrease in performance.
The described forecasting system can gather metric data for all four threads, and then use historical metric and interaction data to find a good balance for the specific blend of threads and hardware that are present. More specifically, the forecasting system can gather data for different degrees of cache intensity and cache sensitivity, and use this data to formulate a beneficial scheduling prediction that maximizes the total instruction throughput for all four threads. For example, the forecasting system may determine from the available data that grouping two moderately cache-intensive threads together is beneficial, but that grouping two highly cache-intensive threads together should be avoided due to an associated predicted decline in performance.
Note that the inputs to the forecasting system are not specific thread or application identifiers, but are instead general thread characteristics (e.g., IPC, MPC, APC). Because the statistical model that maps thread characteristics to predicted performance changes is purely based on miss rate and access rate, the general prediction principle is application-independent (e.g., operates only using such miss rates, and independent of any application-specific identifiers). The characteristics of a thread may change over time due to changes in workload or other factors (e.g., changes in applications, user patterns, and/or time-of-day behavior), but such changes are simply measured and then input into the forecasting system as additional data points. Hence, the described system is self-managing, and detects and adjusts to changes in an “online” manner (e.g., during operation, without involving a preceding, offline set of profiling runs). Note also that the described techniques can be scaled to arbitrary numbers of threads (e.g., all of the threads in a server, cluster, etc.), unlike other scheduling heuristics that attempt to sample different thread schedules before arriving at scheduling decisions. In other words, the preceding example can be extended to N threads running on N cores, and then extended to K threads running on N cores, with the forecasting system gathering and benefiting from metrics and characterization data that is gathered for all of those threads.
In some embodiments, the system maintains a running average of MPS/MPI and APS/API values. For instance, the system may measure the miss rate and access rate every second, but update the parameters estimating MPS and APS for a thread using formulas such as:
MPSnew=α·MPSt+(1−α)·MPSprevious and
APSnew=α·APSt+(1−α)·APSprevious,
where MPSprevious and APSprevious are the values used in the previous time interval, MPSt and APSt are the currently measured values, α is a scalar that determines the weight of historical values, and MPSnew and APSnew are the new values for the metrics that will be used for the thread in the forecasting system in the current time interval. Carrying some amount of history in these parameters facilitates smoothing out fluctuations in the cache and access miss rates.
Note that the forecasting system can typically use existing processor hardware counters to gather measured values. For instance, an operating system command may be available to start tracking for processes and return measured values (e.g., a “cpuTrack” command that takes an interval setting, and returns the values of the hardware counters). In some embodiments, the system may use other hardware and/or software counters instead of (and/or in addition to) MPI, API, and IPC as inputs to the forecasting system.
Note also that a number of system entities could be configured to include the forecasting system and to manage thread scheduling and migrations. For instance, aspects of the forecasting system might be included in the operating system kernel, scheduler, and/or in a customized user-level process. Some or all aspects of the forecasting system may also be implemented using additional processor hardware.
In some embodiments, the described techniques can be applied to systems in which each processor core can simultaneously execute more than two threads. For instance, in some embodiments, the described techniques may collect MPI, API, and IPC information from two or more co-runner threads in a processor core, and then average these metrics over the co-runners. In some embodiments, the described techniques may also be applied to systems with more than two cores. In an architecture where more than two cores are present, the described techniques may additionally involve choosing two cores between which possible migrations should be evaluated (e.g., by choosing cores randomly, or by sequentially choosing all cores and considering only their neighboring cores for possible migrations).
In summary, embodiments of the present invention involve techniques for predicting thread combinations that will improve the performance of a CMT processor. An automated rule-based forecasting system learns how to predict the performance degradation in the measured instruction throughput of two threads when they are scheduled on processor cores that share a common resource. The forecasting system then uses such cache-aware predictions to schedule threads into beneficial groupings, thereby improving the overall instruction throughput for the computing environment.
Computing Environment
In some embodiments of the present invention, cache-aware techniques for predicting thread combinations that will improve performance can be incorporated into a wide range of computing devices in a computing environment.
FIG. 4 illustrates a computing environment 400 in accordance with an embodiment of the present invention. Computing environment 400 includes a number of computer systems, which can generally include any type of computer system based on a microprocessor, a mainframe computer, a digital signal processor, a portable computing device, a personal organizer, a device controller, or a computational engine within an appliance. More specifically, referring to FIG. 4, computing environment 400 includes clients 410-412, users 420 and 421, servers 430-450, network 460, database 470, devices 480, and appliance 490.
Clients 410-412 can include any node on a network that includes computational capability and includes a mechanism for communicating across the network. Additionally, clients 410-412 may comprise a tier in an n-tier application architecture, wherein clients 410-412 perform as servers (servicing requests from lower tiers or users), and wherein clients 410-412 perform as clients (forwarding the requests to a higher tier).
Similarly, servers 430-450 can generally include any node on a network including a mechanism for servicing requests from a client for computational and/or data storage resources. Servers 430-450 can participate in an advanced computing cluster, or can act as stand-alone servers. For instance, computing environment 400 can include a large number of compute nodes that are organized into a computing cluster and/or server farm. In one embodiment of the present invention, server 440 is an online “hot spare” of server 450.
Users 420 and 421 can include: an individual; a group of individuals; an organization; a group of organizations; a computing system; a group of computing systems; or any other entity that can interact with computing environment 400.
Network 460 can include any type of wired or wireless communication channel capable of coupling together computing nodes. This includes, but is not limited to, a local area network, a wide area network, or a combination of networks. In one embodiment of the present invention, network 460 includes the Internet. In some embodiments of the present invention, network 460 includes phone and cellular phone networks.
Database 470 can include any type of system for storing data in non-volatile storage. This includes, but is not limited to, systems based upon magnetic, optical, or magneto-optical storage devices, as well as storage devices based on flash memory and/or battery-backed up memory. Note that database 470 can be coupled: to a server (such as server 450), to a client, or directly to a network. In some embodiments of the present invention, database 470 is used to store information related to virtual machines and/or guest programs. Alternatively, other entities in computing environment 400 may also store such data (e.g., servers 430-450).
Devices 480 can include any type of electronic device that can be coupled to a client, such as client 412. This includes, but is not limited to, cell phones, personal digital assistants (PDAs), smart-phones, personal music players (such as MP3 players), gaming systems, digital cameras, portable storage media, or any other device that can be coupled to the client. Note that, in some embodiments of the present invention, devices 480 can be coupled directly to network 460 and can function in the same manner as clients 410-412.
Appliance 490 can include any type of appliance that can be coupled to network 460. This includes, but is not limited to, routers, switches, load balancers, network accelerators, and specialty processors. Appliance 490 may act as a gateway, a proxy, or a translator between server 440 and network 460.
Note that different embodiments of the present invention may use different system configurations, and are not limited to the system configuration illustrated in computing environment 400. In general, any device that is capable of storing and/or dynamically replicating data segments may incorporate elements of the present invention.
FIG. 5 illustrates an exemplary computing device 500 that includes a multi-threaded processor 502 and memory 504. Multi-threaded processor 502 includes a first processor core 506, a second processor core 508, and a cache 510 associated with the two processor cores (506-508). Processor 502 also includes measurement mechanism 512, prediction mechanism 514, and scheduling mechanism 516. Processor 502 uses measurement mechanism 512, prediction mechanism 514, and scheduling mechanism 516 to perform predictive, cache-aware thread scheduling.
During operation, processor 502 uses measurement mechanism 512 to measure one or more metrics to characterize a first thread executing in processor core 506. Processor 502 then invokes prediction mechanism 514, which uses the characterization of the first thread and a characterization of a second thread to predict a performance impact associated with simultaneously executing the second thread in processor core 508 (or in processor core 506, if processor core 506 is able to execute multiple threads simultaneously). If the predicted performance impact indicates that executing the second thread on the second processor will improve performance, processor 502 then uses scheduling mechanism 516 to simultaneously execute the second thread on processor core 508 (or on processor core 506, as described above).
In some embodiments of the present invention, some or all aspects of measurement mechanism 512, prediction mechanism 514, and/or scheduling mechanism 516 can be implemented as dedicated hardware modules in processor 502. For example, processor 502 can include one or more specialized circuits for performing the operations of the mechanisms. Alternatively, some or all of the operations of measurement mechanism 512, prediction mechanism 514, and/or scheduling mechanism 516 may be performed using general-purpose circuits in processor 502 that are configured using processor instructions.
Although FIG. 5 illustrates measurement mechanism 512, prediction mechanism 514, and/or scheduling mechanism 516 as being included in processor 502, in alternative embodiments some or all of these mechanisms are external to processor 502. For instance, these mechanisms may be incorporated into hardware modules external to processor 502. These hardware modules can include, but are not limited to, processor chips, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), memory chips, and other programmable-logic devices now known or later developed.
In these embodiments, when the external hardware modules are activated, the hardware modules perform the methods and processes included within the hardware modules. For example, in some embodiments of the present invention, the hardware module includes one or more dedicated circuits for performing the operations described below. As another example, in some embodiments of the present invention, the hardware module is a general-purpose computational circuit (e.g., a microprocessor or an ASIC), and when the hardware module is activated, the hardware module executes program code (e.g., BIOS, firmware, etc.) that configures the general-purpose circuits to perform the operations described above.
The foregoing descriptions of various embodiments have been presented only for purposes of illustration and description. They are not intended to be exhaustive or to limit the present invention to the forms disclosed. Accordingly, many modifications and variations will be apparent to practitioners skilled in the art. Additionally, the above disclosure is not intended to limit the present invention.

Claims (19)

What is claimed is:
1. A method for predictively scheduling a thread in a multi-threaded processor, comprising:
executing a first thread in a processor core associated with a shared cache that is also associated with a second processor core;
executing a second thread in a third processor core which is not associated with the cache;
executing a third thread in the second processor core;
while executing the first thread, measuring one or more metrics to characterize the first thread;
measuring one or more metrics to characterize the second thread;
measuring one or more metrics to characterize the third thread;
using the characterization of the first thread and a characterization of a second thread to predict a performance impact associated with simultaneously executing the second thread in a second processor core which is associated with the cache, wherein predicting the performance impact comprises predicting an impact in an execution metric for the first thread and an impact in an execution metric for the second thread while the first thread and the second thread access the shared cache when simultaneously executing, and wherein predicting the performance impact involves using the characterization of the third thread and the characterization of the second thread in addition to the characterization of the first thread to determine whether migrating the second thread to the second processor core will improve performance for the multi-threaded processor; and
when the predicted performance impact indicates that executing the second thread on the second processor core will improve performance for the multi-threaded processor, executing the second thread on the second processor core.
2. The method of claim 1, wherein measuring one or more metrics includes measuring one or more of the following over a time interval:
the number of cycles elapsed per second for the processor core or the second processor core;
the average instructions executed per second by a given thread;
the average cache accesses per second for the given thread; and
the average cache misses per second for the given thread.
3. The method of claim 2, wherein characterizing the given thread involves using the measured metrics to determine whether the given thread is one or more of the following:
cache-intensive;
cache-sensitive; and
cache-insensitive.
4. The method of claim 2, wherein predicting the performance impact involves predicting a degradation in the average instructions executed per second for one or more of the following:
the first thread;
the second thread; and
the third thread.
5. The method of claim 4, where the method further comprises gathering data for thread characteristics and associated performance impacts by performing one or more of the following:
periodically migrating one or more threads between processor cores of the multi-threaded processor; and
opportunistically gathering data during normal multi-threaded execution in the multi-threaded processor.
6. The method of claim 5, wherein the method uses online thread characteristic and performance data to facilitate scheduling threads across processor cores.
7. The method of claim 5, wherein the method facilitates application-independent scheduling techniques that are self-managing across changing data sets, changing data access patterns, and changing user requests.
8. The method of claim 5, wherein the method further comprises:
using the gathered data as inputs to a forecasting system; and
using the forecasting system to predict the performance impact.
9. The method of claim 8, wherein the method further comprises using statistical feedback from measured metrics, thread characteristics and thread interactions to update a parameter of the forecasting system.
10. The method of claim 1, wherein improving performance for the chip multi-threaded processor involves one or more of the following:
improving the overall instruction throughput for the chip multi-threaded processor; and
reducing the power consumed by the chip multi-threaded processor while executing the threads.
11. The method of claim 1, wherein the execution metric for the first thread comprises instructions per cycle for the first thread and the execution metric for the second thread comprises instructions per cycle for the second thread.
12. The method of claim 1, wherein a processor core of the multi-threaded processor can execute multiple threads simultaneously; and
wherein the processor core and the second processor core are a single processor core that can simultaneously execute both the first thread and the second thread.
13. A non-transitory computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for predictively scheduling a thread in a multi-threaded processor, the method comprising:
executing a first thread in a processor core associated with a shared cache that is also associated with a second processor core;
executing a second thread in a third processor core which is not associated with the cache;
executing a third thread in the second processor core;
while executing the first thread, measuring one or more metrics to characterize the first thread;
measuring one or more metrics to characterize the second thread;
measuring one or more metrics to characterize the third thread;
using the characterization of the first thread and a characterization of a second thread to predict a performance impact associated with simultaneously executing the second thread in a second processor core which is associated with the cache, wherein predicting the performance impact comprises predicting an impact in an execution metric for the first thread and an impact in an execution metric for the second thread while the first thread and the second thread access the shared cache when simultaneously executing, and wherein predicting the performance impact involves using the characterization of the third thread and the characterization of the second thread in addition to the characterization of the first thread to determine whether migrating the second thread to the second processor core will improve performance for the multi-threaded processor; and
when the predicted performance impact indicates that executing the second thread on the second processor core will improve performance for the multi-threaded processor, executing the second thread on the second processor core.
14. The non-transitory computer-readable storage medium of claim 13, wherein measuring one or more metrics includes measuring one or more of the following over a time interval:
the number of cycles elapsed per second for the processor core or the second processor core;
the average instructions executed per second by a given thread;
the average cache accesses per second for the given thread; and
the average cache misses per second for the given thread.
15. The non-transitory computer-readable storage medium of claim 14, wherein characterizing the given thread involves using the measured metrics to determine whether the thread is one or more of the following:
cache-intensive;
cache-sensitive; and
cache-insensitive.
16. The non-transitory computer-readable storage medium of claim 15, wherein predicting the performance impact involves predicting a degradation in the average instructions executed per second for one or more of the following:
the first thread;
the second thread; and
the third thread.
17. The non-transitory computer-readable storage medium of claim 16, where the method further comprises gathering data for thread characteristics and associated performance impacts by performing one or more of the following:
periodically migrating one or more threads between processor cores of the multi-threaded processor; and
opportunistically gathering data during normal multi-threaded execution in the multi-threaded processor.
18. The non-transitory computer-readable storage medium of claim 17, wherein the method further comprises:
using the gathered data as inputs to a forecasting system; and
using the forecasting system to predict the performance impact.
19. A multi-threaded processor that facilitates predictive thread scheduling, comprising:
a first processor core;
a second processor core;
a third processor core which is not associated with the cache;
a first cache associated with the first processor core and the second processor core;
a measurement mechanism that is configured to measure one or more metrics to characterize a first thread executing in the first processor core, one or more metrics to characterize the second thread, and one or more metrics to characterize the third thread;
a prediction mechanism that is configured to use the characterization of the first thread and a characterization of a second thread to predict a performance impact associated with simultaneously executing the second thread in the second processor core, wherein, while predicting the performance impact, the prediction mechanism is further configured to predict an impact in an execution metric for the first thread and an impact in an execution metric for the second thread while the first thread and the second thread access the shared cache when simultaneously executing, and wherein, while predicting the performance impact, the prediction mechanism is configured to use the characterization of the third thread and the characterization of the second thread in addition to the characterization of the first thread to determine whether migrating the second thread to the second processor core will improve performance for the multi-threaded processor; and
a scheduling mechanism that is configured to execute the second thread on the second processor core when the predicted performance impact indicates that executing the second thread on the second processor will improve performance for the multi-threaded processor.
US12/754,143 2010-04-05 2010-04-05 Cache-aware thread scheduling in multi-threaded systems Active 2031-04-25 US8533719B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US12/754,143 US8533719B2 (en) 2010-04-05 2010-04-05 Cache-aware thread scheduling in multi-threaded systems

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US12/754,143 US8533719B2 (en) 2010-04-05 2010-04-05 Cache-aware thread scheduling in multi-threaded systems

Publications (2)

Publication Number Publication Date
US20110246995A1 US20110246995A1 (en) 2011-10-06
US8533719B2 true US8533719B2 (en) 2013-09-10

Family

ID=44711140

Family Applications (1)

Application Number Title Priority Date Filing Date
US12/754,143 Active 2031-04-25 US8533719B2 (en) 2010-04-05 2010-04-05 Cache-aware thread scheduling in multi-threaded systems

Country Status (1)

Country Link
US (1) US8533719B2 (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110289097A1 (en) * 2010-05-20 2011-11-24 Salesforce.Com, Inc. Metrics-based accessing of social threads
US20120185709A1 (en) * 2011-12-15 2012-07-19 Eliezer Weissmann Method, apparatus, and system for energy efficiency and energy conservation including thread consolidation
US8818985B2 (en) 2010-04-06 2014-08-26 Salesforce.Com, Inc. Rule-based prioritization of social data
US8892573B2 (en) 2010-09-23 2014-11-18 Salesforce.Com, Inc. Methods and apparatus for selecting updates to associated records to publish on an information feed in an on-demand database service environment
US9135063B1 (en) 2009-07-21 2015-09-15 The Research Foundation For The State University Of New York Apparatus and method for efficient scheduling of tasks
US9208187B2 (en) 2011-06-24 2015-12-08 Salesforce.Com, Inc. Using a database system for selective inclusion and exclusion of types of updates to provide a configuration feed of a social networking system
US9443224B2 (en) 2011-03-01 2016-09-13 Salesforce.Com, Inc. Systems, apparatus and methods for selecting updates to associated records to publish on an information feed
US9443225B2 (en) 2011-07-18 2016-09-13 Salesforce.Com, Inc. Computer implemented methods and apparatus for presentation of feed items in an information feed to be displayed on a display device
US9471398B2 (en) 2014-10-03 2016-10-18 International Business Machines Corporation Global lock contention predictor
US20170212824A1 (en) * 2016-01-21 2017-07-27 International Business Machines Corporation Dynamic tuning of a simultaneous multithreading metering architecture
US9817637B2 (en) 2010-07-01 2017-11-14 Salesforce.Com, Inc. Methods and systems for providing enhancements to a business networking feed
US20190102221A1 (en) * 2017-09-29 2019-04-04 Intel Corporation Thread scheduling using processing engine information
US10289306B1 (en) * 2018-01-31 2019-05-14 EMC IP Holding Company LLC Data storage system with core-affined thread processing of data movement requests
US11954492B1 (en) 2022-09-19 2024-04-09 Apple Inc. Fence enforcement techniques based on stall characteristics

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012014313A1 (en) * 2010-07-30 2012-02-02 富士通株式会社 Multi-core processor system, thread control method, and thread control program
US9268542B1 (en) * 2011-04-28 2016-02-23 Google Inc. Cache contention management on a multicore processor based on the degree of contention exceeding a threshold
US9032156B2 (en) * 2011-07-06 2015-05-12 Advanced Micro Devices, Inc. Memory access monitor
US8996350B1 (en) 2011-11-02 2015-03-31 Dub Software Group, Inc. System and method for automatic document management
US9055086B2 (en) * 2011-12-28 2015-06-09 Alcatel Lucent System and method for managing data transfer from a data center including bandwidth limits and a flex parameter indicating bandwidth variation between data transfer periods
US9003218B2 (en) * 2012-05-21 2015-04-07 International Business Machines Corporation Power shifting in multicore platforms by varying SMT levels
US20170358017A1 (en) * 2012-06-26 2017-12-14 Google Inc. Price breaks in a cloud computing system for using an automatic scheduler
US9582287B2 (en) 2012-09-27 2017-02-28 Intel Corporation Processor having multiple cores, shared core extension logic, and shared core extension utilization instructions
CN103729248B (en) * 2012-10-16 2017-12-15 华为技术有限公司 A kind of method and apparatus of determination based on cache perception task to be migrated
US9268609B2 (en) * 2013-04-30 2016-02-23 Hewlett Packard Enterprise Development Lp Application thread to cache assignment
KR101553649B1 (en) * 2013-05-13 2015-09-16 삼성전자 주식회사 Multicore apparatus and job scheduling method thereof
GB2521155B (en) * 2013-12-10 2021-06-02 Advanced Risc Mach Ltd Configuring thread scheduling on a multi-threaded data processing apparatus
US9614779B2 (en) * 2013-12-24 2017-04-04 Intel Corporation Cloud compute scheduling using a heuristic contention model
EP3111333B1 (en) * 2014-02-27 2022-03-30 Mercury Kingdom Assets Limited Thread and data assignment in multi-core processors
US9384027B2 (en) * 2014-06-06 2016-07-05 International Business Machines Corporation Selecting a host for a virtual machine using a hardware multithreading parameter
US9400672B2 (en) * 2014-06-06 2016-07-26 International Business Machines Corporation Placement of virtual CPUS using a hardware multithreading parameter
US9304805B2 (en) * 2014-06-06 2016-04-05 Interinational Business Machines Corporation Provisioning virtual CPUs using a hardware multithreading parameter in hosts with split core processors
US10339023B2 (en) * 2014-09-25 2019-07-02 Intel Corporation Cache-aware adaptive thread scheduling and migration
US9588863B2 (en) * 2014-10-21 2017-03-07 International Business Machines Corporation Generation and application of stressmarks in a computer system
US10079779B2 (en) * 2015-01-30 2018-09-18 Nicira, Inc. Implementing logical router uplinks
US9942631B2 (en) 2015-09-25 2018-04-10 Intel Corporation Out-of-band platform tuning and configuration
WO2018021620A1 (en) * 2016-07-26 2018-02-01 주식회사 맴레이 Parallel processing unit, computing device comprising same, and thread group scheduling method
WO2018068809A1 (en) * 2016-10-10 2018-04-19 Telefonaktiebolaget Lm Ericsson (Publ) Task scheduling
US10303575B2 (en) 2017-01-10 2019-05-28 International Business Machines Corporation Time-slice-instrumentation facility
US10599481B2 (en) * 2017-06-04 2020-03-24 Apple Inc. Scheduler for amp architecture using a closed loop performance controller and deferred inter-processor interrupts
CN111045814B (en) 2018-10-11 2023-12-08 华为技术有限公司 Resource scheduling method and terminal equipment
US11693708B2 (en) * 2019-04-24 2023-07-04 Netflix, Inc. Techniques for increasing the isolation of workloads within a multiprocessor instance
US11429525B2 (en) * 2019-05-31 2022-08-30 Netflix, Inc. Reducing cache interference based on forecasted processor use
CN111831414A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Thread migration method and device, storage medium and electronic equipment
CN117785484A (en) * 2024-02-26 2024-03-29 北京卡普拉科技有限公司 Shared Cache resource allocation method, system, computer equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080195849A1 (en) * 2007-02-14 2008-08-14 Antonio Gonzalez Cache sharing based thread control
US20100095300A1 (en) * 2008-10-14 2010-04-15 Vmware, Inc. Online Computation of Cache Occupancy and Performance

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080195849A1 (en) * 2007-02-14 2008-08-14 Antonio Gonzalez Cache sharing based thread control
US20100095300A1 (en) * 2008-10-14 2010-04-15 Vmware, Inc. Online Computation of Cache Occupancy and Performance

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Snavely, Allan et al., "Symbiotic Jobscheduling for a Simultaneous Multithreading Processor", Published in the Proceedings of ASPLOX IX, Nov. 2000.

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9715264B2 (en) 2009-07-21 2017-07-25 The Research Foundation Of The State University Of New York System and method for activation of a plurality of servers in dependence on workload trend
US11886914B1 (en) 2009-07-21 2024-01-30 The Research Foundation For The State University Of New York Energy efficient scheduling for computing systems and method therefor
US11429177B2 (en) 2009-07-21 2022-08-30 The Research Foundation For The State University Of New York Energy-efficient global scheduler and scheduling method for managing a plurality of racks
US11194353B1 (en) 2009-07-21 2021-12-07 The Research Foundation for the State University Energy aware processing load distribution system and method
US9135063B1 (en) 2009-07-21 2015-09-15 The Research Foundation For The State University Of New York Apparatus and method for efficient scheduling of tasks
US10289185B2 (en) 2009-07-21 2019-05-14 The Research Foundation For The State University Of New York Apparatus and method for efficient estimation of the energy dissipation of processor based systems
US9377837B2 (en) 2009-07-21 2016-06-28 The Research Foundation For The State University Of New York Apparatus and method for efficient scheduling of tasks
US9753465B1 (en) 2009-07-21 2017-09-05 The Research Foundation For The State University Of New York Energy aware processing load distribution system and method
US8818985B2 (en) 2010-04-06 2014-08-26 Salesforce.Com, Inc. Rule-based prioritization of social data
US8738603B2 (en) * 2010-05-20 2014-05-27 Salesforce.Com, Inc. Metrics-based accessing of social threads
US20110289097A1 (en) * 2010-05-20 2011-11-24 Salesforce.Com, Inc. Metrics-based accessing of social threads
US9817637B2 (en) 2010-07-01 2017-11-14 Salesforce.Com, Inc. Methods and systems for providing enhancements to a business networking feed
US8892573B2 (en) 2010-09-23 2014-11-18 Salesforce.Com, Inc. Methods and apparatus for selecting updates to associated records to publish on an information feed in an on-demand database service environment
US9443224B2 (en) 2011-03-01 2016-09-13 Salesforce.Com, Inc. Systems, apparatus and methods for selecting updates to associated records to publish on an information feed
US9659049B2 (en) 2011-06-24 2017-05-23 Salesforce.Com, Inc. Creating and managing granular relationships on an online social network
US9208187B2 (en) 2011-06-24 2015-12-08 Salesforce.Com, Inc. Using a database system for selective inclusion and exclusion of types of updates to provide a configuration feed of a social networking system
US9443225B2 (en) 2011-07-18 2016-09-13 Salesforce.Com, Inc. Computer implemented methods and apparatus for presentation of feed items in an information feed to be displayed on a display device
US9075610B2 (en) * 2011-12-15 2015-07-07 Intel Corporation Method, apparatus, and system for energy efficiency and energy conservation including thread consolidation
US20120185709A1 (en) * 2011-12-15 2012-07-19 Eliezer Weissmann Method, apparatus, and system for energy efficiency and energy conservation including thread consolidation
US9471398B2 (en) 2014-10-03 2016-10-18 International Business Machines Corporation Global lock contention predictor
US9471397B2 (en) 2014-10-03 2016-10-18 International Business Machines Corporation Global lock contention predictor
US20170212824A1 (en) * 2016-01-21 2017-07-27 International Business Machines Corporation Dynamic tuning of a simultaneous multithreading metering architecture
US20170212786A1 (en) * 2016-01-21 2017-07-27 International Business Machines Corporation Dynamic tuning of a simultaneous multithreading metering architecture
US10545793B2 (en) * 2017-09-29 2020-01-28 Intel Corporation Thread scheduling using processing engine information
US20190102221A1 (en) * 2017-09-29 2019-04-04 Intel Corporation Thread scheduling using processing engine information
US10289306B1 (en) * 2018-01-31 2019-05-14 EMC IP Holding Company LLC Data storage system with core-affined thread processing of data movement requests
US11954492B1 (en) 2022-09-19 2024-04-09 Apple Inc. Fence enforcement techniques based on stall characteristics

Also Published As

Publication number Publication date
US20110246995A1 (en) 2011-10-06

Similar Documents

Publication Publication Date Title
US8533719B2 (en) Cache-aware thread scheduling in multi-threaded systems
CN110869909B (en) System and method for applying machine learning algorithms to calculate health scores for workload scheduling
Ismaeel et al. Proactive dynamic virtual-machine consolidation for energy conservation in cloud data centres
Chen et al. Distributed autonomous virtual resource management in datacenters using finite-markov decision process
US10355966B2 (en) Managing variations among nodes in parallel system frameworks
Manousis et al. Contention-aware performance prediction for virtualized network functions
Chen et al. RIAL: Resource intensity aware load balancing in clouds
US8046468B2 (en) Process demand prediction for distributed power and resource management
US10346208B2 (en) Selecting one of plural layouts of virtual machines on physical machines
JP6193393B2 (en) Power optimization for distributed computing systems
Deng et al. Reliability‐aware server consolidation for balancing energy‐lifetime tradeoff in virtualized cloud datacenters
Jeon et al. TPC: Target-driven parallelism combining prediction and correction to reduce tail latency in interactive services
Pahlevan et al. Integrating heuristic and machine-learning methods for efficient virtual machine allocation in data centers
Liu et al. CORP: Cooperative opportunistic resource provisioning for short-lived jobs in cloud systems
US11609784B2 (en) Method for distributing a computational process, workload distribution device and system for distributing a computational process
Magotra et al. Adaptive computational solutions to energy efficiency in cloud computing environment using VM consolidation
Rojek et al. Energy‐aware mechanism for stencil‐based MPDATA algorithm with constraints
Rameshan et al. Augmenting elasticity controllers for improved accuracy
CN116909378A (en) Deep reinforcement learning-based GPU dynamic energy efficiency optimization runtime method and system
KR102062332B1 (en) An Memory Bandwidth Management Method and Apparatus for Latency-sensitive Workload
Singh et al. Towards VM consolidation using a hierarchy of idle states
US11288179B2 (en) Co-operative memory management system
Angelou et al. Improving virtual host efficiency through resource and interference aware scheduling
US20220326999A1 (en) Dynamic resource allocation based on quality-of-service prediction
US20240028389A1 (en) Memory aware context switching

Legal Events

Date Code Title Description
AS Assignment

Owner name: ORACLE INTERNATIONAL CORPORATION, CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:FEDOROVA, ALEXANDRA;VENGEROV, DAVID;PUSUKURI, KISHORE KUMAR;SIGNING DATES FROM 20100401 TO 20100402;REEL/FRAME:024340/0708

FEPP Fee payment procedure

Free format text: PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

STCF Information on status: patent grant

Free format text: PATENTED CASE

CC Certificate of correction
FPAY Fee payment

Year of fee payment: 4

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 8TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1552); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Year of fee payment: 8