# US 2010/0169588 A1 · Optimized memory management for random and sequential data writing

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

- Number: US 2010/0169588 A1
- Document ID: US20100169588A1
- Status: Published application
- Kind: A1
- Application number: 12/346,451
- Filed: 2008-12-30
- Published: 2010-07-01
- Earliest claimed: 2008-12-30
- Assignees: SanDisk Technologies LLC
- Inventors: Alan W. Sinclair
- Web page: https://patentgrep.com/patent/US20100169588A1

## CPC

- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 2212/7202: Allocation control and policies
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and system writes data to a memory device including writing data to varying types of physical write blocks. The method includes receiving a request to write data for a logical block address within an LBA range to the memory device. Depending on whether the quantity of valid data in the memory device meets a predetermined criteria, the data is written to a specific chaotic block, a general chaotic block, or a mapped block. The mapped block is assigned for writing data for the LBA range, the specific chaotic block is assigned for writing data for contiguous LBA ranges including the LBA range, and the general chaotic block is assigned for writing data for any LBA range. Lower fragmentation and write amplification ratios may result by using this method and system.

## Claims

### Claim 1

A method of writing data to a memory device having a plurality of memory blocks, comprising:
receiving a request to write data to the memory device, where the data has a logical block address (LBA) within a first LBA range;
determining whether a quantity of valid data in the memory device meets a predetermined criteria;
if the quantity of valid data does not meet the predetermined criteria, writing the data to a chaotic block; and
if the quantity of valid data meets the predetermined criteria, writing the data to a mapped block, the mapped block assigned for writing data for the first LBA range.

### Claim 2 (depends on 1)

The method of claim 1, where:
the predetermined criteria comprises a predetermined threshold; and
determining comprises determining whether the quantity of valid data in the memory device exceeds the predetermined threshold.

### Claim 3 (depends on 2)

The method of claim 2, where the predetermined threshold is based on a length of the data.

### Claim 4 (depends on 1)

The method of claim 1, where:
the chaotic block comprises a specific chaotic block assigned for writing data for a chaotic LBA range including the first LBA range, where the chaotic LBA range comprises a plurality of contiguous LBA ranges; and
writing the data to the chaotic block comprises writing the data to the specific chaotic block if the specific chaotic block exists in the memory blocks.

### Claim 5 (depends on 4)

The method of claim 4, where:
the chaotic block further comprises a general chaotic block assigned for writing data for any LBA range; and
writing the data to the chaotic block further comprises writing the data to the general chaotic block if the specific chaotic block does not exist in the memory blocks.

### Claim 6 (depends on 4)

The method of claim 4, where writing the data to the mapped block comprises:
if a quantity of mapped blocks does not meet a predetermined maximum and if the specific chaotic block does not exist:
opening the mapped block; and
writing the data to the mapped block.

### Claim 7 (depends on 4)

The method of claim 4, further comprising writing the data to the mapped block if the mapped block exists in the memory blocks and if the specific chaotic block does not exist in the memory blocks.

### Claim 8 (depends on 4)

The method of claim 4, where the data comprises host metadata and the specific chaotic block is assigned for writing the host metadata.

### Claim 9 (depends on 1)

The method of claim 1, where the data comprises data to be written from a host or data to be written for a garbage collection operation.

### Claim 10 (depends on 1)

The method of claim 1, where writing the data to the mapped block comprises:
if a quantity of mapped blocks is at a predetermined maximum:
closing a least recently written mapped block, comprising relocating data for the first LBA range to the least recently written mapped block until the least recently written mapped block is full;
opening the mapped block; and
writing the data to the mapped block.

### Claim 11 (depends on 10)

The method of claim 10, where relocating comprises relocating data for the first LBA range from a general chaotic block to the least recently written mapped block, the general chaotic block assigned for writing data for any LBA range.

### Claim 12 (depends on 1)

The method of claim 1, where writing the data to the mapped block comprises:
if a quantity of mapped blocks is at a predetermined maximum:
closing a least recently written mapped block, comprising relocating data for a second LBA range to the least recently written mapped block until the least recently written mapped block is full;
opening the mapped block; and
writing the data to the mapped block.

### Claim 13

A memory device, comprising:
a plurality of memory blocks; and
a controller configured to:
receive a request to write data to the memory device, where the data has a logical block address (LBA) within a first LBA range;
determine whether a quantity of valid data in the memory device meets a predetermined criteria;
if the quantity of valid data does not meet the predetermined criteria, write the data to a chaotic block; and
if the quantity of valid data meets the predetermined criteria, write the data to a mapped block, the mapped block assigned for writing data for the first LBA range.

### Claim 14 (depends on 13)

The memory device of claim 13, where:
the predetermined criteria comprises a predetermined threshold; and
determining comprises the controller further configured to determine whether the quantity of valid data in the memory device exceeds the predetermined threshold.

### Claim 15 (depends on 14)

The memory device of claim 14, where the predetermined threshold is based on a length of the data.

### Claim 16 (depends on 13)

The memory device of claim 13, where:
the chaotic block comprises a specific chaotic block assigned for writing data for a chaotic LBA range including the first LBA range, where the chaotic LBA range comprises a plurality of contiguous LBA ranges; and
writing the data to the chaotic block comprises the controller further configured to write the data to the specific chaotic block if the specific chaotic block exists in the memory blocks.

### Claim 17 (depends on 16)

The memory device of claim 16, where:
the chaotic block further comprises a general chaotic block assigned for writing data for any LBA range; and
writing the data to the chaotic block further comprises the controller further configured to write the data to the general chaotic block if the specific chaotic block does not exist in the memory blocks.

### Claim 18 (depends on 16)

The memory device of claim 16, where writing the data to the mapped block comprises the controller further configured to:
if a quantity of mapped blocks does not meet a predetermined maximum and if the specific chaotic block does not exist:
open the mapped block; and
write the data to the mapped block.

### Claim 19 (depends on 16)

The memory device of claim 16, where the controller is further configured to write the data to the mapped block if the mapped block exists in the memory blocks and if the specific chaotic block does not exist in the memory blocks.

### Claim 20 (depends on 16)

The memory device of claim 16, where the data comprises host metadata and the specific chaotic block is assigned for writing the host metadata.

### Claim 21 (depends on 13)

The memory device of claim 13, where the data comprises data to be written from a host or data to be written for a garbage collection operation.

### Claim 22 (depends on 13)

The memory device of claim 13, where writing the data to the mapped block comprises the controller further configured to:
if a quantity of mapped blocks is at a predetermined maximum:
close a least recently written mapped block, comprising the controller configured to relocate data for the first LBA range to the least recently written mapped block until the least recently written mapped block is full;
open the mapped block; and
write the data to the mapped block.

### Claim 23 (depends on 22)

The memory device of claim 22, where relocating comprises the controller further configured to relocate data for the first LBA range from a general chaotic block to the least recently written mapped block, the general chaotic block assigned for writing data for any LBA range.

### Claim 24 (depends on 13)

The memory device of claim 13, where writing the data to the mapped block comprises the controller further configured to:
if a quantity of mapped blocks is at a predetermined maximum:
close a least recently written mapped block, comprising the controller configured to relocate data for a second LBA range to the least recently written mapped block until the least recently written mapped block is full;
open the mapped block; and
write the data to the mapped block.
