Virtual CPU Lock Holder Preemption Detection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional virtualization technologies face scalability issues and performance degradation due to Lock Holder Preemption (LHP) in multi-core systems, leading to resource waste and fairness violations among processes.
Innovation Solution
A method and apparatus that detect LHP by acquiring operation state information of virtual CPUs and lock information, determining LHP states, and employing a scheduling technique to allocate CPU operations effectively, thereby preventing unnecessary preemption and resource fragmentation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If spinlocks are used to hold locks in critical sections, then locking efficiency is improved for short critical sections, but Lock Holder Preemption causes waiting time to extend from a few μs to a few dozen μs or ms, causing resource waste and performance degradation
Solution Approach 1:
The VMM performs preliminary detection to identify when a lock holder vCPU is in a preempted state before other vCPUs can acquire the same lock. By detecting the LHP state in advance through operation state information and lock information, the system can take corrective scheduling actions before the waiting time extends excessively, thus resolving the contradiction between quick locking and preemption-induced delays
Solution Approach 2:
The system implements feedback by continuously monitoring operation state information of vCPUs and lock information to detect LHP states. This feedback mechanism allows the VMM to identify when a lock holder has been preempted and adjust scheduling decisions accordingly, preventing the waiting time extension problem while maintaining spinlock efficiency
2Reliability
If conventional scheduling techniques are used to solve LHP, then some LHP issues are addressed, but resource fragmentation and fairness violations among processes occur
Solution Approach 1:
The invention changes the scheduling parameter by introducing LHP state detection as a new condition for scheduling decisions. Instead of using conventional scheduling parameters alone, the VMM now considers whether a vCPU is in an LHP state (determined by combining operation state information and lock information), which allows for more intelligent scheduling that avoids resource fragmentation while resolving LHP issues
3Productivity
If vCPU holding spinlock is preempted by other vCPUs, then CPU resource utilization is reduced due to busy-waiting extension, but preventing preemption would violate scheduling fairness among vCPUs
Solution Approach 1:
The VMM acts as an intermediary between the lock holder vCPU and other vCPUs waiting for the lock. By detecting LHP states and intervening in the scheduling process, the VMM can adjust the scheduling of the lock holder or waiting vCPUs to prevent excessive busy-waiting while maintaining overall scheduling fairness, thus resolving the contradiction between CPU utilization and scheduling fairness
Data Source
AI summary
According to one embodiment of the present invention, the scheduling method includes an acquisition step of acquiring operation state information on a virtual CPU (vCPU) and lock information on an OS in the operation of the vCPU and of a virtual machine (VM) driving the vCPU and including the OS, and a determination step for determining whether the vCPU is in a lock holder preemption (LHP) state on the basis of the operation state information and the lock information. According to one embodiment of the present invention, the LHP can be easily and precisely known on a system using the VM. Also, even with an increase in the number of cores, scalability can be supported in a system by adjusting the pCPU to which operations of the vCPU are allocated through a scheduling scheme. In addition, a fairness hindering problem between the existing technology and the VM can be solved by adjusting the operations for each vCPU and continuously performing a critical section of a lock holder by using a time quantum allocated to a lock contender vCPU which awaits a lock release.


