IP Library Granted Patent US 12,174,744
Granted Patent B2
US 12,174,744 · App. 18/093,841 · Granted Dec 24, 2024

Centralized, scalable cache for containerized applications in a virtualized environment

Inventor: Kashish Bhatia (Bangalore, IN)
Assignee: VMware LLC
G06F12/0864G06F12/0292
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,174,744
App. No.
18/093,841
Granted
Dec 24, 2024
Kind
B2
Abstract

The disclosure provides a method for caching data. The method generally includes receiving, from an application running in a first container, an I/O to write data in a storage virtual disk to a block associated with an LBA, determining a cache is assigned to the first container and the storage virtual disk using a container mapping table comprising a first container mapping table entry mapping the first container and the disk to the cache and a second container mapping table entry mapping a second container and the disk to the cache, writing the data to the block in the storage virtual disk and to a cache block in the cache, computing a hash of the data, adding an entry that maps the LBA to the hash in an LBA table, and adding an entry that maps the hash to the cache block and to the disk in a hash table.

Claims (115)

1. A method for caching data in a virtualized computing system, the method comprising:

receiving, from a first application running in a first container, a first input/output (I/O) to write first data in a storage virtual disk to a block associated with a logical block address (LBA);

determining a first cache is assigned to the first container and the storage virtual disk using a container mapping table comprising a first container mapping table entry mapping the first container and the storage virtual disk to the first cache and a second container mapping table entry mapping a second container and the storage virtual disk to the first cache;

writing the first data to the block in the storage virtual disk;

writing the first data to a cache block in the first cache;

computing a hash of the first data;

adding an LBA table entry that maps the LBA to the hash in an LBA table associated with the storage virtual disk; and

adding a hash table entry that maps the hash to the cache block and to the storage virtual disk in a hash table associated with the first cache.

2. The method of claim 1 , wherein the first cache is implemented as a cache virtual disk.

3. The method of claim 1 , further comprising:

receiving, from a second application running in the second container, a second I/O to read from the LBA;

determining the first cache is assigned to the second container and the storage virtual disk based on the second container mapping table entry in the container mapping table;

determining the LBA is associated with the hash based on the LBA table entry in the LBA table;

in response to determining the LBA is associated with the hash, determining the hash is associated with the cache block based on the hash table entry in the hash table; and

based on determining the hash is associated with the cache block, reading the first data from the cache block to satisfy the second I/O.

4. The method of claim 1 , further comprising:

evicting the first data from the first cache based on a least recently used (LRU) policy of the first cache;

computing the hash for the first data;

locating the hash table entry in the hash table using the computed hash;

locating the LBA table having the LBA table entry based on the hash table entry mapping the hash to the cache block and to the storage virtual disk;

removing the hash table entry from the hash table;

locating the LBA table entry in the LBA table using the computed hash; and

replacing the LBA table entry with an entry that maps the LBA to a value indicating that no hash value exists in the LBA table associated with the storage virtual disk.

5. The method of claim 4 , further comprising:

receiving, from a second application running in the second container, a second I/O to read from the LBA;

determining the first cache is assigned to the second container and the storage virtual disk based on the second container mapping table entry in the container mapping table;

determining the LBA is associated with the hash based on the LBA table entry in the LBA table;

determining the LBA table entry includes the value indicating that no hash value exists; and

reading the first data from the block in the storage virtual disk.

6. The method of claim 1 , wherein the container mapping table further comprises a third container mapping table entry mapping a third container and a second storage virtual disk to the first cache; and

the method further comprises:

adding a second cache to the virtualized computing system; and

assigning the second storage virtual disk to the second cache, wherein assigning the second storage virtual disk to the second cache comprises modifying the third container mapping table entry in the container mapping table to map the third container and the second storage virtual disk to the second cache.

7. The method of claim 6 , further comprising:

removing the first cache from the virtualized computing system;

assigning the first container and the storage virtual disk to the second cache, wherein assigning the first container and the storage virtual disk to the second cache comprises modifying the first container mapping table entry in the container mapping table to map the first container and the storage virtual disk to the second cache;

assigning the second container and the storage virtual disk to the second cache, wherein assigning the second container and the storage virtual disk to the second cache comprises modifying the second container mapping table entry in the container mapping table to map the second container and the storage virtual disk to the second cache; and

replacing the LBA table entry with an entry that maps the LBA to a value indicating that no hash value exists in the LBA table associated with the storage virtual disk.

8. The method of claim 1 , wherein:

the container mapping table further comprises a third container mapping table entry mapping a third container and a second storage virtual disk to a second cache; and

the method further comprises:

adding a fourth container and a third storage virtual disk for the fourth container to the virtualized computing system; and

assigning the fourth container and the third storage virtual disk to the second cache, wherein assigning the fourth container and the third storage virtual disk to the second cache comprises adding a fourth container mapping table entry mapping the fourth container and the third storage virtual disk to the second cache in the container mapping table.

9. The method of claim 1 , wherein:

the container mapping table further comprises:

a third container mapping table entry mapping a third container and a second storage virtual disk to a second cache, and

a fourth container mapping table entry mapping a fourth container and a third storage virtual disk to a third cache, and

a fifth container mapping table entry mapping a fifth container and a fourth storage virtual disk to the third cache; and

the method further comprises:

removing the third container and the second storage virtual disk from the virtualized computing system; and

assigning the fifth container and the fourth storage virtual disk to the second cache, wherein assigning the fifth container and the fourth storage virtual disk to the second cache comprises modifying the fifth container mapping table entry in the container mapping table to map the fifth container and the fourth storage virtual disk to the second cache; and

replacing LBA entries in an LBA table associated with the fourth storage virtual disk with entries that map LBAs to values indicating that no hash value exists in the LBA table associated with the fourth storage virtual disk.

10. A system comprising:

one or more processors; and

at least one memory, the one or more processors and the at least one memory configured to:

receive, from a first application running in a first container in a virtualized computing system, a first input/output (I/O) to write first data in a storage virtual disk to a block associated with a logical block address (LBA);

determine a first cache is assigned to the first container and the storage virtual disk using a container mapping table comprising a first container mapping table entry mapping the first container and the storage virtual disk to the first cache and a second container mapping table entry mapping a second container and the storage virtual disk to the first cache;

write the first data to the block in the storage virtual disk;

write the first data to a cache block in the first cache;

compute a hash of the first data;

add an LBA table entry that maps the LBA to the hash in an LBA table associated with the storage virtual disk; and

adding a hash table entry that maps the hash to the cache block and to the storage virtual disk in a hash table associated with the first cache.

11. The system of claim 10 , wherein the first cache is implemented as a cache virtual disk.

12. The system of claim 10 , wherein the one or more processors and the at least one memory are further configured to:

receive, from a second application running in the second container, a second I/O to read from the LBA;

determine the first cache is assigned to the second container and the storage virtual disk based on the second container mapping table entry in the container mapping table;

determine the LBA is associated with the hash based on the LBA table entry in the LBA table;

in response to determining the LBA is associated with the hash, determine the hash is associated with the cache block based on the hash table entry in the hash table; and

based on determining the hash is associated with the cache block, read the first data from the cache block to satisfy the second I/O.

13. The system of claim 10 , wherein the one or more processors and the at least one memory are further configured to:

evict the first data from the first cache based on a least recently used (LRU) policy of the first cache;

compute the hash for the first data;

locate the hash table entry in the hash table using the computed hash;

locate the LBA table having the LBA table entry based on the hash table entry mapping the hash to the cache block and to the storage virtual disk;

remove the hash table entry from the hash table;

locate the LBA table entry in the LBA table using the computed hash; and

replace the LBA table entry with an entry that maps the LBA to a value indicating that no hash value exists in the LBA table associated with the storage virtual disk.

14. The system of claim 13 , wherein the one or more processors and the at least one memory are further configured to:

receive, from a second application running in the second container, a second I/O to read from the LBA;

determine the first cache is assigned to the second container and the storage virtual disk based on the second container mapping table entry in the container mapping table;

determine the LBA is associated with the hash based on the LBA table entry in the LBA table;

determine the LBA table entry includes the value indicating that no hash value exists; and

read the first data from the block in the storage virtual disk.

15. The system of claim 10 , wherein the container mapping table further comprises a third container mapping table entry mapping a third container and a second storage virtual disk to the first cache; and

the one or more processors and the at least one memory are further configured to:

add a second cache to the virtualized computing system; and

assign the second storage virtual disk to the second cache, wherein assigning the second storage virtual disk to the second cache comprises modifying the third container mapping table entry in the container mapping table to map the third container and the second storage virtual disk to the second cache.

16. The system of claim 15 , wherein the one or more processors and the at least one memory are further configured to:

remove the first cache from the virtualized computing system;

assign the first container and the storage virtual disk to the second cache, wherein assigning the first container and the storage virtual disk to the second cache comprises modifying the first container mapping table entry in the container mapping table to map the first container and the storage virtual disk to the second cache;

assign the second container and the storage virtual disk to the second cache, wherein assigning the second container and the storage virtual disk to the second cache comprises modifying the second container mapping table entry in the container mapping table to map the second container and the storage virtual disk to the second cache; and

replace the LBA table entry with an entry that maps the LBA to a value indicating that no hash value exists in the LBA table associated with the storage virtual disk.

17. The system of claim 10 , wherein:

the container mapping table further comprises a third container mapping table entry mapping a third container and a second storage virtual disk to a second cache; and

the one or more processors and the at least one memory are further configured to:

add a fourth container and a third storage virtual disk for the fourth container to the virtualized computing system; and

assign the fourth container and the third storage virtual disk to the second cache, wherein assigning the fourth container and the third storage virtual disk to the second cache comprises adding a fourth container mapping table entry mapping the fourth container and the third storage virtual disk to the second cache in the container mapping table.

18. The system of claim 10 , wherein:

the container mapping table further comprises:

a third container mapping table entry mapping a third container and a second storage virtual disk to a second cache, and

a fourth container mapping table entry mapping a fourth container and a third storage virtual disk to a third cache, and

a fifth container mapping table entry mapping a fifth container and a fourth storage virtual disk to the third cache; and

the one or more processors and the at least one memory are further configured to:

remove the third container and the second storage virtual disk from the virtualized computing system; and

assign the fifth container and the fourth storage virtual disk to the second cache, wherein assigning the fifth container and the fourth storage virtual disk to the second cache comprises modifying the fifth container mapping table entry in the container mapping table to map the fifth container and the fourth storage virtual disk to the second cache; and

replace LBA entries in an LBA table associated with the fourth storage virtual disk with entries that map LBAs to values indicating that no hash value exists in the LBA table associated with the fourth storage virtual disk.

19. A non-transitory computer-readable medium comprising instructions that, when executed by one or more processors of a computing system, cause the computing system to perform operations for caching data in a virtualized computing system, the operations comprising:

receiving, from a first application running in a first container, a first input/output (I/O) to write first data in a storage virtual disk to a block associated with a logical block address (LBA);

determining a first cache is assigned to the first container and the storage virtual disk using a container mapping table comprising a first container mapping table entry mapping the first container and the storage virtual disk to the first cache and a second container mapping table entry mapping a second container and the storage virtual disk to the first cache;

writing the first data to the block in the storage virtual disk;

writing the first data to a cache block in the first cache;

computing a hash of the first data;

adding an LBA table entry that maps the LBA to the hash in an LBA table associated with the storage virtual disk; and

adding a hash table entry that maps the hash to the cache block and to the storage virtual disk in a hash table associated with the first cache.

20. The non-transitory computer-readable medium of claim 19 , wherein the first cache is implemented as a cache virtual disk.

Assignments (2)
CHANGE OF NAME Recorded May 8, 2024
From: VMWARE, INC.
To: VMWARE LLC
Reel/Frame 067355/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 6, 2023
From: BHATIA, KASHISH
To: VMWARE, INC.
Reel/Frame 062290/0709 →