IP Library › Granted Patent US 11,681,615
Granted Patent B2
US 11,681,615 · App. 17/206,149 · Granted Jun 20, 2023

Garbage collection operation management based on overall valid page percentage of source block and candidate source block

Inventor: Tzu-Yi Yang (Hsinchu County, TW)
Assignee: Silicon Motion, Inc.
G06F12/0253G06F12/0246G06F2212/7205
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,681,615
App. No.
17/206,149
Granted
Jun 20, 2023
Kind
B2
Abstract

A method of managing a garbage collection (GC) operation includes: comprising: selecting a source block and at least one candidate source block from the flash memory; calculating an overall valid page percentage according to a number of valid pages in the source block and the at least one candidate source block; determining a GC-to-host base ratio according to the overall valid page percentage; and performing the GC operation on the source block according to at least the GC-to-host base ratio.

Claims (70)

1. A method of managing a garbage collection (GC) operation, comprising:

selecting a source block and at least one candidate source block from the flash memory;

calculating an overall valid page percentage according to a number of valid pages in the source block and the at least one candidate source block, comprising:

determining a weight for each of the source block and the at least one candidate source block, where the weight of the source block is greater than the weight of the at least one candidate source block;

calculating a valid page percentage for each of the source block and the at least one candidate source block; and

obtaining the overall valid page percentage by calculating a weighted average of percentages of valid pages of the source block and the at least one candidate source block based on the weights of the source block and the at least one candidate source block;

determining a GC-to-host base ratio according to the overall valid page percentage; and

performing the GC operation on the source block according to at least the GC-to-host base ratio.

2. The method of claim 1 , wherein the step of calculating the overall valid page percentage comprises:

calculating a valid page percentage for each of the source block and the at least one candidate source block; and

obtaining the overall valid page percentage by calculating an average of percentages of valid pages of the source block and the at least one candidate source block.

3. The method of claim 1 , wherein the step of determining the weight for each of the source block and the at least one candidate source block comprises:

determining the weight for each of the source block and the at least one candidate source block according a numbers of invalid pages in each of the source block and the at least one candidate source block.

4. The method of claim 1 , wherein the step of calculating the overall valid page percentage comprises:

selecting a predetermined number of pages from the source block and the at least one candidate source block;

obtaining the overall valid page percentage according to a number of valid pages in the predetermined number of selected pages; and

re-selecting a predetermined number of pages from the source block and the at least one candidate source block after one or more pages in the source block has been copied by the GC operation and accordingly re-obtaining the overall valid page percentage according to the number of valid pages in the predetermined number of re-selected pages.

5. The method of claim 1 , wherein the step of calculating the overall valid page percentage comprises:

selecting a predetermined number of pages from the source block and the at least one candidate source block;

obtaining the overall valid page percentage according to a number of valid pages in the predetermined number of selected pages; and

replacing the at least one candidate source block with at least one re-selected candidate source block;

re-selecting a predetermined number of pages from the source block and the at least one re-selected candidate source block and accordingly re-obtaining the overall valid page percentage according to the number of valid pages in the predetermined number of re-selected pages.

6. The method of claim 5 , wherein the step of calculating the overall valid page percentage comprises:

determining a first weight for valid pages selected from the source block and a second weight for valid pages selected from the at least one candidate source block; and

obtaining the overall valid page percentage according to the first and second weights and the number of valid pages in the predetermined number of selected pages.

7. The method of claim 1 , wherein the step of performing the GC operation comprises:

determining a GC-to-host write ratio according to a product of the GC-to-host base ratio and an adjustment factor, where the GC-to-host write ratio indicates a ratio of a write amount of valid data based on the GC operation to a write amount of user data based on host write commands; and

performing writing of valid data based on the GC operation according to the GC-to-host write ratio, while performing writing of user data based on the host write commands.

8. A controller for use in a flash memory to control the flash memory and manage a garbage collection (GC) operation on the flash memory, comprising, comprising:

a storage unit, arranged to store information and program codes;

a processing circuit, operable to execute the program codes to be arranged to:

select a source block and at least one candidate source block from the flash memory;

calculate an overall valid page percentage according to a number of valid pages in the source block and the at least one candidate source block;

determine a GC-to-host base ratio according to the overall valid page percentage; and

perform the GC operation on the source block according to at least the GC-to-host base ratio;

wherein the processing circuit is arranged:

determine a weight for each of the source block and the at least one candidate source block, where the weight of the source block is greater than the weight of the at least one candidate source block;

calculate a valid page percentage for each of the source block and the at least one candidate source block; and

obtain the overall valid page percentage by calculating a weighted average of percentages of valid pages of the source block and the at least one candidate source block based on the weights of the source block and the at least one candidate source block.

9. The controller of claim 8 , wherein the processing circuit is arranged to:

calculate a valid page percentage for each of the source block and the at least one candidate source block; and

obtain the overall valid page percentage by calculating an average of valid page percentages of the source block and the at least one candidate source block.

10. The controller of claim 8 , wherein the processing circuit is arranged to:

determine the weight for each of the source block and the at least one candidate source block according a numbers of invalid pages in each of the source block and the at least one candidate source block.

11. The controller of claim 8 , wherein the processing circuit is arranged to:

select a predetermined number of pages from the source block and the at least one candidate source block;

obtain the overall valid page percentage according to a number of valid pages in the predetermined number of selected pages; and

re-select a predetermined number of pages from the source block and the at least one candidate source block after one or more pages in the source block has been copied by the GC operation and accordingly re-obtaining the overall valid page percentage according to the number of valid pages in the predetermined number of re-selected pages.

12. The controller of claim 8 , wherein the processing circuit is arranged to:

select a predetermined number of pages from the source block and the at least one candidate source block;

obtain the overall valid page percentage according to a number of valid pages in the predetermined number of selected pages; and

replace the at least one candidate source block with at least one re-selected candidate source block after one or more pages in the source block has been copied by the GC operation;

re-select a predetermined number of pages from the source block and the at least one re-selected candidate source block and accordingly re-obtaining the overall valid page percentage according to the number of valid pages in the predetermined number of re-selected pages.

13. The controller of claim 12 , wherein the processing circuit is arranged to:

determine a first weight for valid pages selected from the source block and a second weight for valid pages selected from the at least one candidate source block; and

obtaining the overall valid page percentage according to the first and second weights and the number of valid pages in the predetermined number of selected pages.

14. The controller of claim 8 , wherein the processing circuit is arranged to:

determining a GC-to-host write ratio according to a product of the GC-to-host base ratio and an adjustment factor, where the GC-to-host write ratio indicates a ratio of a write amount of valid data based on the GC operation to a write amount of user data based on host write commands; and

performing writing of valid data based on the GC operation according to the GC-to-host write ratio, while performing writing of user data based on the host write commands.

15. A storage system, comprising:

a flash memory; and

a controller for controlling the flash memory and managing a garbage collection (GC) operation on the flash memory, the controller arranged to:

select a source block and at least one candidate source block from the flash memory;

calculate an overall valid page percentage according to a number of valid pages in the source block and the at least one candidate source block;

determine a GC-to-host base ratio according to the overall valid page percentage; and

perform the GC operation on the source block according to at least the GC-to-host base ratio;

wherein the controller is arranged to:

determine a weight for each of the source block and the at least one candidate source block, where the weight of the source block is greater than the weight of the at least one candidate source block;

calculate a valid page percentage for each of the source block and the at least one candidate source block; and

obtain the overall valid page percentage by calculating a weighted average of percentages of valid pages of the source block and the at least one candidate source block based on the weights of the source block and the at least one candidate source block.

Continuity (2)
Continuation 17179342 · Feb 18, 2021
Related Publication 20220261344A1 · Aug 18, 2022