CPC G06F 3/0659 (2013.01) [G06F 3/064 (2013.01); G06F 3/0619 (2013.01); G06F 3/0673 (2013.01)] | 14 Claims |
1. A storage system comprising:
a memory; and
a controller coupled to the memory and configured to:
dynamically determine a size of a defragmentation unit based on an endurance of the memory;
dynamically determine a memory sense threshold based on the endurance of the memory;
analyze a logical block address range of data stored in the memory, wherein the logical block address range is analyzed in a resolution of the defragmentation unit; and
for each defragmentation unit:
determine a fragmentation level of the defragmentation unit by measuring a number of memory senses needed to read the defragmentation unit using the dynamically determined memory sense threshold;
determine if the fragmentation level is above a fragmentation threshold; and
in response to determining that the fragmentation level is above the defragmentation threshold, perform a defragmentation operation on the defragmentation unit.
|