IP Library Granted Patent US 8,359,451
Granted Patent B2
US 8,359,451 · App. 12/729,428 · Granted Jan 22, 2013

Management of host physical memory allocation to virtual machines with a balloon application

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 8,359,451
App. No.
12/729,428
Granted
Jan 22, 2013
Kind
B2
Abstract

Methods and systems for managing distribution of host physical memory (HPM) among virtual machines (VMs) executing on a host via a hypervisor are presented, where each VM has guest system software including an operating system. A method includes an operation for reserving, by a balloon application executing in a first VM, a guest virtual memory (GVM) location in the first VM. The GVM location is mapped to a guest physical memory (GPM) location, which is mapped to a host physical memory (HPM) location. The balloon application is responsive to the hypervisor for reserving memory. Further, the method includes operations for writing a value to the reserved GVM location and for remapping a plurality of GPM locations containing the value to a single HPM location. The remapping is performed by a content-based page sharing component of the hypervisor. Additionally, the method reclaims the HPM location when the HPM location is freed due to the remapping, and assigns the reclaimed HPM location to a different VM or to a pool of available HPM locations.

Claims (51)

1. A method for managing distribution of host physical memory (HPM) among virtual machines (VMs) executing on a host via a hypervisor, each VM having guest system software including an operating system, the method comprising:

reserving, by a balloon application executing in a first VM, a guest virtual memory (GVM) location mapped to a guest physical memory (GPM) location, which is mapped to a host physical memory (HPM) location, the balloon application being responsive to commands sent from the hypervisor for reserving memory;

reclaiming the HPM location associated with the reserved GVM location

determining a memory condition in the first VM; and

adjusting HPM allocation to the first VM when the determined memory condition is outside bounds of a target memory condition for the first VM.

2. The method as recited in claim 1 , further including:

writing a value to the reserved GVM location, wherein a size of the GVM location, the GPM location, and the HPM location is one page of memory, wherein writing the value to the GVM location includes filling a page of memory corresponding to the GMV location with a pattern.

3. The method as recited in claim 2 , wherein writing the value further includes filling the page of memory with all zeros.

4. The method as recited in claim 1 , further including:

marking the GPM location as read only by the hypervisor; and

trapping a write to the GPM location to detect that the GPM location is no longer owned by the balloon application.

5. The method as recited in claim 1 , further including:

sending a request from the hypervisor to the balloon application before reserving the GVM location.

6. The method as recited in claim 1 , further including:

performing, by the balloon application, a memory read operation to the GVM location that causes the GVM location to be mapped to the GPM location.

7. The method as recited in claim 1 , wherein the determining of the memory condition includes:

determining an average age of GVMs paged-out in the first VM.

8. The method as recited in claim 1 , wherein the determining of the memory condition includes:

determining a number of GVMs allocated to the balloon application that are paged-out by the operating system in the first VM and that have ages below a target age.

9. The method as recited in claim 1 , wherein the adjusting of the HPM allocation includes:

allocating, by the hypervisor, additional HPM to the first VM when the determining the memory condition indicates that the first VM requires additional HPM.

10. The method as recited in claim 1 , wherein the adjusting of the HPM allocation includes:

reclaiming, by the hypervisor, HPM from the first VM when the determining the memory condition indicates that the first VM is available to release HPM and a second VM requires additional HPM.

11. The method as recited in claim 1 , further including:

setting target memory conditions for the VMs to avoid a thrashing state in any of the VMs.

12. The method as recited in claim 1 , further including:

setting target memory conditions for the VMs such that high priority VMs are kept out of a thrashing state.

13. A method for managing distribution of host physical memory (HPM) among virtual machines (VMs) executing on a host via a hypervisor, each VM having guest system software including an operating system, the method comprising:

receiving, by a balloon application executing in a first VM, a memory allocation request from the hypervisor;

reserving a guest virtual memory (GVM) location in response to the memory allocation request, the GVM location being mapped to a guest physical memory (GPM) location, which is mapped to a host physical memory (HPM) location;

reclaiming the HPM location associated with the reserved GVM location;

assigning the reclaimed HPM location to a second VM;

determining a memory condition in the first VM; and

adjusting HPM allocation to the first VM when the determined memory condition is outside bounds of a target memory condition for the first VM.

14. The method as recited in claim 13 , wherein a size of the GVM location, the GPM location, and the HPM location is one page of memory.

15. The method as recited in claim 13 , further including:

marking the GPM location as read only by the hypervisor; and

trapping a write to the GPM location to detect that the GPM location is no longer owned by the balloon application.

16. A system for managing distribution of physical memory among virtual machines (VMs) executing on a host computer via a hypervisor, each VM having guest system software including an operating system, the system comprising:

a balloon application executing in a first VM that is executing in the host computer, the balloon application defined to reserve a guest virtual memory (GVM) location mapped to a guest physical memory (GPM) location, which is mapped to a host physical memory (HPM) location, the balloon application being responsive to commands sent from the hypervisor for reserving memory; and

a content-based page sharing component in the hypervisor that remaps a plurality of GPM locations to a single HPM location when the balloon application writes a value to the reserved GVM location and each page from the plurality of GPM locations contains the value;

wherein the hypervisor reclaims the HPM location when the HPM location is freed due to being remapped in order to make the HPM location available to a pool of available HPM locations, and wherein the hypervisor determines a memory condition in the first VM and adjusts an HPM allocation to the first VM when the memory condition is outside bounds of a target memory condition for the first VM.

17. The system as recited in claim 16 , wherein a size of the GVM location, the GPM location, and the HPM location is one page of memory, wherein writing the value to the GVM location includes filling a page of memory corresponding to the GMV location with a pattern.

18. The system as recited in claim 16 , wherein the hypervisor marks the GPM location as read only, wherein the hypervisor traps any write to the GPM location to detect that the GPM location is no longer owned by the balloon application.

19. The system as recited in claim 16 , wherein the balloon application performs a memory read operation to the GVM location to cause the GVM location to be mapped to the GPM location.

20. The system as recited in claim 16 , wherein the hypervisor determines the memory condition by determining an average age of GVMs paged-out in the first VM.

21. The system as recited in claim 16 , wherein the hypervisor determines the memory condition by determining a number of GVMs allocated to the balloon application that are paged-out by the operating system in the first VM and that have ages below a target age.

22. The system as recited in claim 16 , wherein the hypervisor adjusts the HPM allocation by allocating additional HPM to the first VM when the memory condition indicates that the first VM requires additional HPM.

23. The system as recited in claim 16 , wherein the hypervisor adjusts the HPM allocation by reclaiming HPM from the first VM when the memory condition indicates that the first VM is available to release HPM and a second VM requires additional HPM.

24. The system as recited in claim 16 , wherein the hypervisor sets target memory conditions for the VMs to avoid a thrashing state in any of the VMs.

25. The system as recited in claim 16 , wherein the hypervisor sets target memory conditions for the VMs such that high priority VMs are kept out of a thrashing state.

Assignments (1)
CHANGE OF NAME Recorded Apr 15, 2024
From: VMWARE, INC.
To: VMWARE LLC
Reel/Frame 067103/0030 →