# US 2015/0178010 A1 · Memory management based on usage specifications

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

- Number: US 2015/0178010 A1
- Document ID: US20150178010A1
- Status: Published application
- Kind: A1
- Application number: 14/523,006
- Filed: 2014-10-24
- Published: 2015-06-25
- Earliest claimed: 2013-12-19
- Assignees: Macronix International Co., Ltd.
- Applicants: Macronix International Co., Ltd.
- Inventors: Ping-Chun Chang; Yuan-Hao Chang; Hung-Sheng Chang; Tei-Wei Kuo; Hsiang-Pang Li
- Web page: https://patentgrep.com/patent/US20150178010A1

## CPC

- G06F 3/061: {Improving I/O performance}
- G06F 3/064: {Management of blocks}
- G06F 3/0644: {Management of space entities, e.g. partitions, extents, pools}
- G06F 3/0679: {Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]}
- G06F 12/023: {Free address space management}
- G06F 12/0238: {Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory}
- G06F 12/0292: {using tables or multilevel address translation means (G06F12/023 takes precedence; address translation in virtual memory systems G06F12/10)}
- G06F 2212/1024: Latency reduction
- G06F 2212/202: Non-volatile memory
- G06F 2212/214: Solid state disk
- G06F 2212/7201: Logical to physical mapping or translation of blocks or pages
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method is provided for managing a memory device including a plurality of physical memory segments. A logical memory space is classified into a plurality of classifications based on usage specifications. The plurality of physical memory segments is allocated to corresponding logical addresses based on the plurality of classifications, and on usage statistics of the physical memory segments. A data structure is maintained recording translation between logical addresses in the logical memory space and physical addresses of the physical memory segments. The plurality of classifications includes a first classification and a second classification having different usage statistic requirements than the first classification. Logical addresses having the second classification can be redirected to physical segments allocated to logical addresses having the first classification, and the data structure can be updated to record redirected logical addresses. A free command can release a physical memory segment allocated for main memory use.

## Claims

### Claim 1

A method for managing a memory device including a plurality of physical memory segments, comprising:
classifying logical addresses in a logical memory space into a plurality of classifications based on usage specifications; and
allocating the plurality of physical memory segments to corresponding logical addresses based on the plurality of classifications, and on usage statistics of the physical memory segments.

### Claim 2 (depends on 1)

The method of claim 1, comprising:
maintaining a data structure recording translation between logical addresses in the logical memory space and physical addresses of the physical memory segments.

### Claim 3 (depends on 1)

The method of claim 1, wherein the plurality of classifications includes a first classification and a second classification having different usage statistic requirements than the first classification.

### Claim 4 (depends on 3)

The method of claim 3, comprising:
redirecting logical addresses having the second classification to physical segments allocated to logical addresses having the first classification, and updating a data structure to record redirected logical addresses, wherein the data structure is maintained recording translation between logical addresses in the logical memory space and physical addresses of the physical memory segments.

### Claim 5 (depends on 1)

The method of claim 1, wherein said allocating includes:
maintaining a plurality of sets of buckets of free memory segments based on usage statistics of the free memory segments; and
allocating a free memory segment to a logical address in a particular classification in the plurality of classifications in a bucket corresponding to usage statistics that match the particular classification, and removing the free memory segment from the bucket after said allocating.

### Claim 6 (depends on 5)

The method of claim 5, comprising:
deallocating a physical memory segment, and adding the physical memory segment to a bucket in a set in the plurality of sets of buckets,
wherein the physical memory segment has a usage statistic matching the usage statistics of the bucket to which it is added.

### Claim 7 (depends on 3)

The method of claim 3, wherein the usage statistics comprise a write count, comprising:
receiving a request to allocate a free memory segment to a logical memory segment having the first classification;
searching for the free memory segment having a write count matching the first classification and lower than write counts of other free memory segments matching the first classification;
if the free memory segment is found, allocating the free memory segment to the logical memory segment, otherwise searching for a second free memory segment having a second write count matching the second classification and higher than write counts of other free memory segments matching the second classification; and
if the second free memory segment is found, allocating the second free memory segment to the logical memory segment having the first classification.

### Claim 8 (depends on 3)

The method of claim 3, wherein the usage statistics comprise a write count, comprising:
receiving a request to allocate a free memory segment to a logical memory segment having the second classification;
searching for the free memory segment having a write count matching the second classification and lower than write counts of other free memory segments matching the second classification;
if the free memory segment is found, allocating the free memory segment to the logical memory segment, otherwise searching for a second memory segment having a write count matching the first classification and lower than write counts of other memory segments matching the first classification; and
if the second memory segment is found, searching for a second free memory segment having a write count matching the first classification, moving data in the second memory segment to the second free memory segment, and then re-allocating the second memory segment to the logical memory segment having the second classification.

### Claim 9 (depends on 3)

The method of claim 3, wherein the usage statistics comprise a write count, comprising:
receiving a request to write to a physical memory segment allocated to a logical memory segment having the first classification;
updating usage statistics of the physical memory segment; and
if the updated usage statistics have a write count higher than a discarding threshold, allocating a free memory segment having a second write count lower than the discarding threshold to the logical memory segment; and discarding the physical memory segment.

### Claim 10 (depends on 3)

The method of claim 3, wherein the usage statistics comprise a write count, comprising:
receiving a request to write to a physical memory segment allocated to a logical memory segment having the second classification;
updating usage statistics of the physical memory segment; and
if the updated usage statistics have a write count higher than a downgrading threshold, allocating a free memory segment having a second write count lower than the downgrading threshold to the logical memory segment.

### Claim 11 (depends on 3)

The method of claim 3, comprising:
receiving a command to link a first range of logical addresses having the first classification to a second range of logical addresses having the second classification;
if a physical memory segment is not allocated to a logical memory segment in the first range of logical addresses or the second range of logical addresses, allocating a free physical memory segment to the logical memory segment;
setting indicators that indicate that the second range of logical addresses having the second classification is redirected; and
setting linking information that redirects the second range of logical addresses having the second classification to physical segments allocated to the first range of logical addresses having the first classification.

### Claim 12 (depends on 3)

The method of claim 3, comprising:
receiving a command to unlink a range of logical addresses having the second classification from physical segments allocated to logical addresses having the first classification;
resetting indicators that indicate that the range of logical addresses having the second classification is redirected; and
resetting linking information that redirects the range of logical addresses having the second classification.

### Claim 13 (depends on 3)

The method of claim 3, comprising:
receiving a command to free a logical memory segment having a first logical segment number relative to a starting logical segment number for logical memory segments in the logical memory space;
deriving a second logical segment number based on the first logical segment number and the starting logical segment number;
translating the second logical segment number to a physical segment number; and
releasing a physical memory segment having the physical segment number in the plurality of physical memory segments.

### Claim 14

An apparatus, comprising:
a memory device including a plurality of physical memory segments; and
a memory controller coupled to the memory device, including:
logic to classify a logical memory space into a plurality of classifications based on usage specifications; and
logic to allocate the plurality of physical memory segments to corresponding logical addresses based on the plurality of classifications, and on usage statistics of the physical memory segments.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the memory controller includes:
logic to maintain a data structure recording translation between logical addresses in the logical memory space and physical addresses of the physical memory segments.

### Claim 16 (depends on 14)

The apparatus of claim 14, wherein the plurality of classifications includes a first classification and a second classification having different usage statistic requirements than the first classification.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the memory controller includes:
logic to redirect logical addresses having the second classification to physical segments allocated to logical addresses having the first classification, and to update a data structure to record redirected logical addresses, wherein the data structure is maintained recording translation between logical addresses in the logical memory space and physical addresses of the physical memory segments.

### Claim 18 (depends on 14)

The apparatus of claim 14, wherein the memory controller includes:
logic to maintain a plurality of sets of buckets of free memory segments based on usage statistics of the free memory segments; and
logic to allocate a free memory segment to logical address in a particular classification in the plurality of classifications in a bucket corresponding to usage statistics that match the particular classification, and to remove the free memory segment from the bucket after said allocating.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the memory controller includes:
logic to deallocate a physical memory segment, and to add the physical memory segment to a bucket in a set in the plurality of sets of buckets,
wherein the physical memory segment has a usage statistic matching the usage statistics of the bucket to which it is added.

### Claim 20 (depends on 16)

The apparatus of claim 16, wherein the usage statistics comprise a write count, and the memory controller includes:
logic to receive a request to allocate a free memory segment to a logical memory segment having the first classification;
logic to searching for the free memory segment having a write count matching the first classification and lower than write counts of other free memory segments matching the first classification;
logic to, if the free memory segment is found, allocate the free memory segment to the logical memory segment, otherwise search for a second free memory segment having a second write count matching the second classification and higher than write counts of other free memory segments matching the second classification; and
logic to, if the second free memory segment is found, allocate the second free memory segment to the logical memory segment having the first classification.

### Claim 21 (depends on 16)

The apparatus of claim 16, wherein the usage statistics comprise a write count, and the memory controller includes:
logic to receive a request to allocate a free memory segment to a logical memory segment having the second classification;
logic to search for the free memory segment having a write count matching the second classification and lower than other write counts of free memory segments matching the second classification;
logic to, if the free memory segment is found, allocate the free memory segment to the logical memory segment, otherwise search for a second memory segment having a write count matching the first classification and lower than write counts of other memory segments matching the first classification; and
logic to, if the second memory segment is found, search for a second free memory segment having a write count matching the first classification, move data in the second memory segment to the second free memory segment, and then re-allocate the second memory segment to the logical memory segment having the second classification.

### Claim 22 (depends on 16)

The apparatus of claim 16, wherein the usage statistics comprise a write count, and the memory controller includes:
logic to receive a request to write to a physical memory segment allocated to a logical memory segment having the first classification;
logic to update usage statistics of the physical memory segment; and
logic to, if the updated usage statistics have a write count higher than a discarding threshold, allocate a free memory segment having a second write count lower than the discarding threshold to the logical memory segment; and discard the physical memory segment.

### Claim 23 (depends on 16)

The apparatus of claim 16, wherein the usage statistics comprise a write count, and the memory controller includes:
logic to receive a request to write to a physical memory segment allocated to a logical memory segment having the second classification;
logic to update usage statistics of the physical memory segment; and
logic to, if the updated usage statistics have a write count higher than a downgrading threshold, allocate a free memory segment having a second write count lower than the downgrading threshold to the logical memory segment.

### Claim 24 (depends on 15)

The apparatus of claim 15, wherein the memory controller includes:
logic to receive a command to link a first range of logical addresses having the first classification to a second range of logical addresses having the second classification;
logic to, if a physical memory segment is not allocated to a logical memory segment in the first range of logical addresses or the second range of logical addresses, allocate a free physical memory segment to the logical memory segment;
logic to set indicators that indicate that the second range of logical addresses having the second classification is redirected; and
logic to set linking information that redirects the second range of logical addresses having the second classification to physical segments allocated to the first range of logical addresses having the first classification.

### Claim 25 (depends on 16)

The apparatus of claim 16, wherein the memory controller includes:
logic to receive a command to unlink a range of logical addresses having the second classification from physical segments allocated to logical addresses having the first classification;
logic to reset indicators that indicate that the range of logical addresses having the second classification is redirected; and
logic to reset linking information that redirects the range of logical addresses having the second classification.

### Claim 26 (depends on 16)

The apparatus of claim 16, wherein the memory controller includes:
logic to receive a command to free a logical memory segment having a first logical segment number relative to a starting logical segment number for logical memory segments in the logical memory space;
logic to derive a second logical segment number based on the first logical segment number and the starting logical segment number;
logic to translate the second logical segment number to a physical segment number; and
logic to release a physical memory segment having the physical segment number in the plurality of physical memory segments.

### Claim 27 (depends on 14)

The apparatus of claim 14, wherein the memory device is on an integrated circuit, and the memory controller comprises logic on the integrated circuit.

### Claim 28 (depends on 14)

The apparatus of claim 14, wherein the memory device comprises memory cells including phase change memory materials.
