Dynamically determining a ratio of memory blocks to include in a garbage collection process
A data storage device includes a first partition having memory blocks of a first type and a second partition having memory blocks of a second type. The second partition also includes hybrid memory blocks. A storage balancing system monitors a state of each partition and determines whether to initiate a garbage collection process. The storage balancing system also determines whether hybrid memory blocks, if included in the garbage collection process, are replaceable by allocating memory blocks of the second type as new hybrid memory blocks. If the storage balancing system determines the hybrid memory blocks are not replaceable, the storage balancing system dynamically determines a ratio of memory blocks of the first type and hybrid memory blocks to include in the garbage collection process.
1 . A method, comprising:
monitoring an amount of available space in a first partition of a data storage device and in a second partition of the data storage device, the first partition having a plurality of a first type of memory blocks and the second partition having a plurality of a second type of memory blocks and having a plurality of hybrid memory blocks;
initiating a garbage collection process based, at least in part, on the amount of available space in the first partition of the data storage device and the amount of available space in the second partition of the data storage device;
selecting a ratio of the first type of memory blocks to hybrid memory blocks to include in the garbage collection process based, at least in part, on the amount of available space in the first partition, the amount of available space in the second partition and on a type of garbage collection process that is initiated.
2 . The method of claim 1 , wherein the amount of available space in the first partition and the amount of available space in the second partition are indicative of a state of the first partition and a state of the second partition.
3 . The method of claim 2 , wherein the state of the first partition is selected from a group of states including a burst state, a sustained state, an urgent state and a super urgent state.
4 . The method of claim 2 , wherein the state of the second partition is selected from a group of states including a burst state, a sustained state, an urgent state and a super urgent state.
5 . The method of claim 2 , wherein the garbage collection process includes one of a folding process and a compaction process.
6 . The method of claim 1 , wherein the first type of memory blocks are single-level cell (SLC) memory blocks and the second type of memory blocks are selected from a group of memory blocks comprising multi-level cell (MLC) memory blocks, triple-level (TLC) memory blocks, quad-level cell (QLC) memory blocks and penta-level cell (PLC) memory blocks.
7 . The method of claim 1 , wherein selecting the ratio of the first type of memory blocks to hybrid memory blocks to include in the garbage collection process comprises determining whether a hybrid memory block included in the garbage collection process is replaceable by a second type of memory block of the plurality of the second type of memory blocks, the second type of memory block being allocated as a new hybrid memory block.
8 . The method of claim 7 , wherein the second type of memory block is selected to replace the hybrid memory block based, at least in part, on a number of program/erase (P/E) cycles associated with the second type of memory block.
9 . A data storage device, comprising:
a processor; and
a storage balancing system associated with the processor and operable to:
determine an amount of free space in a first partition of the data storage device and a second partition of the data storage device, the first partition comprising a plurality of a first type of memory blocks and the second partition comprising a plurality of a second type of memory blocks and a plurality of hybrid memory blocks;
initiate a garbage collection process based, at least in part, on the amount of free space in the first partition and the second partition; and
select a ratio of the first type of memory blocks to hybrid memory blocks to include in the garbage collection process based, at least in part, on the amount of free space in the first partition and the second partition and on a type of garbage collection process that is initiated.
10 . The data storage device of claim 9 , wherein the storage balancing system is further operable to determine whether a hybrid memory block that is included in the garbage collection process is replaceable by a second type of memory block of the plurality of the second type of memory blocks.
11 . The data storage device of claim 10 , wherein the second type of memory block of the plurality of the second type of memory blocks is selected based, at least in part, on a number of program/erase (P/E) cycles associated with the second type of memory block.
12 . The data storage device of claim 9 , wherein the type of garbage collection process includes one of a compaction process and a folding process.
13 . The data storage device of claim 12 , wherein selecting the ratio of the first type of memory blocks to the hybrid memory blocks to include in the garbage collection process is based, at least in part, on whether the garbage collection process includes the compaction process or the folding process.
14 . The data storage device of claim 9 , wherein the ratio is a first ratio when the amount of free space in the first partition and the second partition is below a first threshold and wherein the ratio is a second ratio when the amount of free space in the first partition and the second partition is below a second threshold that is less than the first threshold.
15 . A data storage device, comprising:
means for determining an amount of free space in a first partition and a second partition of the data storage device, the first partition comprising a plurality of a first type of memory blocks and the second partition comprising a plurality of a second type of memory blocks and a plurality of hybrid memory blocks;
means for initiating a garbage collection process based, at least in part, on the amount of free space in the first partition and the second partition; and
means for selecting a ratio of the first type of memory blocks to hybrid memory blocks to include in the garbage collection process based, at least in part, on the amount of free space in the first partition and the second partition and on a type of garbage collection process that is initiated by the means for initiating the garbage collection process.
16 . The data storage device of claim 15 , further comprising means for determining whether a hybrid memory block that is included in the garbage collection process is replaceable by a second type of memory block of the plurality of the second type of memory blocks.
17 . The data storage device of claim 16 , wherein the second type of memory block of the plurality of the second type of memory blocks is selected based, at least in part, on a number of program/erase (P/E) cycles associated with the second type of memory block.
18 . The data storage device of claim 15 , wherein the first type of memory blocks are single-level cell (SLC) memory blocks and the second type of memory blocks are selected from a group of memory blocks comprising multi-level cell (MLC) memory blocks, triple-level (TLC) memory blocks, quad-level cell (QLC) memory blocks, and penta-level cell (PLC) memory blocks.
19 . The data storage device of claim 15 , wherein the type of garbage collection process initiated by the means for initiating the garbage collection process includes one of a compaction process and a folding process.
20 . The data storage device of claim 15 , wherein the means for selecting the ratio selects the ratio of the first type of memory blocks to the hybrid memory blocks to include in the garbage collection process based, at least in part, on whether the garbage collection process includes a compaction process or a folding process.