Data storage system with stale data mechanism and method of operation thereof
Systems, methods and/or devices are used to enable a stale data mechanism. In one aspect, the method includes (1) receiving a write command specifying a logical address to which to write, (2) determining whether a stale flag corresponding to the logical address is set, (3) in accordance with a determination that the stale flag is not set, setting the stale flag and releasing the write command to be processed, and (4) in accordance with a determination that the stale flag is set, detecting an overlap, wherein the overlap indicates two or more outstanding write commands are operating on the same memory space.
1. A method of operation of a data storage system comprising:
receiving a write command specifying a logical address to which to write;
determining whether a stale flag corresponding to the logical address is set;
in accordance with a determination that the stale flag is not set, setting the stale flag and releasing the write command to be processed;
in accordance with a determination that the stale flag is set, detecting an overlap, wherein the overlap indicates two or more outstanding write commands are operating on the same memory space;
receiving a read command specifying a second logical address from which to read;
determining whether a second stale flag corresponding to the second logical address is set;
in accordance with a determination that the second stale flag is not set, performing the read command, wherein performing the read command includes reading data from a physical address corresponding to the second logical address, wherein the physical address is determined using a logical-to-physical table; and
in accordance with a determination that the second stale flag is set, skipping performance of the read command until the second stale flag is not set.
2. The method of claim 1 , further comprising:
in response to detecting an overlap, performing a write-merge operation in random access memory, wherein the write-merge operation consolidates the two or more outstanding write commands to the logical address.
3. The method of claim 1 , further comprising:
completing processing of the write command; and
updating the stale flag.
4. The method of claim 3 , wherein updating the stale flag includes clearing the stale flag.
5. The method of claim 3 , wherein the stale flag is a count of a number of outstanding write commands associated with a respective logical address, and updating the stale flag includes decrementing the count.
6. The method of claim 1 , wherein determining whether the stale flag corresponding to the logical address is set includes retrieving a value of the stale flag corresponding to the logical address from the logical-to-physical table.
7. The method of claim 6 , further comprising:
in accordance with a determination that the second stale flag is set, prioritizing a stale write, wherein completion of the stale write clears the second stale flag.
8. The method of claim 1 , wherein each logical address of a plurality of logical addresses has a corresponding stale flag and each stale flag is stored in the logical-to-physical table used for mapping logical addresses to physical addresses.
9. A method of operation of a data storage system, comprising:
receiving a write command specifying a logical address to which to write;
determining whether a stale flag corresponding to the logical address is set;
in accordance with a determination that the stale flag is not set, setting the stale flag and releasing the write command to be processed;
in accordance with a determination that the stale flag is set, detecting an overlap, wherein the overlap indicates two or more outstanding write commands are operating on the same memory space;
receiving a read command specifying a second logical address from which to read;
determining whether a second stale flag corresponding to the second logical address is set;
in accordance with a determination that the second stale flag is not set, performing the read command, wherein performing the read command includes reading data from a physical address corresponding to the second logical address, wherein the physical address is determined using a logical-to-physical table; and
in accordance with a determination that the second stale flag is set, servicing the read command by reading data from in-flight write data for the second logical address.
10. A data storage system comprising:
one or more processors; and
memory storing one or more programs to be executed by the one or more processors, the one or more programs comprising instructions for:
receiving a write command specifying a logical address to which to write;
determining whether a stale flag corresponding to the logical address is set;
in accordance with a determination that the stale flag is not set, setting the stale flag and releasing the write command to be processed;
in accordance with a determination that the stale flag is set, detecting an overlap, wherein the overlap indicates two or more outstanding write commands are operating on the same memory space;
receiving a read command specifying a second logical address from which to read;
determining whether a second stale flag corresponding to the second logical address is set;
in accordance with a determination that the second stale flag is not set, performing the read command, wherein performing the read command includes reading data from a physical address corresponding to the second logical address, wherein the physical address is determined using a logical-to-physical table; and
in accordance with a determination that the second stale flag is set, skipping performance of the read command until the second stale flag is not set.
11. The data storage system of claim 10 , wherein the one or more programs further comprise instructions for:
in response to detecting an overlap, performing a write-merge operation in random access memory, wherein the write-merge operation consolidates the two or more outstanding write commands to the logical address.
12. The data storage system of claim 10 , wherein the one or more programs further comprise instructions for:
completing processing of the write command; and
updating the stale flag.
13. The data storage system of claim 10 , wherein determining whether the stale flag corresponding to the logical address is set includes retrieving a value of the stale flag corresponding to the logical address from a logical-to-physical table.
14. The data storage system of claim 13 , wherein the one or more programs further comprise instructions for:
in accordance with a determination that the second stale flag is set, prioritizing a stale write, wherein completion of the stale write clears the second stale flag.
15. A data storage system comprising:
one or more processors; and
memory storing one or more programs to be executed by the one or more processors, the one or more programs comprising instructions for:
receiving a write command specifying a logical address to which to write;
determining whether a stale flag corresponding to the logical address is set;
in accordance with a determination that the stale flag is not set, setting the stale flag and releasing the write command to be processed;
in accordance with a determination that the stale flag is set, detecting an overlap, wherein the overlap indicates two or more outstanding write commands are operating on the same memory space;
receiving a read command specifying a second logical address from which to read;
determining whether a second stale flag corresponding to the second logical address is set;
in accordance with a determination that the second stale flag is not set, performing the read command, wherein performing the read command includes reading data from a physical address corresponding to the second logical address, wherein the physical address is determined using a logical-to-physical table; and
in accordance with a determination that the second stale flag is set, servicing the read command by reading data from in-flight write data for the second logical address.
16. A non-transitory computer readable storage medium, storing one or more programs configured for execution by one or more processors of a data storage system, the one or more programs including instructions for:
receiving a write command specifying a logical address to which to write;
determining whether a stale flag corresponding to the logical address is set,
in accordance with a determination that the stale flag is not set, setting the stale flag and releasing the write command to be processed;
in accordance with a determination that the stale flag is set, detecting an overlap, wherein the overlap indicates two or more outstanding write commands are operating on the same memory space;
receiving a read command specifying a second logical address from which to read;
determining whether a second stale flag corresponding to the second logical address is set;
in accordance with a determination that the second stale flag is not set, performing the read command, wherein performing the read command includes reading data from a physical address corresponding to the second logical address, wherein the physical address is determined using a logical-to-physical table; and
in accordance with a determination that the second stale flag is set, skipping performance of the read command until the second stale flag is not set.
17. The non-transitory computer readable storage medium of claim 16 , wherein the one or more programs further include instructions for:
in response to detecting an overlap, performing a write-merge operation in random access memory, wherein the write-merge operation consolidates the two or more outstanding write commands to the logical address.
18. The non-transitory computer readable storage medium of claim 16 , wherein the one or more programs further include instructions for:
completing processing of the write command; and
updating the stale flag.
19. The non-transitory computer readable storage medium of claim 16 , wherein determining whether the stale flag corresponding to the logical address is set includes retrieving a value of the stale flag corresponding to the logical address from a logical-to-physical table.
20. A non-transitory computer readable storage medium, storing one or more programs configured for execution by one or more processors of a data storage system, the one or more programs including instructions for:
receiving a write command specifying a logical address to which to write;
determining whether a stale flag corresponding to the logical address is set;
in accordance with a determination that the stale flag is not set, setting the stale flag and releasing the write command to be processed;
in accordance with a determination that the stale flag is set, detecting an overlap, wherein the overlap indicates two or more outstanding write commands are operating on the same memory space;
receiving a read command specifying a second logical address from which to read;
determining whether a second stale flag corresponding to the second logical address is set;
in accordance with a determination that the second stale flag is not set, performing the read command, wherein performing the read command includes reading data from a physical address corresponding to the second logical address, wherein the physical address is determined using a logical-to-physical table; and
in accordance with a determination that the second stale flag is set, servicing the read command by reading data from in-flight write data for the second logical address.