IP Library Granted Patent US 12,169,730
Granted Patent B2
US 12,169,730 · App. 17/530,522 · Granted Dec 17, 2024

Handling memory accounting when suspending and resuming virtual machines to/from volatile memory

Inventors: Rajesh Venkatasubramanian (San Jose, CA); Ishan Banerjee (Santa Clara, CA); Preeti Agarwal (San Jose, CA); Ashish Kaila (San Jose, CA); Halesh Sadashiv (Bangalore, IN)
Assignee: VMware LLC
G06F9/45558G06F2009/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 12,169,730
App. No.
17/530,522
Granted
Dec 17, 2024
Kind
B2
Abstract

Techniques that enable a hypervisor to (1) maintain shared memory pages and (2) handle memory accounting for VMs that are suspended to and resumed from the volatile memory of a host system are provided. Regarding (1), the hypervisor can maintain shared memory pages in volatile memory across the suspend-to-memory and resume-from-memory operations, without having to save their reference counts. Regarding (2), the hypervisor can keep track of the volatile memory reserved and consumed by VMs as they are suspended and resumed, without erroneously double counting that memory.

Claims (66)

1. A method comprising, at a time of suspending a virtual machine (VM) to a volatile memory of a host system:

creating, by a hypervisor of the host system, a resource group node in a memory resource tree of the hypervisor, the memory resource tree being usable by the hypervisor for tracking volatile memory usage of processes running on the host system;

creating, by the hypervisor, a memory client node under an existing node for the VM in the memory resource tree;

for each guest physical memory page of the VM:

transferring, by the hypervisor, ownership of the guest physical memory page to a component of the hypervisor; and

incrementing, by the hypervisor, a consumption parameter of the memory client node indicating an amount of the volatile memory consumed by the memory client node; and

upon completing the suspending of the VM, moving, by the hypervisor, the memory client node to reside under the resource group node in the memory resource tree.

2. The method of claim 1 wherein the resource group node does not reserve any portion of the volatile memory of the host system.

3. The method of claim 1 wherein the resource group node is created under a root node of the memory resource tree, the root node representing a total capacity of the volatile memory of the host system.

4. The method of claim 1 further comprising:

saving a state of the resource group node to a portion of the volatile memory; and

subsequently to the saving, restarting the hypervisor without performing a hardware reboot of the host system.

5. The method of claim 1 further comprising, at a time of resuming the VM from the volatile memory:

powering on the VM, the powering on resulting in creation of a new node for the VM in the memory resource tree; and

moving the memory client node to reside under the new node for the VM.

6. The method of claim 5 further comprising, at the time of resuming the VM from the volatile memory:

for each guest physical memory page of the VM:

transferring ownership of the guest physical memory page to the VM from the component of the hypervisor; and

decrementing the consumption parameter of the memory client node.

7. The method of claim 6 further comprising, upon completing the resuming of the VM:

deleting the memory client node and the resource group node from the memory resource tree.

8. A non-transitory computer readable storage medium having stored thereon program code executable by a hypervisor of a host system, the program code embodying a method comprising, at a time of suspending a virtual machine (VM) to a volatile memory of the host system:

creating a resource group node in a memory resource tree of the hypervisor, the memory resource tree being usable by the hypervisor for tracking volatile memory usage of processes running on the host system;

creating a memory client node under an existing node for the VM in the memory resource tree;

for each guest physical memory page of the VM:

transferring ownership of the guest physical memory page to a component of the hypervisor; and

incrementing a consumption parameter of the memory client node indicating an amount of the volatile memory consumed by the memory client node; and

upon completing the suspending of the VM, moving the memory client node to reside under the resource group node in the memory resource tree.

9. The non-transitory computer readable storage medium of claim 8 wherein the resource group node does not reserve any portion of the volatile memory of the host system.

10. The non-transitory computer readable storage medium of claim 8 wherein the resource group node is created under a root node of the memory resource tree, the root node representing a total capacity of the volatile memory of the host system.

11. The non-transitory computer readable storage medium of claim 8 wherein the method further comprises:

saving a state of the resource group node to a portion of the volatile memory; and

subsequently to the saving, restarting the hypervisor without performing a hardware reboot of the host system.

12. The non-transitory computer readable storage medium of claim 8 wherein the method further comprises, at a time of resuming the VM from the volatile memory:

powering on the VM, the powering on resulting in creation of a new node for the VM in the memory resource tree; and

moving the memory client node to reside under the new node for the VM.

13. The non-transitory computer readable storage medium of claim 12 wherein the method further comprises, at the time of resuming the VM from the volatile memory:

for each guest physical memory page of the VM:

transferring ownership of the guest physical memory page to the VM from the component of the hypervisor; and

decrementing the consumption parameter of the memory client node.

14. The non-transitory computer readable storage medium of claim 13 wherein the method further comprises, upon completing the resuming of the VM:

deleting the memory client node and the resource group node from the memory resource tree.

15. A host system comprising:

a hypervisor;

a volatile memory; and

a non-transitory computer readable medium having stored thereon program code that causes the hypervisor to, at a time of suspending a virtual machine (VM) to the volatile memory:

create a resource group node in a memory resource tree of the hypervisor, the memory resource tree being usable by the hypervisor for tracking volatile memory usage of processes running on the host system;

create a memory client node under an existing node for the VM in the memory resource tree;

for each guest physical memory page of the VM:

transfer ownership of the guest physical memory page to a component of the hypervisor; and

increment a consumption parameter of the memory client node indicating an amount of the volatile memory consumed by the memory client node; and

upon completing the suspending of the VM, move the memory client node to reside under the resource group node in the memory resource tree.

16. The host system of claim 15 wherein the resource group node does not reserve any portion of the volatile memory of the host system.

17. The host system of claim 15 wherein the resource group node is created under a root node of the memory resource tree, the root node representing a total capacity of the volatile memory of the host system.

18. The host system of claim 15 wherein the program code further causes the processor to:

save a state of the resource group node to a portion of the volatile memory; and

subsequently to the saving, restart the hypervisor without performing a hardware reboot of the host system.

19. The host system of claim 15 wherein the program code further causes the hypervisor to, at a time of resuming the VM from the volatile memory:

power on the VM, the powering on resulting in creation of a new node for the VM in the memory resource tree; and

move the memory client node to reside under the new node for the VM.

20. The host system of claim 19 wherein the program code further causes the hypervisor to, at the time of resuming the VM from the volatile memory:

for each guest physical memory page of the VM:

transfer ownership of the guest physical memory page to the VM from the component of the hypervisor; and

decrement the consumption parameter of the memory client node.

21. The host system of claim 20 wherein the program code further causes the hypervisor to, upon completing the resuming of the VM:

delete the memory client node and the resource group node from the memory resource tree.

Assignments (2)
CHANGE OF NAME Recorded Feb 27, 2024
From: VMWARE, INC.
To: VMWARE LLC
Reel/Frame 066692/0103 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 19, 2021
From: VENKATASUBRAMANIAN, RAJESH; BANERJEE, ISHAN; AGARWAL, PREETI; KAILA, ASHISH; SADASHIV, HALESH
To: VMWARE, INC.
Reel/Frame 058159/0019 →