Data retrieval
A data storage device usually performs better when executing a sequential read command than when executing a plurality of random read commands. If the amount of data requested to be read by a plurality of random read commands in an address range is greater than a certain percentage of the address range, it may be more efficient to treat the plurality of random read commands as a sequential read command for the entire address range. After reading the entire address range, the data storage device can determine which portions of the read data should be returned in response to the plurality of random read commands.
1 . A data storage device comprising:
a memory; and
one or more processors, individually or in combination, configured to;
receive, from a requestor, a plurality of commands to read data stored non-sequentially in an address range of the memory;
determine a total size of the data requested to be read by the plurality of commands;
determine a ratio of (a) the total size of the data requested to be read by the plurality of commands and (b) a total size of the address range:
determine whether the ratio is greater than a threshold percentage of a total size of the address range; and
in response to determining that the ratio is greater than the threshold percentage of the total size of the address range:
read data stored in an entirety of the address range, wherein the data stored in the entirety of the address range comprises data requested to be read by the plurality of commands and data not requested to be read by the plurality of commands; and
respond to the plurality of commands by, for each portion of the data that is read:
determining whether the portion was requested by the plurality of commands; and
in response to determining that the portion was requested by the plurality of commands, returning that portion to the requestor:
wherein only the portions of data requested to be read by the plurality of commands are returned to the requestor.
2 . The data storage device of claim 1 , wherein the one or more processors, individually or in combination, are further configured to:
in response to determining that the ratio is not greater than the threshold percentage of the total size of the address range, execute each of the plurality of commands as individual commands.
3 . The data storage device of claim 1 , wherein the requestor comprises a plurality of cores in the data storage device.
4 . The data storage device of claim 1 , wherein the requestor comprises a host in communication with the data storage device.
5 . The data storage device of claim 1 , wherein the data stored in the entirety of the address range is read also in response to determining that there is enough cache memory available to store that data.
6 . The data storage device of claim 1 , wherein the data stored in the entirety of the address range is read also in response to determining that a flash channel workload is below a workload threshold.
7 . The data storage device of claim 1 , wherein the data stored in the entirety of the address range is read also in response to determining that a decode workload is below a decode threshold.
8 . The data storage device of claim 1 , wherein the data stored in the entirety of the address range is read also in response to determining that a data-storage-device-specific parameter and/or a memory-specific parameter is satisfied.
9 . The data storage device of claim 1 , wherein the plurality of commands is consolidated from a larger set of commands, at least some of which do not belong to the address range.
10 . The data storage device of claim 1 , wherein the data storage device comprises a compute storage system with a plurality of accelerator cores.
11 . The data storage device of claim 1 , wherein the memory comprises a three-dimensional memory.
12 . A method comprising:
performing in a data storage device comprising a memory:
receiving a plurality of read commands that fall in one region in the memory;
determining a sum of sizes of data requested to be read by the plurality of read commands;
determining a ratio of (a) the sum of the sizes of data requested to be read by the plurality of read commands and (b) a total size of the region in the memory;
determining whether the ratio is greater than a threshold percentage of the total size of the region in the memory; and
in response to determining that the ratio is greater than the threshold percentage of the total size of the region in the memory:
executing the plurality of read commands as a sequential read command for the size of the region; and
for each portion of data read by executing the plurality of read commands:
determining whether the portion of the data was requested by the plurality of read commands;
in response to determining that the portion of the data was requested by the plurality of read commands, keeping the data;
in response to determining that the portion of the data was not requested by the plurality of read commands, discarding the data.
13 . The method of claim 12 , further comprising:
in response to determining that the ratio is not greater than the threshold percentage of the total size of the region in the memory, executing the plurality of read commands as individual commands.
14 . The method of claim 12 , wherein the method is performed by a controller comprising:
an input-output command consolidation module;
a ratio calculation module;
a read command decision module; and
a data validation module.
15 . The method of claim 12 , wherein the plurality of read commands is received from a plurality of cores in the data storage device.
16 . The method of claim 12 , wherein the plurality of read commands is received from a host in communication with the data storage device.
17 . The method of claim 12 , wherein the plurality of read commands is executed as a sequential read command also in response to determining that more than a threshold amount of cache memory is available.
18 . The method of claim 12 , wherein the plurality of read commands is executed as a sequential read command also in response to determining that a flash channel workload is below a workload threshold.
19 . The method of claim 12 , wherein the plurality of read commands is executed as a sequential read command also in response to determining that a decode workload is below a decode threshold.
20 . A data storage device comprising:
a memory; and
means for;
receiving a plurality of read commands that fall in one region in the memory;
determining a sum of sizes of data requested to be read by the plurality of read commands;
determining a ratio of (a) the sum of the sizes of data requested to be read by the plurality of read commands and (b) a total size of the region in the memory;
determining whether the ratio is greater than a threshold percentage of the total size of the region in the memory; and
in response to determining that the ratio is greater than the threshold percentage of the total size of the region in the memory:
executing the plurality of read commands as a sequential read command for the size of the region; and
for each portion of data read by executing the plurality of read commands:
determining whether the portion of the data was requested by the plurality of read commands;
in response to determining that the portion of the data was requested by the plurality of read commands, keeping the data;
in response to determining that the portion of the data was not requested by the plurality of read commands, discarding the data.