# US 2017/0293570 A1 · System and methods of an efficient cache algorithm in a hierarchical storage system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0293570 A1
- Document ID: US20170293570A1
- Status: Published application
- Kind: A1
- Application number: 15/097,159
- Filed: 2016-04-12
- Published: 2017-10-12
- Earliest claimed: 2016-04-12
- Assignees: VMware, Inc.
- Applicants: VMware, Inc.
- Inventors: Wenguang WANG; Enning XIANG
- Web page: https://patentgrep.com/patent/US20170293570A1

## CPC

- G06F 12/0891: using clearing, invalidating or resetting means
- G06F 12/0804: with main memory updating (G06F12/0806 takes precedence)
- G06F 12/0868: Data transfer between cache memory and other subsystems, e.g. storage devices or host systems
- G06F 2212/222: Non-volatile memory
- G06F 2212/60: Details of cache memory
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An in-memory cache for a computer system having a first storage and a second storage where the first storage is a cache for the second storage, tracks priority levels of block attributes stored therein. If a data item is cached in the first storage, the block attribute corresponding to the data item is stored in the in-memory cache as a high priority block attribute. If a data item evicted from the first storage, the block attribute corresponding to the data item is stored in the in-memory cache as a low priority block attribute. When the cache becomes full, the low priority block attributes are evicted before the high priority block attributes.

## Claims

### Claim 1

A method of managing a cache that is maintained in memory and stores block attributes corresponding to data items stored in a first storage and a second storage, wherein the first storage is a cache of the second storage, wherein the block attributes are stored as high priority or low priority, the method comprising:
responsive to caching a data item in the first storage, determining if a block attribute of the data item is stored in the cache;
if the block attribute of the data item is stored in the cache, setting a priority of the block attribute to be high priority; and
if the block attribute of the data item is not stored in the cache, adding the block attribute of the data item to the cache and setting a priority of the added block attribute to be high priority.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
responsive to caching the data item in the first storage, evicting a data item from the first storage and determining if a block attribute of the evicted data item is stored in the cache; and
if the block attribute of the evicted data item is stored in the cache, setting a priority of the block attribute of the evicted data item to be low priority.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
tracking block attributes stored in the cache using a cache management data structure having a first queue and a second queue, wherein
the first queue includes pointers to block attributes stored in the cache with high priority and the second queue includes pointers to block attributes stored in the cache with low priority.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
responsive to a read input/output operation (read IO), adding a block attribute of data targeted by the read IO to the cache as a high priority block attribute if the data targeted by the read IO is retrieved from the first storage.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
responsive to a write input/output operation (write IO), generating a block attribute of data being written by the write IO and adding the generated block attribute to the cache as a high priority block attribute.

### Claim 6

A non-transitory computer readable medium comprising instructions for managing a cache that is maintained in memory of a computer system and stores block attributes corresponding to data items stored in first and second storage of the computer system as being either high priority or low priority, wherein the first storage is a cache of the second storage and the instructions, when executed in the computer system, causes the computer system to perform the steps of:
responsive to caching a data item in the first storage, determining if a block attribute of the data item is stored in the cache;
if the block attribute of the data item is stored in the cache, setting a priority of the block attribute to be high priority; and
if the block attribute of the data item is not stored in the cache, adding the block attribute of the data item to the cache and setting a priority of the added block attribute to be high priority.

### Claim 7 (depends on 6)

The non-transitory computer readable medium of claim 6, wherein the steps performed further comprise:
responsive to caching the data item in the first storage, evicting a data item from the first storage and determining if a block attribute of the evicted data item is stored in the cache; and
if the block attribute of the evicted data item is stored in the cache, setting a priority of the block attribute of the evicted data item to be low priority.

### Claim 8 (depends on 6)

The non-transitory computer readable medium of claim 6, wherein the steps performed further comprise:
tracking block attributes stored in the cache using a cache management data structure having a first queue and a second queue, wherein
the first queue includes pointers to block attributes stored in the cache with high priority and the second queue includes pointers to block attributes stored in the cache with low priority.

### Claim 9 (depends on 6)

The non-transitory computer readable medium of claim 6, wherein the steps performed further comprise:
responsive to a read input/output operation (read IO), adding a block attribute of data targeted by the read IO to the cache as a high priority block attribute if the data targeted by the read IO is retrieved from the first storage.

### Claim 10 (depends on 6)

The non-transitory computer readable medium of claim 6, wherein the steps performed further comprise:
responsive to a write input/output operation (write IO), generating a block attribute of data being written by the write IO and adding the generated block attribute to the cache as a high priority block attribute.

### Claim 11

A computer system comprising:
a processor;
system memory; and
first and second storage, wherein
the first storage is a cache of the second storage, and
the processor is programmed to store, in a cache maintained in the system memory, block attributes corresponding to data items stored in the first storage and the second storage as a high priority block attribute or a low priority block attribute.

### Claim 12 (depends on 11)

The computer system of claim 11, wherein the processor is further programmed to:
determine if a block attribute of a data item is stored in the cache, responsive to the data item being cached in the first storage,
set a priority of the block attribute to be high priority if the block attribute of the data item is stored in the cache; and
add the block attribute of the data item to the cache and set a priority of the added block attribute to be high priority, if the block attribute of the data item is not stored in the cache.

### Claim 13 (depends on 12)

The computer system of claim 12, wherein the processor is further programmed to:
evict a data item from the first storage and determine if a block attribute of the evicted data item is stored in the block attribute cache, responsive to caching the data item in the first storage; and
setting a priority of the block attribute of the evicted data item to be low priority if the block attribute of the evicted data item is stored in the block attribute cache.

### Claim 14 (depends on 12)

The computer system of claim 12, wherein the processor is further programmed to:
track block attributes stored in the cache using a cache management data structure having a first queue and a second queue, wherein
the first queue includes pointers to block attributes stored in the cache with high priority and the second queue includes pointers to block attributes stored in the cache with low priority.

### Claim 15 (depends on 11)

The computer system of claim 11, wherein the processor is further programmed to:
responsive to a read input/output operation (read IO), add a block attribute of data targeted by the read IO to the cache as a high priority block attribute if the data targeted by the read IO is retrieved from the first storage.

### Claim 16 (depends on 11)

The computer system of claim 11, wherein the processor is further programmed to:
responsive to a write input/output operation (write IO), generate a block attribute of data being written by the write IO and add the generated block attribute to the cache as a high priority block attribute.
