IP Library Granted Patent US 12,026,370
Granted Patent B2
US 12,026,370 · App. 16/712,483 · Granted Jul 2, 2024

Method and system for memory oversubscription for virtual machines

Inventors: Horacio Andres Lagar Cavilla (East Toronto, CA); Adin Matthew Scannell (Toronto, CA); Timothy James Smith (W. Toronto, CA); Peter Feiner (Toronto, CA); Mushfiq Mahmood (Scarborough, CA); David Richard Scannell (Toronto, CA); Jing Chih Su (Toronto, CA)
Assignee: Google LLC
G06F3/0608G06F3/0604G06F3/065G06F3/0662G06F3/0673G06F3/0683G06F9/45533G06F9/45558G06F2009/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 12,026,370
App. No.
16/712,483
Granted
Jul 2, 2024
Kind
B2
Abstract

A method for oversubscribing a host memory of a host running a virtual machine monitor (VMM), comprising, examining a virtual machine (VM) memory for a VM for metadata associated with the VM memory, the metadata maintained by a guest OS running on the VM, collecting the metadata for the VM memory, and managing the VM memory using the metadata for oversubscribing a host memory.

Claims (63)

1. A method, comprising:

creating a snapshot of a first virtual machine (VM);

creating a clone based on the snapshot of the first VM;

detecting memory regions of the first VM to be copied to the clone, the detected memory regions being less than entire memory contents of the first VM;

allocating a memory region for the clone, the region being less than a total memory of the clone;

populating the allocated region of the clone with the detected memory regions of the first VM;

determining that additional memory contents are needed by the clone;

fetching the additional memory contents on demand;

tracking read and write accesses to memory of the snapshot by the first VM using virtualization hardware;

identifying memory portions of the first VM that have not been accessed within a predetermined period of time using the tracked read and write accesses; and

deleting the identified memory portions from the first VM.

2. The method of claim 1 , wherein an amount of the allocated memory is adjusted.

3. The method of claim 1 , wherein creating the snapshot of the first VM further comprises:

detecting memory regions of the first VM that require pre-loading before the clone begins executing; and

writing locations of the detected memory regions that require pre-loading to a snapshot file.

4. The method of claim 3 , wherein writing the locations to the snapshot file comprises using information in a page table data structure reflecting translations between virtual addresses and physical frame numbers (PFNs).

5. The method of claim 3 , further comprising resuming the clone, the resuming comprising:

loading the locations of the detected memory regions from the snapshot file; and

for each region:

allocating additional memory to hold contents of the region;

loading the contents of the region from the snapshot file into the allocated additional memory; and

directing a VM management system to place the allocated additional memory into a virtual random access memory (RAM) of the clone.

6. The method of claim 1 , further comprising:

allocating the additional memory contents on demand as required by the clone; and

streaming the additional memory contents from the snapshot on demand as required by the clone.

7. The method of claim 1 , further comprising:

examining a guest memory of a guest OS of the clone; and

identifying one or more identifiers in the guest memory of the guest OS.

8. The method of claim 7 , further comprising replacing the one or more identifiers with a new identifier.

9. The method of claim 7 , wherein the one or more identifiers include at least one of a hostname or a network address of the guest OS.

10. The method of claim 1 further comprising running a user agent on a guest OS of the clone, the user agent configured to flush any cached identifiers to prepare for an identifier change and to start or stop services as required once an identifier change is detected.

11. The method of claim 1 , further comprising:

creating a second clone; and

allocating a second memory region for the second clone, the second memory region being less than the entire memory contents of the first VM.

12. The method of claim 1 , wherein the populating the allocated region of the clone is done without examining the contents of the first VM memory.

13. The method of claim 1 , wherein tracking read and write accesses to the memory comprises using a shadow page table mechanism, wherein separate memory management structures are created to mirror structures of the first VM.

14. The method of claim 1 , wherein tracking read and write accesses to the memory comprises using hardware virtualization support to trap accesses to memory portions of the first VM.

15. A system, comprising:

a host machine including a virtual machine (VM) monitor, configured to:

create a snapshot of a first VM;

create a clone based on the snapshot of the first VM;

detect memory regions of the first VM to be copied to the clone, the detected memory regions being less than entire memory contents of the first VM;

allocate a memory region for the clone, the allocated memory region being less than a total memory of the clone;

populate the allocated region of the clone with the detected memory regions of the first VM;

determine that additional memory contents are needed by the clone;

fetch the additional memory contents on demand;

tracking read and write accesses to memory of the snapshot by the first VM using virtualization hardware;

identify memory portions of the first VM that have not been accessed within a predetermined period of time using the tracked read and write accesses; and

delete the identified memory portions from the first VM.

16. The system of claim 15 , wherein in creating the snapshot of the first VM, host machine is further configured to:

detect memory regions of the first VM that require pre-loading before the clone begins executing; and

write locations of the detected memory regions that require pre-loading to a snapshot file.

17. The system of claim 16 , wherein writing the locations to the snapshot file comprises using information in a page table data structure reflecting translations between virtual addresses and physical frame numbers (PFNs).

18. The system of claim 16 , wherein the host is further configured to resume the clone, the resuming comprising:

loading the locations of the detected memory regions from the snapshot file; and

for each region:

allocate additional memory to hold contents of the region;

load the contents of the region from the snapshot file into the allocated additional memory; and

direct a VM management system to place the allocated additional memory into a virtual random access memory (RAM) of the clone.

19. The system of claim 15 , wherein the host is further configured to:

allocate the additional memory contents on demand as required by the clone; and

stream the additional memory contents from the snapshot on demand as required by the clone.

20. The system of claim 15 , wherein the host is further configured to allocate a second memory region for a second clone, the second memory region being less than the entire memory contents of the first VM.

Assignments (4)
CORRECTIVE ASSIGNMENT TO CORRECT THE EXECUTION DATE OF INVENTOR PETER FEINER TO 04/03/2010 PREVIOUSLY RECORDED ON REEL 051316 FRAME 0847. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jan 9, 2020
From: CAVILLA, HORACIO ANDRES LAGAR; SCANNELL, ADIN MATTHEW; SMITH, TIMOTHY JAMES; FEINER, PETER; MAHMOOD, MUSHFIQ; SCANNELL, DAVID RICHARD; SU, JING CHIH
To: GRIDCENTRIC INC.
Reel/Frame 051553/0834 →
CHANGE OF NAME Recorded Dec 20, 2019
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 051397/0276 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 19, 2019
From: GRIDCENTRIC INC.
To: GOOGLE INC.
Reel/Frame 051331/0276 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 18, 2019
From: CAVILLA, HORACIO ANDRES LAGAR; SCANNELL, ADIN MATTHEW; SMITH, TIMOTHY JAMES; FEINER, PETER; MAHMOOD, MUSHFIQ; SCANNELL, DAVID RICHARD; SU, JING CHIH
To: GRIDCENTRIC INC.
Reel/Frame 051316/0847 →
Continuity (4)
Continuation 15333951 · Oct 25, 2016
Continuation 14390249
Provisional Application 61619761 · Apr 3, 2012
Related Publication 20200192579A1 · Jun 18, 2020