# US 2022/0283934 A1 · Storage System and Method for Automatic Defragmentation of Memory

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

- Number: US 2022/0283934 A1
- Document ID: US20220283934A1
- Status: Published application
- Kind: A1
- Application number: 17/215,898
- Filed: 2021-03-29
- Published: 2022-09-08
- Earliest claimed: 2021-03-02
- Assignees: Western Digital Technologies, Inc.
- Applicants: Western Digital Technologies, Inc.
- Inventors: Einav Zilberstein; Hadas Oshinsky
- Web page: https://patentgrep.com/patent/US20220283934A1

## CPC

- G06F 12/0238: {Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory}
- G06F 3/0608: {Saving storage space on storage systems}
- G06F 3/0616: {in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]}
- G06F 3/064: {Management of blocks}
- G06F 3/0643: {Management of files}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/0673: {Single storage device}
- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 12/0882: Page mode
- G06F 16/1727: {Details of free space management performed by the file system (saving storage space on storage systems G06F3/0608; management of blocks in storage devices G06F3/064)}
- G06F 2212/1016: Performance improvement
- G06F 2212/1044: Space efficiency 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

A storage system determines whether its memory is fragmented (e.g., based on a host read pattern that indicates that a sequential file is being read, but the number of data sense operations required to perform this read indicates that file is stored non-sequentially in the memory). If the storage system determines that its memory is fragmented, the storage system can perform a defragmentation operation on the memory. This defragmentation operation can be done invisibly to the host (i.e., without receiving any hint or instruction from the host to perform the defragmentation operation).

## Claims

### Claim 1

A storage system comprising:
a memory;
an interface configured to communicate with a host; and
a controller configured to communicate with the memory and the interface and further configured to:
determine whether the memory is fragmented based on a number of data sense operations required to perform a read operation; and
in response to determining that the memory is fragmented, perform a defragmentation operation on the memory, wherein the defragmentation operation is performed without receiving an instruction from the host to perform the defragmentation operation.

### Claim 2 (depends on 1)

The storage system of claim 1, wherein the controller is configured to perform the defragmentation operation autonomously without receiving a hint or instruction from the host to perform the defragmentation operation.

### Claim 3 (depends on 2)

The storage system of claim 2, wherein the controller is further configured to:
determine whether the number of data sense operations required to read a page exceeds a threshold; and
in response to determining that the number of data sense operations required to read the page operation exceeds the threshold, mark the page for defragmentation.

### Claim 4 (depends on 1)

The storage system of claim 1, wherein the controller is further configured to update the host with a new logical-to-physical address map that reflects a result of the defragmentation operation.

### Claim 5 (depends on 1)

The storage system of claim 1, wherein the controller is further configured to perform the defragmentation operation during a host read.

### Claim 6 (depends on 5)

The storage system of claim 5, wherein the controller is further configured to determining a frequency for performing defragmentation operations during host reads.

### Claim 7 (depends on 1)

The storage system of claim 1, wherein the controller is further configured to aggregate pages for defragmentation and perform the defragmentation operations for the aggregated pages during a garbage collection operation.

### Claim 8 (depends on 7)

The storage system of claim 7, wherein the controller is further configured to limit a number of the aggregated pages on which the defragmentation operations are performed.

### Claim 9 (depends on 7)

The storage system of claim 7, wherein the controller is further configured to generate a list the aggregated pages and optimize the list using run length compression.

### Claim 10 (depends on 1)

The storage system of claim 1, wherein the controller is further configured to consider at least one of the following in determining whether to perform the defragmentation operation: a hot/cold classification of data stored in the memory, a number of bits stored per memory cell, an endurance impact caused by performing the defragmentation operation, and write amplification impact caused by performing the defragmentation operation.

### Claim 11 (depends on 1)

The storage system of claim 1, wherein the controller is further configured to disable automatic defragmentation in response to a program/erase count exceeding a threshold.

### Claim 12 (depends on 1)

The storage system of claim 1, wherein the controller is further configured to determine that the memory is fragmented in response to a host read pattern indicating that a group of logical block addresses belonging to a same file and residing sequentially on a host logical address range is being read but that data of this group of logical block addresses is stored non-sequentially in the memory.

### Claim 13 (depends on 1)

The storage system of claim 1, wherein the controller is further configured to determine whether the memory is fragmented on-the-fly without using an offline analysis.

### Claim 14 (depends on 1)

The storage system of claim 1, wherein the storage system is configured to be integrated in the host.

### Claim 15 (depends on 1)

The storage system of claim 1, wherein the memory comprises a three-dimensional memory.

### Claim 16

In a storage system comprising a memory, a method comprising:
determining whether the memory is fragmented based on a host read pattern; and
in response to determining that the memory is fragmented, automatically performing a defragmentation operation on the memory without host involvement.

### Claim 17 (depends on 16)

The method of claim 16, wherein the memory is determined to be fragmented when the host read pattern indicates a sequential or sequential portion of a file is being read but data of the file in stored non-sequentially in the memory.

### Claim 18 (depends on 16)

The method of claim 16, further comprising performing the defragmentation operation during a host read.

### Claim 19 (depends on 16)

The method of claim 16, further comprising performing the defragmentation operation during a garbage collection operation.

### Claim 20

A storage system comprising:
a memory; and
means for increasing read performance of the memory by automatically determining that the memory is fragmented based on a number of data sense operations required to perform a read operation and performing a defragmentation operation on the memory without host involvement.
