IP Library › Granted Patent US 11,150,929
Granted Patent B2
US 11,150,929 · App. 15/991,257 · Granted Oct 19, 2021

Enhanced memory management for virtual machines

Inventor: Michael Tsirkin (Lexington, MA)
Assignee: Red Hat, Inc.
G06F9/45558G06F12/1009G06F2009/45583
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,150,929
App. No.
15/991,257
Granted
Oct 19, 2021
Kind
B2
Abstract

Aspects of the disclosure provide for mechanisms for memory management of virtual machines in a computer system. A method of the disclosure includes: releasing a memory page of a guest memory of a virtual machine; sending, by the virtual machine, a first notification to a hypervisor, the first notification comprising an indication that a memory page associated with the virtual machine is to be rendered inaccessible; and receiving, by the virtual machine, a second notification indicative of detection of an attempt to access the memory page.

Claims (44)

1. A method comprising:

releasing, by a virtual machine, a memory page of a guest memory of the virtual machine;

responsive to releasing the memory page, sending, by a guest memory management component (GMMC) of the virtual machine, a first notification to a host memory management component (HMMC) of a hypervisor managing the virtual machine, the first notification comprising an indication that the memory page associated with the virtual machine is to be rendered inaccessible, wherein the first notification further comprises a request to notify the virtual machine of attempts to access the memory page;

responsive to receiving the first notification from the virtual machine, marking, by the HMMC of the hypervisor, the memory page as invalid by modifying a page table entry of a host page table, wherein the host page table is located in a host memory of the hypervisor, and wherein the host page table entry is associated with the memory page;

receiving, by the GMMC of the virtual machine, a second notification indicative of detection by the HMMC of an attempt to access the memory page by the virtual machine; and

responsive to receiving, by the GMMC, the second notification indicative of detection of the attempt to access the memory page by the virtual machine:

sending, by the GMMC of the virtual machine to the HMMC of the hypervisor, a third notification comprising an indication that the memory page associated with the virtual machine is to be marked as valid, and

allocating at least a portion of the memory page to the virtual machine, wherein the memory page is marked as valid by the HMMC.

2. The method of claim 1 , further comprising:

sending, to the hypervisor, a request to render the memory page accessible by the virtual machine.

3. The method of claim 2 , further comprising: sending the request to render the memory page accessible in view of the second notification.

4. The method of claim 2 , further comprising: sending the request to render the memory page accessible in response to determining that the attempt to access the memory page was made by the virtual machine.

5. The method of claim 1 , wherein the first notification comprises an indication that the memory page is released by a guest operating system of the virtual machine.

6. The method of claim 1 , wherein the first notification comprises a guest address associated with the memory page.

7. The method of claim 6 , wherein the guest address comprises a guest virtual address or a guest physical address.

8. The method of claim 1 , wherein the memory page is released by a guest operating system of the virtual machine.

9. A system comprising:

a memory; and

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

release a memory page of a guest memory of a virtual machine;

responsive to releasing the memory page, send, by a guest memory management component (GMMC) of the virtual machine, a first notification to a host memory management component (HMMC) of a hypervisor managing the virtual machine, the first notification comprising an indication that the memory page associated with the virtual machine is to be rendered inaccessible, wherein the first notification further comprises a request to notify the virtual machine of attempts to access the memory page;

responsive to receiving the first notification from the virtual machine, mark, by the HMMC of the hypervisor, the memory page as invalid by modifying a page table entry of a host page table, wherein the host page table is located in a host memory of the hypervisor, and wherein the host page table entry is associated with the memory page;

receive, by the GMMC of the virtual machine, a second notification indicative of detection of an attempt to access the memory page by the virtual machine; and

responsive to receiving the second notification indicative of detection of the attempt to access the memory page by the virtual machine:

send, by the GMMC of the virtual machine to the HMMC of the hypervisor, a third notification comprising an indication that the memory page associated with the virtual machine is to be marked as valid, and

allocate at least a portion of the memory page to the virtual machine, wherein the memory page is marked as valid by the HMMC.

10. The system of claim 9 , wherein the processing device is further to:

send, to the hypervisor, a request to render the memory page accessible by the virtual machine.

11. The system of claim 10 , wherein the processing device is further to: send the request to render the memory page accessible in view of the second notification.

12. The system of claim 10 , wherein the processing device is further to: send the request to render the memory page accessible in response to determining that the attempt to access the memory page was made by the virtual machine.

13. The system of claim 9 , wherein the first notification comprises an indication that the memory page is released by a guest operating system of the virtual machine.

14. The system of claim 9 , wherein the first notification comprises a guest address associated with the memory page.

15. The system of claim 14 , wherein the guest address comprises a guest virtual address or a guest physical address.

16. The system of claim 9 , wherein the memory page is released by a guest operating system of the virtual machine.

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

release a memory page of a guest memory of a virtual machine;

responsive to releasing the memory page, send, by a guest memory management component (GMMC) of the virtual machine, a first notification to a host memory management component (HMMC) of a hypervisor managing the virtual machine, the first notification comprising an indication that the memory page associated with the virtual machine is to be rendered inaccessible, wherein the first notification further comprises a request to notify the virtual machine of attempts to access the memory page;

responsive to receiving the first notification from the virtual machine, mark, by the HMMC of the hypervisor, the memory page as invalid by modifying a page table entry of a hos page table, wherein the host page table is located in a host memory of the hypervisor, and wherein the host page table entry is associated with the memory page;

receive, by the GMMC of the virtual machine, a second notification indicative of detection of an attempt to access the memory page by the virtual machine; and

responsive to receiving the second notification indicative of detection of the attempt to access the memory page by the virtual machine:

send, by the GMMC of the virtual machine to the HMMC of the hypervisor, a third notification comprising an indication that the memory page associated with the virtual machine is to be marked as valid, and

allocate at least a portion of the memory page to the virtual machine, wherein the memory page is marked as valid by the HMMC.

18. The non-transitory machine-readable storage medium of claim 17 , wherein the processing device is further to:

send, to the hypervisor, a request to render the memory page accessible by the virtual machine.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 5, 2018
From: TSIRKIN, MICHAEL
To: RED HAT, INC.
Reel/Frame 045984/0962 →
Continuity (1)
Related Publication 20190370044A1 · Dec 5, 2019