# US 10,481,837 B2 · Data storage device and method for operating data storage device with efficient trimming operations

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

- Number: US 10,481,837 B2
- Document ID: US10481837B2
- Status: Granted
- Kind: B2
- Application number: 15/813,573
- Filed: 2017-11-15
- Published: 2018-11-08
- Granted: 2019-11-19
- Earliest claimed: 2017-05-08
- Assignees: Silicon Motion, Inc.
- Applicants: Silicon Motion, Inc.
- Inventors: Cheng-Yi Lin
- Web page: https://patentgrep.com/patent/US10481837B2

## CPC

- G06F 3/0679: {Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]}
- G06F 3/0608: {Saving storage space on storage systems}
- G06F 3/0631: {by allocating resources to storage systems}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 13/1694: {Configuration of memory controller to different memory types}
- 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/7207: management of metadata or control data
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data storage device with improved space-trimming capability. A microcontroller operating in accordance with a host allocates a non-volatile memory to store data. The microcontroller manages the mapping information between the logical addresses used by the host and the space of the non-volatile memory. The microcontroller further takes responsibility for the transformation of a trimming command that is issued by the host to invoke a plurality of trimming requests. After the transformation, a target-host block repeatedly indicated by the plurality of trimming requests is transformed to be trimmed at one time. The mapping information of the target-host block, therefore, is not read frequently from the non-volatile memory for real-time amendment.

## Claims

### Claim 1

A data storage device, comprising:
a non-volatile memory;
a random-access storage space; and
a microcontroller, operated by a host to allocate the non-volatile memory for data storage and manage mapping information between logical addresses used in the host and space of the non-volatile memory,
wherein:
the microcontroller transforms a trimming command issued by the host and thereby a target-host block requested to be trimmed several times in trimming requests contained in the trimming command is transformed to be trimmed at a time, wherein the microcontroller transforms the trimming command for trimming combination in units of host block, and a first trimming request and a second trimming request contained in the same trimming command and requesting to trim non-overlapped data of the target-host block are combined together to trim the target-host block at a time; and
for the target-host block that has been transformed to be trimmed at a time instead of being trimmed several times, the microcontroller downloads a target-host block-mapping table corresponding to the target-host block from the non-volatile memory to the random-access storage space at a time, and modifies the target-host block-mapping table on the random-access storage space to invalidate mapping information that corresponds to all trimming requests contained in the trimming command and corresponding to the target-host block.

### Claim 2 (depends on 1)

The data storage device as claimed in claim 1, wherein:
each of the trimming requests indicates a logical address section using data length and starting logical address.

### Claim 3 (depends on 2)

The data storage device as claimed in claim 2, wherein:
the microcontroller joins overlapping or continuous logical address sections indicated by the trimming requests contained in the trimming command.

### Claim 4 (depends on 3)

The data storage device as claimed in claim 3, wherein:
the microcontroller converts the joined logical address sections to obtain the target-host block, and modifies the target-host block-mapping table to release space from the non-volatile memory.

### Claim 5 (depends on 1)

The data storage device as claimed in claim 1, wherein:
the non-volatile memory is divided into a plurality of storage units; and
the mapping information shows what storage units map to the logical addresses used in the host.

### Claim 6 (depends on 5)

The data storage device as claimed in claim 5, wherein:
trimming cells align to the storage units by which misaligned head and tail trimming are ignored.

### Claim 7 (depends on 1)

The data storage device as claimed in claim 1, wherein:
the microcontroller invalidates mapping information by rewriting a predefined value to replace the mapping information.

### Claim 8

A method for operating a data storage device, comprising:
providing a random-access storage space for the data storage device, wherein the data storage device comprises a non-volatile memory;
in response to a host, allocating the non-volatile memory for data storage and managing mapping information between logical addresses used in the host and space in the non-volatile memory;
transforming a trimming command issued by the host and thereby a target-host block requested to be trimmed several times in trimming requests contained in the trimming command is transformed to be trimmed at a time, wherein the trimming command is transformed for trimming combination in units of host block, and a first trimming request and a second trimming request contained in the same trimming command and requesting to trim non-overlapped data of the target-host block are combined together to trim the target-host block at a time; and
for the target-host block that has been transformed to be trimmed at a time instead of being trimmed several times, downloading a target-host block-mapping table corresponding to the target-host block from the non-volatile memory to the random-access storage space at a time, and modifying the target-host block-mapping table on the random-access storage space to invalidate the mapping information that corresponds to all trimming requests contained in the trimming command and corresponding to the target-host block.

### Claim 9 (depends on 8)

The method as claimed in claim 8, wherein:
each of the trimming requests indicates a logical address section using data length and starting logical address.

### Claim 10 (depends on 9)

The method as claimed in claim 9, further comprising:
joining overlapping or continuous logical address sections indicated by the trimming requests contained in the trimming command.

### Claim 11 (depends on 8)

The method as claimed in claim 8, wherein:
the non-volatile memory is divided into a plurality of storage units; and
the mapping information shows what storage units map to the logical addresses used in the host.

### Claim 12 (depends on 11)

The method as claimed in claim 11, wherein:
trimming cells align to the storage units by which misaligned head and tail trimming are ignored.

### Claim 13 (depends on 8)

The method as claimed in claim 8, wherein:
mapping information is invalidated by rewriting a predefined value to replace the mapping information.

### Claim 14

A data storage device, comprising:
a non-volatile memory; and
a microcontroller, managing a mapping table to record mapping information between logical addresses and the non-volatile memory and dividing the mapping table into a plurality of host block-mapping tables,
wherein:
the microcontroller receives a trimming command and integrates, in units of host block, trimming requests contained in the trimming command;
a first trimming request and a second trimming request contained in the same trimming command and requesting to trim non-overlapped data of a target-host block are integrated together;
in response to the integrated first trimming request and the second trimming request, a target-host block-mapping table corresponding to the target-host block is downloaded from the non-volatile memory to the random-access storage space at a time rather, and modified on the random-access storage space to invalidate mapping information that corresponds to the first trimming request and the second trimming request.

### Claim 15 (depends on 14)

The data storage device as claimed in claim 14, wherein:
the trimming requests are integrated based on host block-mapping tables corresponding to the trimming requests.

### Claim 16 (depends on 14)

The data storage device as claimed in claim 14, wherein:
the trimming requests are integrated according to the order of the logical addresses requested in the trimming requests.

### Claim 17 (depends on 14)

The data storage device as claimed in claim 14, wherein:
each of the trimming requests indicates a logical address section.
