VCPU Thread Affinity Scheduling for Stable Hyper-Threaded VMs

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In cloud computing scenarios with hyper-threading enabled physical processors, the performance of virtual machines is unstable due to performance bursts and interference between VCPU threads running on different virtual processors.

Innovation Solution

A method and apparatus for scheduling virtual machine threads that ensure VCPU threads run on the same physical processor by determining processor affinity, using a load balancing scheduler to configure hyper-threading logical processors, and managing thread operations to prevent interference.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If hyper-threading is turned on to improve physical processor throughput, then computing performance increases from X to 1.3X, but virtual machine performance stability deteriorates due to performance bursts and interference between VCPU threads

Engineering Contradiction:
Improvecomputing performanceVSAvoidvirtual machine performance stability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent segments the virtual processor's VCPU threads and assigns them to different scheduling domains based on their workloads. By dividing the scheduling into multiple domains (e.g., real-time domain, best-effort domain) and applying different scheduling policies to each, the system can manage hyper-threading resources more granularly, preventing performance bursts while maintaining overall productivity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies different scheduling qualities to different VCPU threads based on their specific requirements. High-priority threads receive guaranteed scheduling slots with strict timing, while lower-priority threads utilize available hyper-threading resources flexibly. This local differentiation of scheduling quality allows the system to maintain stability for critical threads while still achieving performance improvement through hyper-threading for non-critical threads.

Inventive Principle:
Principle #3Local quality

2Productivity

If multiple VCPU threads are scheduled on different physical processors to maximize resource utilization, then productivity increases, but performance stability deteriorates due to interference between threads running on different processors

Engineering Contradiction:
Improveresource utilizationVSAvoidperformance stability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent merges VCPU threads that require coordinated execution onto the same physical processor core or hyper-threading pair. By combining related threads into a tight scheduling group, the system ensures they execute on the same processor, eliminating inter-processor communication overhead and preventing performance bursts caused by asynchronous execution across different processors.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent introduces a scheduling domain as an intermediary layer between the virtual processor and physical processors. This domain acts as a mediator that manages the mapping between VCPU threads and physical cores, ensuring that threads requiring coordination are assigned to the same processor while still allowing overall resource utilization to be maximized through flexible domain placement.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentEP4718251A1Method and apparatus for scheduling virtual machine thread
Publication Date: 2026.04.01 BEIJING VOLCANO ENGINE TECH CO LTD
  • EP4718251A1 patent drawingFigure 1~2
  • EP4718251A1 patent drawingFigure 3
  • EP4718251A1 patent drawingFigure 4~5

AI summary

Embodiments of the present disclosure provide a method and an apparatus for scheduling a virtual machine thread includes: determining (S201), 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 (S202), 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 (S203), based on the processor affinity of the second VCPU thread, the second hyper-threading logical processor to run the second VCPU thread. The method improves the stability of the virtual machine.