Method and apparatus for erasing a memory device
In response to receiving a read request while non-volatile memory is performing an erase operation, a solid state drive (SSD) device controller suspends the erase operation to permit the non-volatile memory to execute a read operation corresponding to the read request. The SSD device controller determines a time delay for suspending the erase operation based on a metric that indicates a degree of completeness of the erase operation, and delays suspending the erase operation for the determined time delay when the determined time delay is non-zero.
1 . A solid state drive (SSD) device, comprising:
non-volatile memory; and
an SSD device controller coupled to the non-volatile memory, the SSD device controller configured to:
operate in a first operating mode in which the SSD device controller begins suspending erase operations without delay,
operate in a second operating mode in which the SSD device controller delays starting the suspending of erase operations,
while performing an erase operation, calculate a parameter that corresponds to a comparison of i) a first metric that measures a degree of completeness of the erase operation relative to a total duration of the erase operation, and ii) a second metric that indicates a number of suspend operations that have already been performed during the erase operation,
perform a comparison of the parameter to a threshold,
determine whether to operate in the second operating mode using the comparison of the parameter to the threshold, and
in response to receiving a read request while the non-volatile memory is performing the erase operation,
suspend the erase operation to permit the non-volatile memory to execute a read operation corresponding to the read request, including delaying the start of suspending the erase operation for a time delay when operating in the second operating mode.
2 . The SSD device of claim 1 , wherein:
the first metric is a percentage of completion of the erase operation; and
the second metric is a percentage of suspend operations that were already performed during the erase operation with respect to a maximum number of suspend operations that the non-volatile memory is permitted to perform during each erase operation.
3 . The SSD device of claim 2 , wherein the SSD device controller is configured to:
calculate the parameter based on calculating a difference between the first metric and the second metric.
4 . The SSD device of claim 1 , wherein the SSD device controller is configured to:
when operating in the second operating mode, select, using the first metric and the second metric, a value of the time delay from a set of multiple time delay values that includes multiple predetermined non-zero values.
5 . The SSD device of claim 1 , wherein the SSD device controller is configured to:
when operating in the second operating mode, calculate a value of the time delay using the first metric and the second metric.
6 . The SSD device of claim 1 , wherein the SSD device controller is configured to:
when operating in the second operating mode, select, using the first metric that indicates the degree of completeness of the erase operation, a value of the time delay from a set of multiple time delay values that includes multiple predetermined non-zero values.
7 . The SSD device of claim 1 , wherein the SSD device controller is configured to:
when operating in the second operating mode, calculate a value of the time delay using the first metric that indicates the degree of completeness of the erase operation.
8 . The SSD device of claim 1 , wherein the comparison of the parameter to the threshold is a first comparison of the parameter to a first threshold, and wherein the SSD device controller is configured to:
perform the first comparison of the parameter to the first threshold while operating in the first operating mode;
determine whether to switch from the first operating mode to the second operating mode using the first comparison of the parameter to the first threshold;
perform a second comparison of the parameter to a second threshold while operating in the second operating mode; and
determine whether to switch from the second operating mode to the first operating mode using the second comparison of the parameter to the second threshold.
9 . The SSD device of claim 1 , wherein the comparison of the parameter to the threshold is a first comparison of a first parameter to a first threshold, and wherein the SSD device controller is configured to:
while performing an erase operation, calculate a second parameter that corresponds to another comparison of i) the first metric, and ii) the second metric;
perform the first comparison of the first parameter to the first threshold while operating in the first operating mode;
determine whether to switch from the first operating mode to the second operating mode using the first comparison of the parameter to the first threshold;
perform a second comparison of the second parameter to a second threshold while operating in the second operating mode; and
determine whether to switch from the second operating mode to the first operating mode using the second comparison of the second parameter to the second threshold.
10 . A method for performing memory operations in a solid state drive (SSD) device that comprises non-volatile memory, the method comprising:
operating an SSD device controller of the SSD device in a first operating mode in which the SSD device controller begins suspending erase operations without delay;
operating the SSD device controller in a second operating mode in which the SSD device controller delays starting the suspending of erase operations;
while performing an erase operation, calculating, by the SSD device controller, a parameter that corresponds to a comparison of i) a first metric that measures a degree of completeness of the erase operation relative to a total duration of the erase operation, and ii) a second metric that indicates a number of suspend operations that have already been performed during the erase operation;
performing, by the SSD device controller, a comparison of the parameter to a threshold;
determining, by the SSD device controller, whether to operate in the second operating mode using the comparison of the parameter to the threshold; and
in response to receiving a read request while the non-volatile memory is performing the erase operation,
suspending the erase operation to permit the non-volatile memory to execute a read operation corresponding to the read request, including delaying the start of suspending the erase operation for a time delay when operating in the second operating mode.
11 . The method of claim 10 , wherein:
the first metric is a percentage of completion of the erase operation; and
the second metric is a percentage of suspend operations that were already performed during the erase operation with respect to a maximum number of suspend operations that the non-volatile memory is permitted to perform during each erase operation.
12 . The method of claim 11 , wherein calculating the parameter comprises:
calculating the parameter based on calculating a difference between the first metric and the second metric.
13 . The method of claim 10 , further comprising, when operating in the second operating mode:
selecting, using the first metric and the second metric, a value of the time delay from a set of multiple time delay values that includes multiple predetermined non-zero values.
14 . The method of claim 10 , further comprising, when operating in the second operating mode:
calculating a value of the time delay using the first metric and the second metric.
15 . The method of claim 10 , further comprising, when operating in the second operating mode:
selecting, using the first metric that indicates the degree of completeness of the erase operation, a value of the time delay from a set of multiple time delay values that includes multiple predetermined non-zero values.
16 . The method of claim 10 , further comprising, when operating in the second operating mode:
calculating the value of the time delay using the first metric that indicates the degree of completeness of the erase operation.
17 . The method of claim 10 , wherein the comparison of the parameter to the threshold is a first comparison of the parameter to a first threshold, and wherein the method further comprises:
performing the first comparison of the parameter to the first threshold while operating in the first operating mode;
determining, at the SSD device controller, whether to switch from the first operating mode to the second operating mode using the first comparison of the parameter to the first threshold;
performing, at the SSD device controller, a second comparison of the parameter to a second threshold while operating in the second operating mode; and
determining, at the SSD device controller, whether to switch from the second operating mode to the first operating mode using the second comparison of the parameter to the second threshold.
18 . The method of claim 10 , wherein the comparison of the parameter to the threshold is a first comparison of a first parameter to a first threshold, and wherein the SSD device controller is configured to:
while performing an erase operation, calculating, at the SSD device controller, a second parameter that corresponds to another comparison of i) the first metric, and ii) the second metric;
performing the first comparison of the first parameter to the first threshold while operating in the first operating mode;
determining, at the SSD device controller, whether to switch from the first operating mode to the second operating mode using the first comparison of the parameter to the first threshold;
performing, at the SSD device controller, a second comparison of the second parameter to a second threshold while operating in the second operating mode; and
determining, at the SSD device controller, whether to switch from the second operating mode to the first operating mode using the second comparison of the second parameter to the second threshold.