# US 2012/0239851 A1 · Prioritized erasure of data blocks in a flash storage device

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

- Number: US 2012/0239851 A1
- Document ID: US20120239851A1
- Status: Published application
- Kind: A1
- Application number: 12/343,378
- Filed: 2008-12-23
- Published: 2012-09-20
- Earliest claimed: 2008-06-25
- Assignees: STEC, Inc.
- Inventors: William CALVERT; Stephen Russell Boorman; Simon Mark Haynes
- Web page: https://patentgrep.com/patent/US20120239851A1

## CPC

- G06F 3/0613: {in relation to throughput}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/0688: {Non-volatile semiconductor memory arrays}
- G06F 11/1441: {Resetting or repowering}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and systems for the prioritized erasure of data blocks in a flash storage device are provided. A data block in the flash storage device is selected for erasure based upon the number of valid data segments therein, thereby minimizing the number of data segments that are carried over to another data block before erasing the selected data block. The overhead of write operations in the flash storage device is therefore greatly reduced, and the overall performance thereof greatly increased. A method for managing memory operations in a flash storage device having a plurality of data blocks comprises the steps of selecting one of the plurality of data blocks for erasure based upon a number of valid data segments therein, and erasing the selected one of the plurality of data blocks.

## Claims

### Claim 1

A method for managing memory operations in a flash storage device having a plurality of data blocks, the method comprising the steps of:
selecting one of the plurality of data blocks for erasure based upon a number of valid data segments therein; and
erasing the selected data block.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the step of selecting one of the plurality of data blocks for erasure based upon the number of valid data segments therein comprises selecting the data block for erasure based upon a number of invalid data segments therein.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the step of erasing comprises copying the valid data segments of the selected data block to another one of the plurality of data blocks.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the other data block is a pre-erased data block.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the data segments in each of the plurality of data segments comprises 4 kB.

### Claim 6 (depends on 1)

The method according to claim 1, further comprising the step of:
providing one or more linked lists comprising a plurality of nodes, each of the plurality of nodes indicating the number of valid data segments in a corresponding one of the plurality of data blocks.

### Claim 7 (depends on 6)

The method according to claim 6, wherein each of the plurality of nodes indicates the number of valid data segments in a corresponding one of the plurality of data blocks by indicating a number of invalid data segments in the corresponding one of the plurality of data blocks.

### Claim 8 (depends on 6)

The method according to claim 6, wherein the selected data block corresponds to one of the plurality of nodes indicating a predetermined number of valid data segments.

### Claim 9 (depends on 6)

The method according to claim 6, wherein the selected data block corresponds to one of the plurality of nodes indicating a lowest number of valid data segments.

### Claim 10 (depends on 6)

The method according to claim 6, further comprising the step of:
ordering the plurality of nodes in the one or more linked lists based upon the number of valid data segments indicated therein.

### Claim 11 (depends on 6)

The method according to claim 6, wherein the one or more linked lists comprise a plurality of linked lists, each of the plurality of linked lists indicating a number of valid data segments in each data block of a distinct subset of the plurality of data blocks, each subset of the plurality of data blocks having a predefined range of valid data segments.

### Claim 12 (depends on 6)

The method according to claim 6, wherein the selected one of the plurality of data blocks corresponds to one of the plurality of nodes at an end of one of the one or more linked lists.

### Claim 13 (depends on 6)

The method according to claim 6, further comprising the step of:
updating the one or more linked lists based upon an operation in the flash storage device which changes the number of valid data segments of one of the plurality of data blocks.

### Claim 14 (depends on 1)

The method according to claim 1, wherein the step of selecting one of the plurality of data blocks for erasure is part of a background maintenance task.

### Claim 15 (depends on 1)

The method according to claim 1, wherein the step of selecting one of the plurality of data blocks for erasure is triggered in response to a rewrite operation of the flash storage device.

### Claim 16

A flash storage device, comprising:
a plurality of data blocks; and
a controller configured to:
select one of the plurality of data blocks for erasure based upon a number of valid data segments therein; and
erase the selected data block.

### Claim 17 (depends on 16)

The flash storage device according to claim 16, wherein the controller is configured to erase the one of the plurality of data blocks based upon the number of valid data segments therein by erasing the one of the plurality of data blocks based upon a number of invalid data segments therein.

### Claim 18 (depends on 16)

The flash storage device according to claim 16, wherein the controller is further configured to copy the valid data segments of the selected one of the plurality of data blocks to another one of the plurality of data blocks before erasing the selected one of the plurality of data blocks.

### Claim 19 (depends on 18)

The flash storage device according to claim 18, wherein the another one of the plurality of data blocks is a pre-erased data block.

### Claim 20 (depends on 16)

The flash storage device according to claim 16, wherein the data segments in each of the plurality of data segments comprises 4 kB

### Claim 21 (depends on 16)

The flash storage device according to claim 16, further comprising a machine-readable medium configured to store a data structure configured to indicate a number of valid data segments stored in each of the plurality of data blocks.

### Claim 22 (depends on 21)

The flash storage device according to claim 21, wherein the data structure comprises one or more linked lists comprising a plurality of nodes, each of the plurality of nodes indicating the number of valid data segments in a corresponding one of the plurality of data blocks.

### Claim 23 (depends on 22)

The flash storage device according to claim 22, wherein each of the plurality of nodes indicates the number of valid data segments in a corresponding one of the plurality of data blocks by indicating a number of invalid data segments in the corresponding one of the plurality of data blocks.

### Claim 24 (depends on 22)

The flash storage device according to claim 22, wherein the selected one of the plurality of data blocks corresponds to one of the plurality of nodes indicating a predetermined number of valid data segments.

### Claim 25 (depends on 22)

The flash storage device according to claim 22, wherein the selected one of the plurality of data blocks corresponds to one of the plurality of nodes indicating a lowest number of valid data segments.

### Claim 26 (depends on 22)

The flash storage device according to claim 22, wherein the controller is further configured to order the plurality of nodes in the one or more linked lists based upon the number of valid data segments indicated therein.

### Claim 27 (depends on 22)

The flash storage device according to claim 22, wherein the one or more linked lists comprise a plurality of linked lists, each of the plurality of linked lists indicating a number of valid data segments in each data block of a distinct subset of the plurality of data blocks, each subset of the plurality of data blocks having a predefined range of valid data segments.

### Claim 28 (depends on 22)

The flash storage device according to claim 22, wherein the selected one of the plurality of data blocks corresponds to one of the plurality of nodes at an end of one of the one or more linked lists.

### Claim 29 (depends on 22)

The flash storage device according to claim 22, wherein the controller is further configured to update the one or more linked lists based upon an operation in the flash storage device which changes the number of valid data segments of one of the plurality of data blocks.

### Claim 30 (depends on 16)

The flash storage device according to claim 16, wherein the controller is configured to select one of the plurality of data blocks for erasure as part of a background maintenance task.

### Claim 31 (depends on 16)

The flash storage device according to claim 16, wherein the controller is configured to select one of the plurality of data blocks for erasure in response to a rewrite operation of the flash storage device.

### Claim 32

A machine readable medium carrying one or more sequences of instructions for managing memory operations in a flash storage device having a plurality of data blocks, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
selecting one of the plurality of data blocks for erasure based upon a number of valid data segments therein; and
erasing the selected one of the plurality of data blocks.
