VCPU Thread Affinity Scheduling for Stable Hyper-Threaded VMs
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Cloud computing scenarios face performance jitter issues due to VCPU threads running on different physical processors, leading to unstable performance in overcommitted instances, particularly when hyper-threading is enabled.
Innovation Solution
Implement a method and apparatus that determine processor affinity for VCPU threads to ensure they run on the same hyper-threading logical processors, using a load balancing scheduler to adjust thread scheduling and prevent interference by waking up idle threads to preempt logical processors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If VCPU threads are scheduled on different physical processors to improve resource utilization, then productivity increases, but performance stability deteriorates due to hyper-threading interference
Solution Approach 1:
The patent segments the virtual processor's VCPU threads and assigns them to specific hyper-threading logical processors on the same physical processor. By dividing the scheduling domain from physical processors to hyper-threading logical processors, the system maintains resource utilization while ensuring performance stability through controlled segmentation of thread placement.
Solution Approach 2:
The patent merges the scheduling of multiple VCPU threads to the same physical processor by utilizing hyper-threading logical processors. Instead of distributing threads across different physical processors, it combines them on one physical processor using separate logical processors, thereby maintaining both resource utilization and performance stability.
2Productivity
If hyper-threading is enabled to increase computing capacity, then productivity improves, but performance interference increases between VCPU threads
Solution Approach 1:
The patent applies local quality by assigning specific characteristics to different hyper-threading logical processors within the same physical processor. Each VCPU thread is bound to a specific logical processor with dedicated resources, creating localized quality differences that reduce interference while maintaining the benefits of hyper-threading for increased computing capacity.
3Reliability
If VCPU threads are bound to different physical processors to reduce interference, then performance stability improves, but resource utilization deteriorates
Solution Approach 1:
The patent introduces a new scheduling dimension by utilizing hyper-threading logical processors as an intermediate layer between VCPU threads and physical processors. This dimensional change allows multiple VCPU threads to coexist on the same physical processor without direct interference, thereby maintaining resource utilization while ensuring performance stability through the additional scheduling layer.
Data Source
AI summary
Embodiments of the present disclosure provide a method and an apparatus for scheduling a virtual machine thread includes: determining, by a load balancing scheduler, processor affinity of a first virtual central processing unit (VCPU) thread on a virtual processor of a virtual machine in response to receiving a scheduling instruction for the first VCPU thread; determining, based on the processor affinity of the first VCPU thread, a second hyper-threading logical processor in the target physical processor as processor affinity of a second VCPU thread in the virtual processor; scheduling, based on the processor affinity of the first VCPU thread, the first hyper-threading logical processor to run the first VCPU thread; and scheduling, based on the processor affinity of the second VCPU thread, the second hyper-threading logical processor to run the second VCPU thread.


