Dynamic Halt-Polling Control for Virtual Machine Latency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Modern virtualization systems face inefficiencies in latency reduction due to the implementation of halt-polling techniques, especially when dealing with modern guests that support CPU governors and monitoring instructions, which can increase CPU utilization without effectively reducing system latency.

Innovation Solution

A dynamic halt-polling control system where a hypervisor enables and disables halt-polling based on the detection of monitoring instructions executed by guests, determining whether they are legacy or modern guests by exposing monitoring capabilities and using flags to manage halt-polling and monitoring states, thereby optimizing CPU utilization and reducing latency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If halt-polling is enabled in virtualization systems, then latency is reduced, but CPU utilization increases

Engineering Contradiction:
ImprovelatencyVSAvoidCPU utilization
Core Design Contradiction:
Loss of timeVSUse of energy by moving object

Solution Approach 1:

The system dynamically switches between halt-polling and monitoring modes based on the guest's capabilities. The hypervisor detects whether the guest supports monitoring instructions (MWAIT/MONITOR) and adjusts the idle handling strategy accordingly, making the system flexible rather than static in its approach to latency reduction

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The invention changes the operational parameters of the virtual CPU by switching between two different idle handling mechanisms: halt-polling (which reduces latency but increases CPU utilization) and monitoring (which reduces CPU utilization but requires guest support). This parameter switching resolves the contradiction by selecting the appropriate mode based on system conditions

Inventive Principle:
Principle #35Parameter changes

2Speed

If halt-polling is used to reduce latency, then system responsiveness improves, but CPU resources are consumed

Engineering Contradiction:
Improvesystem responsivenessVSAvoidCPU resources
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The system uses the guest's own capabilities (monitoring instruction support) to determine the optimal idle handling strategy. By detecting whether the guest can execute monitoring instructions, the hypervisor allows the guest to effectively self-select the most efficient mode, reducing unnecessary CPU resource consumption while maintaining responsiveness

Inventive Principle:
Principle #25Self-service

3Productivity

If monitoring is disabled and halt-polling is enabled, then interrupt handling efficiency improves, but VM exits increase

Engineering Contradiction:
Improveinterrupt handling efficiencyVSAvoidVM exit frequency
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The hypervisor implements a feedback mechanism by detecting when a guest executes a monitoring instruction and using this information to adjust the idle handling strategy. This feedback loop allows the system to learn from guest behavior and adaptively switch between halt-polling and monitoring modes, optimizing both interrupt handling efficiency and VM exit frequency

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS10564995B2Dynamic control of halt polling based on receiving a monitoring instruction executed by a guest
Publication Date: 2020.02.18 RED HAT INC
  • US10564995B2 patent drawing
  • US10564995B2 patent drawing
  • US10564995B2 patent drawing

AI summary

A system and method for dynamic halt-polling control includes a memory, one or more physical processors in communication with the memory, and a hypervisor executing on the one or more physical processors. In an example, the hypervisor enables halt-polling and disables monitoring of a guest in a virtual machine. Then, the hypervisor exposes the monitoring to the guest. In an example, the hypervisor detects a monitoring instruction executed on a virtual central processing unit (VCPU) of the virtual machine. The monitoring instruction is executed by the guest, which causes an exit to the hypervisor while the monitoring is disabled. Responsive to detecting the monitoring instruction that causes the exit to the hypervisor, the hypervisor disables the halt-polling and enables the monitoring of the guest.