IP Library Granted Patent US 11,243,795
Granted Patent B2
US 11,243,795 · App. 16/411,722 · Granted Feb 8, 2022

CPU overcommit with guest idle polling

Inventors: Michael Tsirkin (Lexington, MA); Henri van Riel (Westford, MA)
Assignee: Red Hat, Inc.
G06F9/45558G06F9/4812G06F9/4843G06F9/4881G06F9/45533G06F2009/45575
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 11,243,795
App. No.
16/411,722
Granted
Feb 8, 2022
Kind
B2
Abstract

A system for CPU overcommit with guest idle-polling includes a memory, a plurality of host CPUs in communication with the memory, a virtual machine, and a hypervisor. The plurality of host CPUs include a first host CPU and a second host CPU. The virtual machine includes a virtual central processing unit (VCPU) and a guest. In an example, the VCPU executes on the first host CPU. The guest records in a location of guest memory a value indicating that the VCPU is in an idle-polling state. Then, when the hypervisor detects that a new task needs to be executed, the hypervisor reads the value in the location of the guest memory and determines that the VCPU is in the idle-polling state. Then, the hypervisor schedules the new task to the first host CPU.

Claims (33)

1. A method comprising:

sending, by a first guest to a hypervisor executing on a plurality of host central processing units (CPUs), an address of a location in guest memory and information specifying which value indicates that a given virtual central processing unit (VCPU) is in an idle-polling state during a boot of the first guest,

recording, by the hypervisor, the address of the location and the information,

executing, by the hypervisor, a first VCPU of a first virtual machine on a first host CPU, wherein the plurality of host CPUs include the first host CPU and a second host CPU;

determining, by the hypervisor, that the first VCPU is in the idle-polling state by reading a value in the location and comparing the value in the location with the information; and

scheduling, by the hypervisor, a new task to the first host CPU or the second host CPU.

2. The method of claim 1 , wherein the first guest in the first virtual machine records in the location the value indicating that the first VCPU is in the idle-polling state.

3. The method of claim 2 , scheduling, by the hypervisor, the new task to the first host CPU.

4. The method of claim 3 , further comprising responsive to determining that the first VCPU is in the idle-polling state, halting, by the hypervisor, the first VCPU before scheduling the new task to the first host CPU.

5. The method of claim 4 , wherein the first guest modifies the value in the location when the first VCPU starts executing a second task after the first VCPU is halted by the hypervisor, wherein the modified value indicates that the first VCPU is in a non-idle-polling state.

6. The method of claim 1 , wherein the new task comprises a second VCPU.

7. The method of claim 1 , wherein the new task comprises a write/read instruction or a networking related task.

8. The method of claim 1 , further comprising sending, by the hypervisor, a request to the first guest that the first guest change the value in the location whenever a state of the first VCPU changes between the idle-polling state and a non-idle-polling state.

9. The method of claim 1 , further comprising receiving, by the hypervisor from the first guest, a notification that the first guest records a value in the location whenever a state of the first VCPU changes between the idle-polling state and a non-idle-polling state.

10. The method of claim 1 , further comprising recording, by the hypervisor, the address of the location and the information in hypervisor memory.

11. The method of claim 10 , wherein the hypervisor memory includes a task structure, wherein the hypervisor records the address of the location and the information in the task structure.

12. A system comprising:

a plurality of host central processing units (CPUs), wherein the plurality of host CPUs include a first host CPU and a second host CPU;

a first guest configured to send to a hypervisor executing on the plurality of host CPUs, an address of a location in guest memory and information specifying which value indicates that a given virtual central processing unit (VCPU) is in an idle-polling state during a boot of the first guest; and

the hypervisor configured to:

record the address of the location and the information,

execute a first VCPU of a first virtual machine on the first host CPU;

determine that the first VCPU is in the idle-polling state by reading a value in the location and comparing the value in the location with the information; and

schedule a new task to the first host CPU or the second host CPU.

13. The system of claim 12 , wherein the new task comprises a second VCPU.

14. The system of claim 12 , wherein the hypervisor is further configured to send a request to the first guest that the first guest change the value in the location whenever a state of the first VCPU changes between the idle-polling state and a non-idle-polling state.

15. The system of claim 12 , wherein the hypervisor is further configured to record the address of the location and the information in a task structure in hypervisor memory.

16. A non-transitory machine readable medium storing instructions, which when executed by at least one of a plurality of host central processing units (CPUs), cause the plurality of host CPUs to:

send, by a first guest to a hypervisor executing on the plurality of host CPUs, an address of a location in guest memory and information specifying which value indicates that a given virtual central processing unit (VCPU) is in an idle-polling state during a boot of the first guest,

record, by the hypervisor executing on the plurality of host CPUs, the address of the location and the information,

execute, by the hypervisor, a first VCPU of a first virtual machine on a first host CPU, wherein the plurality of host CPUs include the first host CPU and a second host CPU;

determine, by the hypervisor, that the first VCPU is in the idle-polling state by reading a value in the location and comparing the value in the location with the information; and

schedule, by the hypervisor, a new task to the first host CPU or the second host CPU.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 14, 2019
From: TSIRKIN, MICHAEL; VAN RIEL, HENRI
To: RED HAT, INC.
Reel/Frame 049176/0327 →
Continuity (2)
Continuation 15438979 · Feb 22, 2017
Related Publication 20190266009A1 · Aug 29, 2019