IP Library Granted Patent US 12,175,271
Granted Patent B2
US 12,175,271 · App. 17/305,033 · Granted Dec 24, 2024

Reducing latency for nested virtual machines

Inventors: Michael Tsirkin (Raanana, IL); Amnon Ilan (Raanana, IL)
Assignee: Red Hat, Inc.
G06F9/45558G06F9/4418G06F9/4812G06F2009/45566G06F2009/45575G06F2009/45595
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,175,271
App. No.
17/305,033
Granted
Dec 24, 2024
Kind
B2
Abstract

System and method for reducing latency for nested virtual machines. An example method may include: running, by a host computer system, a hypervisor managing a first virtual machine associated with a first virtual processor (vCPU) implemented by a first processing thread, wherein the first virtual machine manages a second virtual machine; creating, by the hypervisor, a second processing thread implementing a second vCPU associated with the second virtual machine; and responsive to receiving an interrupt directed to the second virtual machine, causing, by the hypervisor, the second processing thread to process the interrupt.

Claims (39)

1. A method comprising:

running, by a host computer system, a hypervisor managing a first virtual machine associated with a first virtual processor (vCPU) implemented by a first processing thread, wherein the first virtual machine manages a second virtual machine;

creating, by the hypervisor, a second processing thread implementing a second vCPU associated with the second virtual machine;

responsive to receiving an interrupt directed to the second virtual machine, causing, by a processing device executing the hypervisor, the second processing thread to process the interrupt;

maintaining, in the hypervisor, based on the first virtual machine and the second virtual machine, a total runtime and a total number of interrupts; and

delivering, by the hypervisor to a memory of the first virtual machine, the total runtime and the total number of interrupts.

2. The method of claim 1 , wherein causing the second processing thread to process the interrupt includes triggering a virtual machine exit (VMExit) from the second virtual machine and a triggering a virtual machine enter (VMEnter) to the first virtual machine.

3. The method of claim 2 , wherein triggering the VMExit from the second vCPU includes causing the second processing thread to transition to a sleep state, and wherein triggering the VMEnter to the first virtual machine includes waking up the first processing thread.

4. The method of claim 2 , wherein triggering the VMEnter to the first vCPU includes waking up the first processing thread.

5. The method of claim 1 , wherein maintaining the total runtime and the total number of interrupts includes updating the total runtime with a runtime of the second virtual machine by adding the runtime of the second virtual machine to the total runtime and updating the total number of interrupts with a total number of interrupts injected into the second virtual machine by adding the total number of interrupts injected into the second virtual machine to the total number of interrupts.

6. The method of claim 1 , wherein delivering to the memory of the first virtual machine the total runtime and the total number of interrupts comprises receiving, by the first virtual machine, the total runtime and the total number interrupts from the hypervisor after running the first virtual machine.

7. The method of claim 1 , wherein maintaining the total runtime and the total number of interrupts includes receiving, by the hypervisor, from the first virtual machine, a runtime of the first virtual machine and a number of interrupts injected into the first virtual machine and updating the total runtime and the total number of interrupts with the received runtime of the first virtual machine and the received number of interrupts injected into the first virtual machine.

8. The method of claim 1 , wherein the total runtime reflects a runtime of the second virtual machine as part of a runtime of the first virtual machine, and wherein the total number of interrupts reflects a number of interrupts injected into the second virtual machine as part of a number of interrupts injected into the first virtual machine.

9. The method of claim 1 , wherein the first processing thread and the second processing thread are synchronized.

10. A system comprising:

a memory device;

a physical processing device operatively coupled to the memory device, to:

run, by a host computer system, a hypervisor managing a first virtual machine associated with a first virtual processor (vCPU) implemented by a first processing thread, wherein the first virtual machine manages a second virtual machine;

create, by the hypervisor, a second processing thread implementing a second vCPU associated with the second virtual machine;

responsive to a reception of an interrupt directed to the second virtual machine, cause, by the hypervisor, the second processing thread to process the interrupt;

maintain, in the hypervisor, based on the first virtual machine and the second virtual machine, a total runtime and a total number of interrupts; and

deliver, by the hypervisor to a memory of the first virtual machine, the total runtime and the total number of interrupts.

11. The system of claim 10 , wherein to cause the second processing thread to process the interrupt, the physical processing device is to trigger a virtual machine exit (VMExit) from the second vCPU and trigger a virtual machine enter (VMEnter) to the first vCPU.

12. The system of claim 11 , wherein to trigger the VMExit from the second vCPU, the physical processing device is to cause the second processing thread to transition to a sleep state, and wherein to trigger the VMEnter to the first vCPU, the physical processing device is to wake up the first processing thread.

13. The system of claim 11 , wherein to trigger the VMEnter to the first vCPU, the physical processing device is to wake up the first processing thread.

14. The system of claim 10 , wherein to maintain the total runtime and the total number of interrupts, the physical processing device is to update the total runtime with a runtime of the second virtual machine by adding the runtime of the second virtual machine to the total runtime and updating the total number of interrupts with a total number of interrupts injected into the second virtual machine by adding the total number of interrupts injected into the second virtual machine to the total number of interrupts.

15. The system of claim 10 , wherein to deliver to the memory of the first virtual machine the total runtime and the total number of interrupts, the physical processing device is to receive, by the first virtual machine, the total runtime and the total number interrupts from the hypervisor after the first virtual machine is run.

16. The system of claim 10 , wherein to maintain the total runtime and the total number of interrupts, the physical processing device is to receive, by the hypervisor and from the first virtual machine, a runtime of the first virtual machine and a number of interrupts injected into the first virtual machine and update the total runtime and the total number of interrupts with the received runtime of the first virtual machine and the received number of interrupts injected into the first virtual machine.

17. The system of claim 10 , wherein the total runtime reflects a runtime of the second virtual machine as part of a runtime of the first virtual machine, and wherein the total number of interrupts reflects a number of interrupts injected into the second virtual machine as part of a number of interrupts injected into the first virtual machine.

18. The system of claim 10 , wherein the first processing thread and the second processing thread are synchronized.

19. A non-transitory machine-readable storage medium including instructions that, when accessed by a processing device, cause the processing device to:

run, by a host computer system, a hypervisor managing a first virtual machine associated with a first virtual processor (vCPU) implemented by a first processing thread, wherein the first virtual machine manages a second virtual machine;

create, by the hypervisor, a second processing thread implementing a second vCPU associated with the second virtual machine;

responsive to receiving an interrupt directed to the second virtual machine, trigger a virtual machine exit (VMExit) from the second vCPU by putting the second processing thread to sleep;

responsive to putting the second processing thread to sleep, trigger, by the processing device, a virtual machine enter (VMEnter) to the first vCPU by waking up the first processing thread;

maintain, by the hypervisor, a total runtime based on a runtime of the first virtual machine and a runtime of the second virtual machine when the first virtual machine is idle:

maintain, by the hypervisor, a total number of interrupts based on a number of interrupts injected into the first virtual machine and a number of interrupts injected into the second virtual machine; and

update, in a memory of the first virtual machine, the runtime of the first virtual machine with the total runtime maintained by the hypervisor and the number of interrupts of the first virtual machine with the total number of interrupts maintained by the hypervisor.

20. The non-transitory machine-readable storage medium of claim 19 , wherein the first processing thread and the second processing thread are synchronized.

Assignments (2)
CHANGE OF NAME Recorded Mar 3, 2026
From: RED HAT, INC.
To: RED HAT, LLC
Reel/Frame 074913/0759 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 29, 2021
From: TSIRKIN, MICHAEL; ILAN, AMNON
To: RED HAT, INC.
Reel/Frame 056709/0984 →