IP Library Granted Patent US 12,130,734
Granted Patent B2
US 12,130,734 · App. 18/056,445 · Granted Oct 29, 2024

Saving virtual memory space in a clone environment

Inventors: Tanay Ganguly (Bangalore, IN); Zubraj Singha (Bangalore, IN); Goresh Musalay (Bangalore, IN); Kashish Bhatia (Bangalore, IN)
Assignee: VMware LLC
G06F12/023G06F12/10G06F2212/1044G06F2212/152
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,130,734
App. No.
18/056,445
Granted
Oct 29, 2024
Kind
B2
Abstract

Virtual memory space may be saved in a clone environment by leveraging the similarity of the data signatures in swap files when a chain of virtual machines (VMs) includes clones spawned from a common parent and executing common applications. Deduplication is performed across the chain, rather than merely within each VM. Examples include generating a common deduplication identifier (ID) for the chain; generating a logical addressing table linked to the deduplication ID, for each of the VMs in the chain; and generating a hash table for the chain. Examples further include, based at least on a swap out request, generating a hash value for a block of memory to be written to a storage medium; and based at least on finding the hash value within the hash table, updating the logical addressing table to indicate a location of a prior-existing duplicate of the block on the storage medium.

Claims (55)

1. A method of managing virtual memory space, the method comprising:

receiving, from one of a plurality of virtual machines (VMs) in a VM chain, a swap out request for writing a block of memory to a storage medium, the plurality of VMs being clones of a parent VM, the parent VM and the plurality of VMs forming the VM chain;

based on the swap out request, generating a hash value for the block of memory to be written to the storage medium;

determining whether the hash value for the block of memory is available within a chain hash table, the chain hash table being shared across the plurality of VMs in the VM chain;

based on determining that the hash value for the block of memory is available within the chain hash table, updating, without writing the block of memory to the storage medium, a logical addressing table for the one of the plurality of VMs in the VM chain to indicate a location of a prior-existing duplicate of the block of memory on the storage medium; and

based on determining that the hash value for the block of memory is not available within the chain hash table:

writing the block of memory to the storage medium;

updating the logical addressing table for the one of the plurality of VMs in the VM chain to indicate a location of the block of memory on the storage medium; and

updating the chain hash table with the hash value.

2. The method of claim 1 , wherein the chain hash table includes (1) a header including a deduplication ID for the VM chain, an in-memory location of a physical addressing table, and an on-disk location of the physical addressing table, and (2) hash entries for each block already on the storage medium.

3. The method of claim 2 , wherein each entry in the physical addressing table includes a reference count that tracks a number of logical addressing table entries pointing to the block of memory on the storage medium.

4. The method of claim 3 , further comprising:

based on determining that the hash value for the block of memory is available within the chain hash table, incrementing the reference count.

5. The method of claim 3 , wherein the reference count is decremented when an entry in the logical addressing table for the one of the plurality of VMs in the VM chain that points to the block of memory is deleted, and wherein the block of memory on the storage medium is deleted upon determining that a value of the reference count has reached zero.

6. The method of claim 1 , wherein the logical addressing table includes (1) a header including a deduplication ID for the VM chain, an in-memory location of the chain hash table, an on-disk location of the chain hash table, and a size of the chain hash table, and (2) block entries for a swap file corresponding to the parent VM.

7. The method of claim 1 , further comprising:

determining that the swap out request is for an amount of memory larger than a block size, the swap out request indicating that a hypervisor is moving the block of memory from the one of the plurality of VMs in the VM chain to the storage medium; and

based on the determining that the swap out request is for an amount of memory larger than a block size, dividing the amount of memory into block-size chunks.

8. A computer system for managing virtual memory space, the computer system comprising:

a processor; and

a non-transitory computer readable medium having stored thereon program code, the program code causing the processor to:

receive, from one of a plurality of virtual machines (VMs) in a VM chain, a swap out request for writing a block of memory to a storage medium, the plurality of VMs being clones of a parent VM, the parent VM and the plurality of VMs forming the VM chain;

based on the swap out request, generate a hash value for the block of memory to be written to the storage medium;

determine whether the hash value for the block of memory is available within a chain hash table, the chain hash table being shared across the plurality of VMs in the VM chain;

based on determining that the hash value for the block of memory is available within the chain hash table, update, without writing the block of memory to the storage medium, a logical addressing table for the one of the plurality of VMs in the VM chain to indicate a location of a prior-existing duplicate of the block of memory on the storage medium; and

based on determining that the hash value for the block of memory is not available within the chain hash table:

write the block of memory to the storage medium;

update the logical addressing table for the one of the plurality of VMs in the VM chain to indicate a location of the block of memory on the storage medium; and

update the chain hash table with the hash value.

9. The computer system of claim 8 , wherein the chain hash table includes (1) a header including a deduplication ID for the VM chain, an in-memory location of a physical addressing table, and an on-disk location of the physical addressing table, and (2) hash entries for each block already on the storage medium.

10. The computer system of claim 9 , wherein each entry in the physical addressing table includes a reference count that tracks a number of logical addressing table entries pointing to the block of memory on the storage medium.

11. The computer system of claim 10 , wherein the program code further causes the processor to:

based on determining that the hash value for the block of memory is available within the chain hash table, increment the reference count.

12. The computer system of claim 10 , wherein the reference count is decremented when an entry in the logical addressing table for the one of the plurality of VMs in the VM chain that points to the block of memory is deleted, and wherein the block of memory on the storage medium is deleted upon determining that a value of the reference count has reached zero.

13. The computer system of claim 8 , wherein the logical addressing table includes (1) a header including a deduplication ID for the VM chain, an in-memory location of the chain hash table, an on-disk location of the chain hash table, and a size of the chain hash table, and (2) block entries for a swap file corresponding to the parent VM.

14. The computer system of claim 8 , wherein the program code further causes the processor to:

determine that the swap out request is for an amount of memory larger than a block size, the swap out request indicating that a hypervisor is moving the block of memory from the one of the plurality of VMs in the VM chain to the storage medium; and

based on the determining that the swap out request is for an amount of memory larger than a block size, divide the amount of memory into block-size chunks.

15. A non-transitory computer storage medium having computer-executable instructions that, upon execution by a processor, cause the processor to perform operations comprising:

receiving, from one of a plurality of virtual machines (VMs) in a VM chain, a swap out request for writing a block of memory to a storage medium, the plurality of VMs being clones of a parent VM, the parent VM and the plurality of VMs forming the VM chain;

based on the swap out request, generating a hash value for the block of memory to be written to the storage medium;

determining whether the hash value for the block of memory is available within a chain hash table, the chain hash table being shared across the plurality of VMs in the VM chain;

based on determining that the hash value for the block of memory is available within the chain hash table, updating, without writing the block of memory to the storage medium, a logical addressing table for the one of the plurality of VMs in the VM chain to indicate a location of a prior-existing duplicate of the block of memory on the storage medium; and

based on determining that the hash value for the block of memory is not available within the chain hash table:

writing the block of memory to the storage medium;

updating the logical addressing table for the one of the plurality of VMs in the VM chain to indicate a location of the block of memory on the storage medium; and

updating the chain hash table with the hash value.

16. The non-transitory computer storage medium of claim 15 , wherein the chain hash table includes (1) a header including a deduplication ID for the VM chain, an in-memory location of a physical addressing table, and an on-disk location of the physical addressing table, and (2) hash entries for each block already on the storage medium.

17. The non-transitory computer storage medium of claim 16 , wherein each entry in the physical addressing table includes a reference count that tracks a number of logical addressing table entries pointing to the block of memory on the storage medium.

18. The non-transitory computer storage medium of claim 17 , wherein the computer-executable instructions further cause the processor to perform operations comprising:

based on determining that the hash value for the block of memory is available within the chain hash table, incrementing the reference count.

19. The non-transitory computer storage medium of claim 17 , wherein the reference count is decremented when an entry in the logical addressing table for the one of the plurality of VMs in the VM chain that points to the block of memory is deleted, and wherein the block of memory on the storage medium is deleted upon determining that a value of the reference count has reached zero.

20. The non-transitory computer storage medium of claim 15 , wherein the computer-executable instructions further cause the processor to perform operations comprising:

determining that the swap out request is for an amount of memory larger than a block size, the swap out request indicating that a hypervisor is moving the block of memory from the one of the plurality of VMs in the VM chain to the storage medium; and

based on the determining that the swap out request is for an amount of memory larger than a block size, dividing the amount of memory into block-size chunks.

Assignments (1)
CHANGE OF NAME Recorded Apr 15, 2024
From: VMWARE, INC.
To: VMWARE LLC
Reel/Frame 067103/0030 →
Priority Claims (1)
IN 202041023073 · Jun 2, 2020 · national
Continuity (2)
Continuation 16991125 · Aug 12, 2020
Related Publication 20230080935A1 · Mar 16, 2023