# US 11,907,123 B2 · Flash memory garbage collection

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

- Number: US 11,907,123 B2
- Document ID: US11907123B2
- Status: Granted
- Kind: B2
- Application number: 17/234,897
- Filed: 2021-04-20
- Published: 2022-10-20
- Granted: 2024-02-20
- Earliest claimed: 2021-04-20
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Robert Edward Galbraith; Daniel Frank Moertl; Rick A. Weckwerth; Matthew Szekely
- Web page: https://patentgrep.com/patent/US11907123B2

## CPC

- G06F 12/0804: with main memory updating (G06F12/0806 takes precedence)
- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 2212/1016: Performance improvement
- G06F 2212/7201: Logical to physical mapping or translation of blocks or pages
- G06F 2212/7205: Cleaning, compaction, garbage collection, erase control
- G06F 2212/7208: Multiple device management, e.g. distributing data over multiple flash devices
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments include methods, systems and computer program products for managing a flash memory device. Aspects include monitoring a percentage of memory of the flash memory device that is in a ready to use state. Aspects also include operating the flash memory device in a first operating mode based on a determination that the percentage is greater than a first threshold value. Aspects further include operating the flash memory device in a second operating mode based on a determination that the percentage has fallen below the first threshold value. Aspects include operating the flash memory device in a third operating mode until the percentage exceeds the first threshold value based on a determination that the percentage has fallen below a second threshold value, which is lower than the first threshold value. The erasing of ready to erase memory block stripes is only performed during the third operating mode.

## Claims

### Claim 1

A method for managing a flash memory device, the method comprising:
monitoring a percentage of memory of the flash memory device that is in a ready to use state, wherein the flash memory device includes a plurality of dies each comprising a plurality of memory block stripes;
based on a determination that the percentage is greater than a first threshold value, operating the flash memory device in a first operating mode;
based on a determination that the percentage has fallen below the first threshold value; operating the flash memory device in a second operating mode; and
based on a determination that the percentage has fallen below a second threshold value, which is lower than the first threshold value, operating the flash memory device in a third operating mode until the percentage exceeds the first threshold value,
maintaining a heat level for each of the plurality of memory block stripes on each of the plurality of dies;
maintaining an operational state of each of the plurality of dies,
identifying one of the plurality of memory block stripes for filling with an data set based on a heat level of the data set, the operational state of plurality of dies and the heat level for each of the plurality of memory block stripes, wherein the one of the plurality of memory block stripes for filling is selected to have a heat level that is equal to the heat level of the data set,
wherein erasing of ready to erase memory block stripes is only performed during the third operating mode, and
wherein the third operating mode includes:
selecting a ready to erase memory block for erasure, wherein the selecting of the ready to erase memory block for erasure includes prioritizing erasure of block stripes located on dies that are not currently being used for a fill operation and selecting a block stripe in a round-robin fashion based on a determination that all dies are currently being used for fill operation;
erasing the selected ready to erase memory block; and
marking the erased memory block as ready to use.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first operating mode includes:
identifying one or more memory block stripes of the flash memory device that exceed a first dirty threshold;
moving valid data from the one or more block stripes to other memory locations in the flash device; and
marking the one or more memory block stripes as ready to erase.

### Claim 3 (depends on 2)

The method of claim 2, wherein the second operating mode includes:
identifying one or more memory block stripes of the flash memory device that exceed a second dirty threshold, wherein the second dirty threshold is lower than the first dirty threshold;
moving valid data from the one or more block stripes to other memory locations in the flash device; and
marking the one or more memory block as ready to erase.

### Claim 4 (depends on 1)

The method of claim 1, wherein
wherein the selection of the ready to erase memory block for erasure is based at least in part on the operational state of plurality of dies and the heat level for each of the plurality of memory block stripes.

### Claim 5 (depends on 4)

The method of claim 4, wherein the selecting of the ready to erase memory block for erasure is configured to avoid program/erase collisions.

### Claim 6 (depends on 1)

The method of claim 1, wherein the third operating mode further includes:
identifying one or more memory block stripes of the flash memory device that exceed a second dirty threshold, wherein the second dirty threshold is lower than a first dirty threshold;
moving valid data from the one or more block stripes to other memory locations in the flash device; and
marking the one or more memory block as ready to erase.

### Claim 7

A computer program product, comprising:
a storage device; and
program code stored in the storage device, wherein the program code, when executed by a controller that controls a non-volatile memory array of a data storage system, causes the controller to:
monitor a percentage of memory of the flash memory device that is in a ready to use state, wherein the flash memory device includes a plurality of dies each comprising a plurality of memory block stripes;
based on a determination that the percentage is greater than a first threshold value, operate the flash memory device in a first operating mode;
based on a determination that the percentage has fallen below the first threshold value; operate the flash memory device in a second operating mode;
based on a determination that the percentage has fallen below a second threshold value, which is lower than the first threshold value, operate the flash memory device in a third operating mode until the percentage exceeds the first threshold value,
maintain a heat level for each of the plurality of memory block stripes on each of the plurality of dies;
maintain an operational state of each of the plurality of dies, and
identify one of the plurality of memory block stripes for filling with an data set based on a heat level of the data set, the operational state of plurality of dies and the heat level for each of the plurality of memory block stripes, wherein the one of the plurality of memory block stripes for filling is selected to have a heat level that is equal to the heat level of the data set,
wherein erasing of ready to erase memory block stripes is only performed during the third operating mode, and
wherein the third operating mode includes:
selecting a ready to erase memory block for erasure, wherein the selecting of the ready to erase memory block for erasure includes prioritizing erasure of block stripes located on dies that are not currently being used for a fill operation and selecting a block stripe in a round-robin fashion based on a determination that all dies are currently being used for fill operation;
erasing the selected ready to erase memory block; and
marking the erased memory block as ready to use.

### Claim 8 (depends on 7)

The computer program product of claim 7, wherein the first operating mode includes:
identifying one or more memory block stripes of the flash memory device that exceed a first dirty threshold;
moving valid data from the one or more block stripes to other memory locations in the flash device; and
marking the one or more memory block stripes as ready to erase.

### Claim 9 (depends on 8)

The computer program product of claim 8, wherein the second operating mode includes:
identifying one or more memory block stripes of the flash memory device that exceed a second dirty threshold, wherein the second dirty threshold is lower than the first dirty threshold;
moving valid data from the one or more block stripes to other memory locations in the flash device; and
marking the one or more memory block as ready to erase.

### Claim 10 (depends on 7)

The computer program product of claim 7,
wherein the selection of the ready to erase memory block for erasure is based at least in part on the operational state of plurality of dies and the heat level for each of the plurality of memory block stripes.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein the third operating mode further includes:
identifying one or more memory block stripes of the flash memory device that exceed a second dirty threshold, wherein the second dirty threshold is lower than a first dirty threshold;
moving valid data from the one or more block stripes to other memory locations in the flash device; and
marking the one or more memory block as ready to erase.

### Claim 12 (depends on 7)

The computer program product of claim 7, wherein the selecting of the ready to erase memory block for erasure is configured to avoid program/erase collisions.

### Claim 13

A data storage system, comprising:
a controller configured to be coupled to a non-volatile memory array, wherein the controller is configured to:
monitor a percentage of memory of the flash memory device that is in a ready to use state, wherein the flash memory device includes a plurality of dies each comprising a plurality of memory block stripes;
based on a determination that the percentage is greater than a first threshold value, operate the flash memory device in a first operating mode;
based on a determination that the percentage has fallen below the first threshold value; operate the flash memory device in a second operating mode; and
based on a determination that the percentage has fallen below a second threshold value, which is lower than the first threshold value, operate the flash memory device in a third operating mode until the percentage exceeds the first threshold value,
maintain a heat level for each of the plurality of memory block stripes on each of the plurality of dies;
maintain an operational state of each of the plurality of dies, and
identify one of the plurality of memory block stripes for filling with an data set based on a heat level of the data set, the operational state of plurality of dies and the heat level for each of the plurality of memory block stripes, wherein the one of the plurality of memory block stripes for filling is selected to have a heat level that is equal to the heat level of the data set,
wherein erasing of ready to erase memory block stripes is only performed during the third operating mode, and
wherein the third operating mode includes:
selecting a ready to erase memory block for erasure, wherein the selecting of the ready to erase memory block for erasure includes prioritizing erasure of block stripes located on dies that are not currently being used for a fill operation and selecting a block stripe in a round-robin fashion based on a determination that all dies are currently being used for fill operation;
erasing the selected ready to erase memory block; and
marking the erased memory block as ready to use.

### Claim 14 (depends on 13)

The data storage system of claim 13, wherein the first operating mode includes:
identifying one or more memory block stripes of the flash memory device that exceed a first dirty threshold;
moving valid data from the one or more block stripes to other memory locations in the flash device; and
marking the one or more memory block stripes as ready to erase.

### Claim 15 (depends on 14)

The data storage system of claim 14, wherein the second operating mode includes:
identifying one or more memory block stripes of the flash memory device that exceed a second dirty threshold, wherein the second dirty threshold is lower than the first dirty threshold;
moving valid data from the one or more block stripes to other memory locations in the flash device; and
marking the one or more memory block as ready to erase.
