Wait Optimizer for Virtual CPU Lock Acquisition

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Virtualized computer systems experience performance degradation due to spinlock operations, where vCPUs waiting to acquire a lock can be de-scheduled for long periods, leading to unfair and inefficient access, resulting in CPU time wastage and increased overhead from frequent interactions with the hypervisor.

Innovation Solution

Implementing a wait optimizer that introduces a delay before sending an interrupt to the hypervisor, allowing vCPUs to wait longer for the lock to be released, and recording the first entry time of vCPUs into the wait mode to maintain the original order of lock acquisition, thereby reducing false wake-ups and hypervisor interactions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a spinlock is used in a virtualized computer system, then mutual exclusion for critical resources is ensured, but performance degradation occurs due to vCPUs being de-scheduled for long periods while waiting for the lock

Engineering Contradiction:
Improvemutual exclusionVSAvoidsystem performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent records the first entry time of vCPUs into wait mode before they actually wait for the lock. This preliminary recording of timing information enables the hypervisor to later restore the original wait order when scheduling vCPUs, preventing performance degradation while maintaining mutual exclusion through ordered lock acquisition

Inventive Principle:
Principle #10Preliminary action

2Speed

If vCPUs repeatedly check for lock availability (spinning), then they can acquire the lock quickly when available, but CPU time is wasted and hypervisor interaction overhead increases

Engineering Contradiction:
Improvelock acquisition speedVSAvoidCPU time wastage
Core Design Contradiction:
SpeedVSLoss of energy

Solution Approach 1:

Instead of continuous spinning, the patent implements a periodic check mechanism where vCPUs wait in a recorded order and are scheduled to check for lock availability at specific intervals determined by the hypervisor. This reduces CPU time wastage while still enabling relatively quick lock acquisition when the lock becomes available

Inventive Principle:
Principle #19Periodic action

3Adaptability or versatility

If the hypervisor schedules vCPUs in arbitrary order, then scheduling flexibility is maintained, but fairness in lock acquisition is compromised leading to increased overhead

Engineering Contradiction:
Improvescheduling flexibilityVSAvoidlock acquisition fairness
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

Solution Approach 1:

The patent implements a feedback mechanism where the hypervisor uses the recorded first entry times to determine the scheduling order of vCPUs. The hypervisor feeds back scheduling decisions based on this timing information, ensuring that vCPUs are scheduled in the order they originally waited, thereby maintaining fairness while preserving scheduling flexibility through the hypervisor's control

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11537430B1Wait optimizer for recording an order of first entry into a wait mode by a virtual central processing unit
Publication Date: 2022.12.27 AMAZON TECH INC
  • US11537430B1 patent drawing
  • US11537430B1 patent drawing
  • US11537430B1 patent drawing

AI summary

A wait optimizer circuit can be coupled to a processor to monitor an entry of a virtual CPU (vCPU) into a wait mode to acquire a ticket lock. The wait optimizer can introduce an amount of delay, while the vCPU is in the wait mode, with an assumption that the spinlock may be resolved before sending a wake up signal to the processor for rescheduling. The wait optimizer can also record a time stamp only for a first entry of the vCPU from a plurality of entries into the wait mode within a window of time. The time stamps for vCPUs contending for the same ticket lock can be used by a hypervisor executing on the processor for rescheduling the vCPUs.