# US 2014/0208001 A1 · Techniques for Achieving Crash Consistency when Performing Write-Behind Caching Using a Flash Storage-Based Cache

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

- Number: US 2014/0208001 A1
- Document ID: US20140208001A1
- Status: Published application
- Kind: A1
- Application number: 13/748,308
- Filed: 2013-01-23
- Published: 2014-07-24
- Earliest claimed: 2013-01-23
- Assignees: VMware, Inc.
- Applicants: Vmware, Inc.
- Inventors: Deng Liu; Thomas A. Phelan; Ramkumar Vadivelu; Wei Zhang; Sandeep Uttamchandani; Li Zhou
- Web page: https://patentgrep.com/patent/US20140208001A1

## CPC

- G06F 12/0891: using clearing, invalidating or resetting means
- G06F 3/0685: {Hybrid storage combining heterogeneous device types, e.g. hierarchical storage, hybrid arrays}
- G06F 11/1471: involving logging of persistent data for recovery
- G06F 12/0815: Cache consistency protocols
- G06F 12/0868: Data transfer between cache memory and other subsystems, e.g. storage devices or host systems
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for achieving crash consistency when performing write-behind caching using a flash storage-based cache are provided. In one embodiment, a computer system receives from a virtual machine a write request that includes data to be written to a virtual disk and caches the data in a flash storage-based cache. The computer system further logs a transaction entry for the write request in the flash storage-based cache, where the transaction entry includes information usable for flushing the data from the flash storage-based cache to a storage device storing the virtual disk. The computer system then communicates an acknowledgment to the VM indicating that the write request has been successfully processed.

## Claims

### Claim 1

A method for achieving crash consistency when performing write-behind caching using a flash storage-based cache, the method comprising:
receiving, by a computer system, a write request from a virtual machine (VM) that comprises data to be written to a virtual disk;
caching, by the computer system, the data in the flash storage-based cache;
logging, by the computer system, a transaction entry for the write request in the flash storage-based cache, the transaction entry including information usable for flushing the data from the flash storage-based cache to a storage device storing the virtual disk; and
communicating, by the computer system, an acknowledgment to the VM indicating that the write request has been successfully processed.

### Claim 2 (depends on 1)

The method of claim 1 wherein the logging and the communicating are performed as a single, atomic operation.

### Claim 3 (depends on 1)

The method of claim 1 wherein the information usable for flushing the data from the flash storage-based cache to the storage device storing the virtual disk comprises a transaction identifier, an offset in the flash storage-based cache where the data is cached, an identifier of the virtual disk, and an offset identifying one or more pages in the virtual disk where the data should be written.

### Claim 4 (depends on 3)

The method of claim 3 wherein the caching comprises:
allocating one or more new pages in the flash storage-based cache; and
caching the data in the one or more new pages.

### Claim 5 (depends on 4)

The method of claim 4 further comprising:
determining if the flash storage-based cache already includes previously cached data corresponding to the one or more pages of the virtual disk; and
if the flash storage-based cache already includes the previously cached data, invalidating the previously cached data.

### Claim 6 (depends on 5)

The method of claim 5 wherein invalidating the previously cached data comprises:
deleting one or more transaction entries in the flash storage-based cache that are associated with the previously cached data; and
de-allocating one or more pages in the flash storage-based cache that store the previously cached data.

### Claim 7 (depends on 1)

The method of claim 1 further comprising flushing, based on the transaction entry, the data from the flash storage-based cache to the storage device.

### Claim 8 (depends on 7)

The method of claim 7 wherein the flushing is performed upon restarting the computer system after a system crash.

### Claim 9 (depends on 7)

The method of claim 7 wherein the flushing is performed prior to powering down the computer system.

### Claim 10 (depends on 7)

The method of claim 7 wherein the transaction entry is logged in a first transaction buffer area of the flash storage-based cache, and wherein the data is cached in a first write buffer area of the flash-storage based cache.

### Claim 11 (depends on 10)

The method of claim 10 wherein the flushing is performed when the first transaction buffer area reaches a predetermined threshold size.

### Claim 12 (depends on 10)

The method of claim 10 wherein the flushing is performed while the computer system receives and processes additional write requests from VMs.

### Claim 13 (depends on 12)

The method of claim 12 wherein transaction entries for the additional write requests are logged in one or more second transaction buffer areas in the flash storage-based cache that are distinct from the first transaction buffer area, and wherein data for the additional write requests are cached in one or more second write buffer areas in the flash storage-based cache that are distinct from the first write buffer area.

### Claim 14 (depends on 10)

The method of claim 10 further comprising:
sampling I/O statistics for the storage device; and
calculating, based on the I/O statistics, a moving average of I/O operations per second (IOPS) for the storage device,
wherein the flushing is performed when the moving average of IOPS falls below a predefined threshold.

### Claim 15 (depends on 1)

The method of claim 1 wherein the caching, the logging, and the communicating are skipped if a size of the data included in the write request is greater than a predefined maximum size or less than a predefined minimum size.

### Claim 16 (depends on 15)

The method of claim 15 further comprising:
if the caching, the logging, and the communicating are skipped, invalidating previously cached data in the flash storage-based cache that overlaps with the data included in the write request.

### Claim 17

A non-transitory computer readable storage medium having stored thereon computer software executable by a processor, the computer software embodying a method for achieving crash consistency when caching write requests using a flash storage-based cache, the method comprising:
receiving a write request from a VM that comprises data to be written to a virtual disk;
caching the data in the flash storage-based cache;
logging a transaction entry for the write request in the flash storage-based cache, the transaction entry including information usable for flushing the data from the flash storage-based cache to a storage device storing the virtual disk; and
communicating an acknowledgment to the VM indicating that the write request has been successfully processed.

### Claim 18 (depends on 17)

The non-transitory computer readable storage medium of claim 17 wherein the information usable for flushing the data from the flash storage-based cache to the storage device storing the virtual disk comprises a transaction identifier, an offset in the flash storage-based cache where the data is cached, an identifier of the virtual disk, and an offset identifying one or more pages in the virtual disk where the data should be written.

### Claim 19

A system for achieving crash consistency when caching write requests using a flash storage-based cache, the system comprising:
a processor configured to:
receive a write request from a VM that comprises data to be written to a virtual disk;
cache the data in the flash storage-based cache;
log a transaction entry for the write request in the flash storage-based cache, the transaction entry including information usable for flushing the data from the flash storage-based cache to a storage device storing the virtual disk; and
communicate an acknowledgment to the VM indicating that the write request has been successfully processed.

### Claim 20 (depends on 19)

The system of claim 19 wherein the information usable for flushing the data from the flash storage-based cache to the storage device storing the virtual disk comprises a transaction identifier, an offset in the flash storage-based cache where the data is cached, an identifier of the virtual disk, and an offset identifying one or more pages in the virtual disk where the data should be written.
