Embodiments of the present invention relate to a control method of a memory system and a memory system.
A storage device including a NAND flash memory as a non-volatile memory such as an SSD (solid state drive) is widely used in an electronic device and the like in recent years. The SSD is connected to a host device such as a personal computer through a communication interface such as an SAS (serial attached SCSI).
In the interface such as the SAS, a transport layer being a lower layer handles data in frame unit and an application layer being a higher layer handles the data in sector unit. It is desired to efficiently communicate the data between the transport layer and the application layer using different units in handling the data in order to improve data transfer efficiency between the SSD and the host device.
According to an embodiment, a memory system comprises a non-volatile storage unit, a first buffer, a second buffer, a first port, and a controller, the first port being capable of communicating with a first host. The controller reads first read data from the non-volatile storage unit when receiving a read request from the first host. The controller stores the first read data in the first buffer and the second buffer in first management unit. The controller transfers, when first data in second management unit is stored in the second buffer, the first data stored in the second buffer to the first host through the first port. the second management unit is larger than the first management unit. After the transfer, the controller deletes second data stored in the first buffer, the second data being the same data as the transferred first data, and stores second read data following the first read data in the first buffer and the second buffer in the first management unit.
The control method of the memory system and the memory system according to the embodiments are hereinafter described in detail with reference to the attached drawings. Meanwhile, the present invention is not limited by the embodiments.
The memory system 2 is provided with a front end serving as an SAS controller. The SAS controller includes a transport layer 3, an application layer 4, a controller 9, a physical layer 6, a link layer 7, and a pool 5. The memory system 2 is provided with a non-volatile memory and a controller of the non-volatile memory as a back end. The non-volatile memory includes a non-volatile semiconductor memory such as a NAND flash memory. The non-volatile semiconductor memory is not limited to the NAND flash memory and this may include another non-volatile semiconductor memory such as a NOR flash memory and an MRAM (magnetic random access memory). Furthermore, the non-volatile memory may be a magnetic disk, a magnetic card, a magnetic drum and the like, for example. The memory system 2 is herein provided with NAND controllers 21 to 2n as the controllers of the non-volatile memories and NAND chips 11 to 1n as the non-volatile memories, for example. Meanwhile, the transport layer 3, the application layer 4, and the controller 9 may form one controller as a whole.
In the application layer 4, data is handled in sector unit (first management unit). In contrast, in the physical layer 6, the link layer 7, and the transport layer 3, the data is handled in frame unit (second management unit). Data unit of one sector is smaller than the data unit of one frame. The data unit of one sector may have values of 512 bytes, 520 bytes, and 528 bytes, for example, but the data unit of one frame is defined as 1024 bytes at a maximum in the SAS standard, for example. A case in which the data unit of one sector is 520 bytes is hereinafter described as an example.
The transport layer 3 is provided with three frame buffers 31 to 33 each of which is a buffer capable of storing the data in the frame unit. The number of the frame buffers is not necessarily three. A link is opened between the memory system 2 and the host 1 and the data stored in the frame buffers 31 to 33 is transferred to the host 1 through the link layer 7 and the physical layer 6. The application layer 4 is provided with a sector buffer 41 being a buffer capable of storing the data in the sector unit. The pool 5 is provided with pool buffers 51 to 54 each of which is a buffer capable of storing the data in the frame unit. The sector buffer 41 may store the same data in the frame buffers 31 to 33 and the pool buffers 51 to 54 in the sector unit.
A TAG as an identifier uniquely assigned for each read command from the host 1 is related to read data from the NAND chips 11 to 1n. For example, there is a case in which all of the frame buffers 31 to 33 are used for the read data of the same TAG and a case in which the frame buffers 31 to 33 are used for the read data of the different TAGs. In contrast, the pool buffers 51 to 54 are used for the read data of the different TAGs. Although four pool buffers 51 to 54 are illustrated for the sake of simplification in this embodiment, the number of the pool buffers may be the same as the number of types of the TAGs, for example, 64.
The control method of the memory system 2 is hereinafter described with reference to a flowchart in
First, the application layer 4 stores the data stored in the sector buffer 41 in the frame buffer 31 and the pool buffer 51 in the sector unit, for example (step S101). A state at that time is illustrated in
At step S103, the transport layer 3 determines whether the one frame of data is stored in the frame buffer 31 or whether last data smaller than one frame out of the read data corresponding to the read command received from the host is stored in the frame buffer 31. When the one frame of data is stored or when the last data smaller than one frame of the read data is stored in the frame buffer 31 (step S103: Yes), the transport layer 3 transfers the data stored in the frame buffer 31 to the host 1 and discards the data in the frame buffer 31 (step S104). According to this, only the frame which finally transfers the data transmitted by one read command from the host 1 is required to transfer the data smaller than one frame. At that time, since the same data as the data transferred from the frame buffer 31 to the host 1 is stored in the pool buffer 51, the controller 9 discards the data in the pool buffer 51 (step S104). When a condition at step S103 is not satisfied (step S103: No), the procedure returns to step S101.
After step S104, the controller 9 determines whether the read transfer is completed at step S105. Specifically, it is determined whether the transfer to the host 1 of the read data having a data transfer length indicated by the read command from the host 1 is completed. If this is not completed (step S105: No), the procedure returns to step S101, and when this is completed (step S104: Yes), the procedure is finished.
When the interruption occurs at step S102 (step S102: Yes), the procedure shifts to step S106. The interruption refers to a situation in which the read data following the read data normally stored in the sector buffer 41 does not arrive at the sector buffer 41 due to detection and correction of a data error at the back end such as the NAND controllers 21 to 2n and the NAND chips 11 to 1n and the detection and correction of the data error at the application layer 4, for example. There also is a case in which the transport layer 3 requires the application layer 4 to interrupt by an instruction from the host 1, for example. Such an SAS command includes AIP (arbitration in progress) and the like as an example.
When the interruption occurs, the transport layer 3 transfers all data in the frame unit stored in the frame buffers 31 to 33 to the host 1 through the link layer 7 and the physical layer 6, and the application layer 4 stores the data in the sector buffer 41 not yet transferred smaller than one frame in the frame buffer 31 and the pool buffer 51, for example, in the sector unit as illustrated in
Thereafter, the controller 9 resolves a cause of the above-described interruption and the controller 9 determines whether a correcting process of the data error is completed in order to determine whether the data transfer may be started again (step S108). When the correcting process of the data error is not completed (step S108: No), the procedure returns to step S108, and when the correcting process is completed (step S108: Yes), the controller 9 copies the data not yet transferred smaller than one frame remaining in the pool buffer 51 to the frame buffer 31 as illustrated in
According to the first embodiment, when sector data is stored in the frame buffer, it becomes possible to discard the data in the frame buffer when the transfer is interrupted by storing the copy of the data stored in the frame buffer at that time in the pool buffer. When the transfer is started again, it is not required to unnecessarily open the link by following a procedure to store the data stored in the pool buffer in the frame buffer and add the sector data to the frame buffer and the pool buffer. That is to say, it becomes possible to reduce frequency of the link opening, thereby improving data transfer efficiency of the memory system by keeping the data smaller than one frame in the pool and minimizing the transfer of the frame including the data smaller than one frame.
Operation similar to that of the first embodiment may be executed in response to the read command from a specific host such as the host 11 by using the frame buffer 311 and the pool buffer 51.
For example, when the host 11 and the host 12 are the same host, that is to say, when one host is connected to two ports of the memory system 21, the physical layers 61 and 62 may be used. In the memory system 21, it is possible to execute read operation as in the first embodiment by using the frame buffer 311 (first buffer) of the transport layer 310 and the pool buffer 51 (second buffer). However, there is a case in which the physical layer 61 becomes unusable for some reason and data transfer is interrupted in the read operation. In such a case, in this embodiment, it is possible to continue the read operation by using the data stored in the frame buffer 321 (third buffer) of the transport layer 320 and the pool buffer 51, for example, after the interruption. Specifically, the data remaining in the pool buffer 51 at the end of interrupted read operation using the frame buffer 311 and the pool buffer 51 may be copied to the frame buffer 321 to continue the read operation. The data read to the frame buffer 321 is thereafter transferred to the host through the link layer 72 and the physical layer 62. Meanwhile, if the data remaining in the pool buffer 51 is copied to the frame buffer 311, the operation is similar to that of the first embodiment.
According to the second embodiment, a plurality of transport layers 310 to 340 is provided so as to support the multi-port connection and the shared pool buffer is used. As a result, it becomes possible to improve data transfer efficiency also in the memory system supporting the multi-port connection.
In this embodiment, the data in the cluster unit is converted to the data in the sector unit by using the sector buffers 401 to 408 and the pool buffers 8.
That is to say, the NAND controller 21 stores the read data from the NAND chip 11 to both the sector buffers 401 to 408 and the pool buffer 81 in the cluster unit. When transfer of one cluster of data to the sector buffers 401 to 408 is completed, the controller 9 clears the data in the pool buffer 81. Therefore, when an interruption occurs when only the data smaller than eight sectors is read to the sector buffers 401 to 408, one cluster of data is stored in the pool buffer 81.
The data in the sector buffers 401 to 408 is transferred to the frame buffer 31 and the pool buffer 51 each time one sector of data is complete in the order from the sector buffer 401 to the sector buffer 408. Therefore, each time the data is transferred from the sector buffers 401 to 408 to the frame buffer 31 and the pool buffer 51, the data in the sector buffers 401 to 408 is discarded by one sector. When the data transfer to the sector buffers 401 to 408 is started again after the interruption, the controller 9 copies the data not yet transferred from the sector buffers 401 to 408 to the frame buffer 31 and the pool buffer 51 out of the one cluster data in the pool buffer 81 to the sector buffers 401 to 408. Thereafter, the NAND controller 21 starts again the data transfer from the NAND chip 11.
According to the third embodiment, it becomes not necessary to read the data again from the NAND chips 11 to 1n when the data transfer is started again after the interruption of the data transfer by providing the pool buffers 81 to 8n between the application layer 4 and the NAND controllers 21 to 2n, respectively, and it becomes possible to improve data transfer efficiency from a back end to a front end of the memory system 22.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application is based upon and claims the benefit of priority from U.S. Provisional Patent Application No. 61/950,899, filed on Mar. 11, 2014; the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61950899 | Mar 2014 | US |