Thread Scheduling for SMT Processors
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The increased number of threads in simultaneous multi-threading (SMT) processors intensifies resource competition, leading to reduced parallelism and performance in shared resource utilization.
Innovation Solution
A method and apparatus for thread scheduling that involves acquiring occupancy and reservation quantities of object resources for multiple threads, selecting a target thread based on scheduling conditions, and using algorithms like LRU, LFU, or RH to arbitrate resource allocation, ensuring fairness and reducing resource conflicts.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the number of threads in SMT processors is increased, then the utilization rate of hardware resources is improved, but the resource competition between threads intensifies leading to reduced parallelism
Solution Approach 1:
The patent implements dynamic thread scheduling by continuously monitoring resource occupancy and reservation quantities, and adjusting thread selection based on current system state. The scheduler dynamically changes which threads receive resources at different times, transforming the static resource allocation into a dynamic adaptive process that responds to changing workload conditions
Solution Approach 2:
The patent changes the scheduling parameter from simple thread priority or round-robin timing to a composite metric based on resource occupancy quantity and reservation quantity. This parameter transformation allows the system to select threads that will cause minimal resource contention, thereby maintaining high resource utilization while reducing inter-thread competition
2Productivity
If more threads are scheduled simultaneously, then hardware resource utilization is improved, but thread starvation occurs reducing overall system robustness
Solution Approach 1:
The patent implements a feedback mechanism where the scheduler continuously monitors the resource occupancy quantity and reservation quantity of each thread, and uses this feedback information to adjust subsequent scheduling decisions. This closed-loop control ensures that threads which have consumed excessive resources are less likely to be selected again, preventing starvation and maintaining system robustness
Solution Approach 2:
The patent performs preliminary assessment of resource occupancy and reservation quantities before making scheduling decisions. By evaluating the potential impact of each thread on resource contention in advance, the system can proactively select threads that will maintain balanced resource distribution, preventing thread starvation before it occurs
Data Source
Figure 1
Figure 2~3
Figure 4~5
AI summary
Embodiments of the present disclosure provide a method and an apparatus for thread scheduling, a processor, and a computer-readable storage medium. The method for thread scheduling includes: acquiring a plurality of threads to be scheduled for object resources in a processor, and acquiring an occupancy quantity and a reservation quantity of the object resources for the plurality of the threads respectively and currently; and selecting a target thread satisfying a scheduling condition from the plurality of the threads for scheduling based on the occupancy quantity and the reservation quantity of the object resources for the plurality of the threads respectively and currently. The method and apparatus for thread scheduling, under the premise of ensuring the fairness of the plurality of threads, will not cause a certain thread starved, and improve the robustness of the overall design.