Early Virtualization Context Switch for APD Resource Utilization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In virtualized accelerated processing devices, the fixed time-slice allocation for virtual machines can lead to inefficiencies due to idle periods when a VM has no work to perform, resulting in unnecessary context switches and resource underutilization.

Innovation Solution

Implementing an early virtualization context switch mechanism that detects idle conditions and performs a context switch before the fixed time-slice expires, using a timeout period and doorbell mechanism to determine if new work is available, and skipping idle functions in subsequent turns if no work is received.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If a fixed time-slice allocation is used for virtual machines, then resource sharing is simplified and scheduling is predictable, but resource utilization deteriorates due to idle periods when VMs have no work to perform

Engineering Contradiction:
Improveresource utilizationVSAvoididle time in fixed time-slice
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent implements dynamic time-slice adjustment by introducing an early context switch mechanism that allows the virtualization scheduler to shorten the time-slice duration when a VM becomes idle before its allocated time expires. This transforms the static fixed time-slice into a dynamic duration that adapts to actual work availability, thereby eliminating idle periods and improving resource utilization.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent employs feedback through the doorbell mechanism and work availability monitoring to detect when a VM has no pending work. This feedback information is used by the virtualization scheduler to make informed decisions about early context switching, allowing the system to respond to actual workload conditions rather than blindly following fixed time-slice boundaries.

Inventive Principle:
Principle #23Feedback

2Productivity

If context switch is performed only when time-slice expires, then context switch overhead is reduced, but resource underutilization increases due to idle periods

Engineering Contradiction:
Improveresource utilizationVSAvoidcontext switch management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent applies preliminary action by having the virtualization scheduler proactively detect idle conditions through the doorbell mechanism before the time-slice expires. This early detection allows the scheduler to initiate context switch preparation in advance, transitioning from a reactive approach (switching only on timeout) to a proactive approach (switching when work is actually available), thereby improving utilization without excessive complexity.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The doorbell mechanism enables self-service by allowing VMs to autonomously signal when they have work available or when they are idle. This self-signaling mechanism provides the scheduler with accurate workload information without requiring continuous polling or complex monitoring, simplifying the overall context switch management while improving resource allocation.

Inventive Principle:
Principle #25Self-service

3Productivity

If early context switch is performed without timeout period, then resource utilization improves by immediately switching to other VMs, but reliability deteriorates due to potential premature switching before work completion

Engineering Contradiction:
Improveresource utilizationVSAvoidwork completion reliability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent implements beforehand cushioning by introducing a timeout period as a buffer between idle detection and actual context switch execution. This timeout acts as a cushion that allows the system to verify whether new work arrives during the idle period, preventing premature context switches that would occur immediately upon idle detection. The cushion ensures reliable work completion while still enabling early switching when appropriate.

Inventive Principle:
Principle #11Beforehand cushioning (Prior cushioning)

Data Source

PatentEP3646177B1Early virtualization context switch for virtualized accelerated processing device
Publication Date: 2022.10.12 ADVANCED MICRO DEVICES INC
  • EP3646177B1 patent drawingFigure 1
  • EP3646177B1 patent drawingFigure 2
  • EP3646177B1 patent drawingFigure 3

AI summary

A technique for efficient time-division of resources in a virtualized accelerated processing device ("APD") is provided. In a virtualization scheme implemented on the APD, different virtual machines are assigned different "time-slices" in which to use the APD. When a time-slice expires, the APD performs a virtualization context switch by stopping operations for a current virtual machine ("VM") and starting operations for another VM. Typically, each VM is assigned a fixed length of time, after which a virtualization context switch is performed. This fixed length of time can lead to inefficiencies. Therefore, in some situations, in response to a VM having no more work to perform on the APD and the APD being idle, a virtualization context switch is performed "early." This virtualization context switch is "early" in the sense that the virtualization context switch is performed before the fixed length of time for the time-slice expires.