# US 2019/0317898 A1 · Using track locks and stride group locks to manage cache operations

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

- Number: US 2019/0317898 A1
- Document ID: US20190317898A1
- Status: Published application
- Kind: A1
- Application number: 15/951,168
- Filed: 2018-04-12
- Published: 2019-10-17
- Earliest claimed: 2018-04-12
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Lokesh M. Gupta; Matthew G. Borlick; Kevin J. Ash
- Web page: https://patentgrep.com/patent/US20190317898A1

## CPC

- G06F 12/0815: Cache consistency protocols
- G06F 11/1004: {to protect a block of data words, e.g. CRC or checksum (G06F11/1076 takes precedence; security arrangements for protecting computers or computer systems against unauthorized activity G06F21/00)}
- G06F 11/1076: {Parity data used in redundant arrays of independent storages, e.g. in RAID systems}
- G06F 12/0866: for peripheral storage systems, e.g. disk cache
- G06F 12/0895: of parts of caches, e.g. directory or tag array
- G06F 12/1466: {Key-lock mechanism}
- G06F 13/1668: {Details of memory controller}
- G06F 2212/1032: Reliability improvement, data loss prevention, degraded operation etc
- G06F 2212/462: Track or segment
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided are a computer program product, system, and method for using track locks and stride group locks to manage cache operations. A group of tracks from the storage devices are stored in a cache. Exclusive track locks for tracks in the group in the cache are granted for writes to the tracks in the group in the cache, wherein exclusive track locks can be simultaneously held for writes to different tracks in the cache. An exclusive group lock for the group of tracks in the cache is granted to destage the tracks in the group from the cache to the storage devices. The exclusive group lock is released in response to completing the destage of the tracks in the group in the cache to the storage devices.

## Claims

### Claim 1

A computer program product for managing Input/Output requests to a plurality of storage devices, the computer program product comprising a computer readable storage medium having computer readable program code embodied therein that is executable to perform operations, the operations comprising:
storing in cache a group of tracks that are stored in the storage devices;
granting exclusive track locks for tracks in the group in the cache for writes to the tracks in the group in the cache, wherein exclusive track locks can be simultaneously held for writes to different tracks in the cache;
granting an exclusive group lock for the group of tracks in the cache to destage the tracks in the group from the cache to the storage devices; and
releasing the exclusive group lock in response to completing the destage of the tracks in the group in the cache to the storage devices.

### Claim 2 (depends on 1)

The computer program product of claim 1, wherein the operations further comprise:
receiving a write to a target track in the group;
determining whether the exclusive group lock for the group is held;
granting an exclusive track lock to the target track in response to determining that the exclusive group lock is not held; and
retrying to access the exclusive track lock for the target track in response to determining that the exclusive group lock is held.

### Claim 3 (depends on 1)

The computer program product of claim 1, wherein the operations further comprise:
granting shared group locks for writes to the tracks in the group in the cache;
releasing a shared group lock for a write in response to completing the write to a track in the cache; and
determining whether any shared group locks are held in response to initiating the destage of the group of tracks, wherein the exclusive group lock is only granted in response to determining that there are no shared group locks held for the group to destage.

### Claim 4 (depends on 1)

The computer program product of claim 1, wherein the destage of the group of tracks further comprises:
determining modified data in tracks in the group in the cache;
generating a read request to add to a submission queue indicating data for the modified data and old parity data for the group to read from at least one of the storage devices to stage into the cache;
calculating new parity data using the read data for the modified data and the old parity data staged into the cache; and
writing the new parity data and the modified data in the cache to the at least one of the storage devices, wherein the exclusive group lock is released in response to completing of the writing of the new parity data and the modified data to the at least one of the storage devices.

### Claim 5 (depends on 4)

The computer program product of claim 4, wherein the writing the new parity data and the modified data comprises:
generating a write request to add to the submission queue indicating data for the modified data and the new parity data in the cache to transfer from the cache to the at least one of the storage devices.

### Claim 6 (depends on 5)

The computer program product of claim 5, wherein the computer readable program code is executed by a system including the computer readable storage medium, wherein the system is coupled to a controller that interfaces with the storage devices, wherein the operations further comprise:
setting a doorbell register for the submission queue when adding the read request and the write request to the submission queue, wherein the setting of the doorbell register signals to the controller to process the read request to transfer data from the at least one of the storage devices to the cache and to process the write request to transfer modified data and the new parity data from the cache to the at least one of the storage devices.

### Claim 7 (depends on 4)

The computer program product of claim 4, wherein the generating the read request comprises:
determining modified segments of tracks in the group;
allocating cache segments in the cache for the determined modified segments and segments for old parity data; and
generating a list indicating the segments for the modified data and the parity data and destination locations in the cache for the allocated cache segments, wherein the list is provided with the read request to use to determine the data to read from the at least one of the storage devices to write to the destination locations in the cache.

### Claim 8 (depends on 1)

The computer program product of claim 1, wherein the destaging the tracks further comprises:
determining that all the tracks for the group are in the cache;
computing new parity data for the group from the tracks for the group in the cache; and
generating a write request to add to a submission queue including a list indicating modified tracks for the group in the cache and the new parity data and destination locations in the at least one of the storage devices to write the modified tracks and the new parity data, wherein a controller accesses the write request in the submission queue and the list and accesses the data for the modified tracks and the new parity data indicated in the list and writes across the at least one of the storage devices indicated as destination locations in the list.

### Claim 9 (depends on 1)

The computer program product of claim 1, wherein the operations further comprise:
initiating operations to stage data for a track from at least one of the storage devices into the cache;
allocating segments in the cache for the data to stage;
granting a lock on the allocated segments in the cache for the data to stage;
adding a read request to a submission queue indicating the data for the track to stage into the cache;
storing the data from the read request in the allocated segments in the cache; and
releasing the lock on the segments in the cache in response to completing the reading of the data for the segments in the cache.

### Claim 10

A computer program product for managing Input/Output requests to a tracks in a cache stored in a plurality of storage devices, the computer program product comprising a computer readable storage medium having computer readable program code embodied therein that when executed by a plurality of processing cores performs operations, the operations comprising:
granting shared stride locks to writes to tracks in a stride group of tracks, wherein the shared stride locks are granted to writes simultaneously writing to different tracks in the stride group;
determining whether there are outstanding shared stride locks for writes in response to a destage request to destage the stride groups of tracks; and
granting an exclusive stride lock for a destage of a stride group of tracks from the cache to the storage devices in response to determining there are no outstanding shared stride locks for writes.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein the operations further comprise:
communicating with a controller managing access to the storage devices over a fabric;
adding read requests to at least one submission queue to stage tracks from the storage devices into the cache to return for read requests to the tracks, wherein the controller retrieves the read requests from the at least one submission queue over the fabric to read data from the storage devices to write to the cache; and
adding write requests to the at least one submission queue to write the tracks to destage for the stride group in response to receiving the exclusive stride lock for the stride group, wherein the controller retrieves the write requests from the at least one submission queue over the fabric to write data to the storage devices.

### Claim 12

A system for managing Input/Output requests to a plurality of storage devices, comprising:
at least one processor; and
a computer readable storage medium having computer readable program code embodied that when executed by the at least one processor performs operations, the operations comprising:
storing in cache a group of tracks that are stored in the storage devices;
granting exclusive track locks for tracks in the group in the cache for writes to the tracks in the group in the cache, wherein exclusive track locks can be simultaneously held for writes to different tracks in the cache;
granting an exclusive group lock for the group of tracks in the cache to destage the tracks in the group from the cache to the storage devices; and
releasing the exclusive group lock in response to completing the destage of the tracks in the group in the cache to the storage devices.

### Claim 13 (depends on 12)

The system of claim 12, wherein the operations further comprise:
receiving a write to a target track in the group;
determining whether the exclusive group lock for the group is held;
granting an exclusive track lock to the target track in response to determining that the exclusive group lock is not held; and
retrying to access the exclusive track lock for the target track in response to determining that the exclusive group lock is held.

### Claim 14 (depends on 12)

The system of claim 12, wherein the operations further comprise:
granting shared group locks for writes to the tracks in the group in the cache;
releasing a shared group lock for a write in response to completing the write to a track in the cache; and
determining whether any shared group locks are held in response to initiating the destage of the group of tracks, wherein the exclusive group lock is only granted in response to determining that there are no shared group locks held for the group to destage.

### Claim 15 (depends on 12)

The system of claim 12, wherein the destage of the group of tracks further comprises:
determining modified data in tracks in the group in the cache;
generating a read request to add to a submission queue indicating data for the modified data and old parity data for the group to read from at least one of the storage devices to stage into the cache;
calculating new parity data using the read data for the modified data and the old parity data staged into the cache; and
writing the new parity data and the modified data in the cache to the at least one of the storage devices, wherein the exclusive group lock is released in response to completing of the writing of the new parity data and the modified data to the at least one of the storage devices.

### Claim 16 (depends on 15)

The system of claim 15, wherein the writing the new parity data and the modified data comprises:
generating a write request to add to the submission queue indicating data for the modified data and the new parity data in the cache to transfer from the cache to the at least one of the storage devices.

### Claim 17 (depends on 15)

The system of claim 15, wherein the generating the read request comprises:
determining modified segments of tracks in the group;
allocating cache segments in the cache for the determined modified segments and segments for old parity data; and
generating a list indicating the segments for the modified data and the parity data and destination locations in the cache for the allocated cache segments, wherein the list is provided with the read request to use to determine the data to read from the at least one of the storage devices to write to the destination locations in the cache.

### Claim 18

A system for managing Input/Output requests to a plurality of storage devices, comprising:
a plurality of processing cores; and
a computer readable storage medium having computer readable program code embodied that when executed by the processing cores performs operations, the operations comprising:
granting shared stride locks to writes to tracks in a stride group of tracks, wherein the shared stride locks are granted to writes simultaneously writing to different tracks in the stride group;
determining whether there are outstanding shared stride locks for writes in response to a destage request to destage the stride groups of tracks; and
granting an exclusive stride lock for a destage of a stride group of tracks from the cache to the storage devices in response to determining there are no outstanding shared stride locks for writes.

### Claim 19 (depends on 18)

The system of claim 18, wherein the operations further comprise:
communicating with a controller managing access to the storage devices over a fabric;
adding read requests to at least one submission queue to stage tracks from the storage devices into the cache to return for read requests to the tracks, wherein the controller retrieves the read requests from the at least one submission queue over the fabric to read data from the storage devices to write to the cache; and
adding write requests to the at least one submission queue to write the tracks to destage for the stride group in response to receiving the exclusive stride lock for the stride group, wherein the controller retrieves the write requests from the at least one submission queue over the fabric to write data to the storage devices.

### Claim 20

A method for managing Input/Output requests to a plurality of storage devices, comprising:
storing in cache a group of tracks that are stored in the storage devices;
granting exclusive track locks for tracks in the group in the cache for writes to the tracks in the group in the cache, wherein exclusive track locks can be simultaneously held for writes to different tracks in the cache;
granting an exclusive group lock for the group of tracks in the cache to destage the tracks in the group from the cache to the storage devices; and
releasing the exclusive group lock in response to completing the destage of the tracks in the group in the cache to the storage devices.

### Claim 21 (depends on 20)

The method of claim 20, further comprising:
receiving a write to a target track in the group;
determining whether the exclusive group lock for the group is held;
granting an exclusive track lock to the target track in response to determining that the exclusive group lock is not held; and
retrying to access the exclusive track lock for the target track in response to determining that the exclusive group lock is held.

### Claim 22 (depends on 20)

The method of claim 20, further comprising:
granting shared group locks for writes to the tracks in the group in the cache;
releasing a shared group lock for a write in response to completing the write to a track in the cache; and
determining whether any shared group locks are held in response to initiating the destage of the group of tracks, wherein the exclusive group lock is only granted in response to determining that there are no shared group locks held for the group to destage.

### Claim 23 (depends on 20)

The method of claim 20, wherein the destage of the group of tracks further comprises:
determining modified data in tracks in the group in the cache;
generating a read request to add to a submission queue indicating data for the modified data and old parity data for the group to read from at least one of the storage devices to stage into the cache;
calculating new parity data using the read data for the modified data and the old parity data staged into the cache; and
writing the new parity data and the modified data in the cache to the at least one of the storage devices, wherein the exclusive group lock is released in response to completing of the writing of the new parity data and the modified data to the at least one of the storage devices.

### Claim 24 (depends on 23)

The method of claim 23, wherein the writing the new parity data and the modified data comprises:
generating a write request to add to the submission queue indicating data for the modified data and the new parity data in the cache to transfer from the cache to the at least one of the storage devices.

### Claim 25 (depends on 23)

The method of claim 23, wherein the generating the read request comprises:
determining modified segments of tracks in the group;
allocating cache segments in the cache for the determined modified segments and segments for old parity data; and
generating a list indicating the segments for the modified data and the parity data and destination locations in the cache for the allocated cache segments, wherein the list is provided with the read request to use to determine the data to read from the at least one of the storage devices to write to the destination locations in the cache.
