This application claims the benefit of People's Republic of China application Serial No. 201510105384.8, filed Mar. 11, 2015, the subject matter of which is incorporated herein by reference.
1. Field of the Invention
The invention relates in general to a Solid state disk (SSD), and more particularly to a method for establishing a transition layer to manage a logical to physical (L2P) table when the SSD is activated.
2. Description of the Related Art
Solid state disk (SSD) is a storage device composed of NAND flash memory arrays. The flash memory is subjected to the erase times, and data is scattered to store in the flash memory arrays. The flash translation layer (FTL) is used to manage the correspondence relationship between the logical address of data and the physical address in which data is actually stored in the flash memory.
Referring to
In order to manage the relationship between the logical address of data and the physical address in which data is actually stored in the flash memory array 8, a flash translation layer (FTL) is established for the storage and management of a logical to physical table (L2P) table. When the SSD 5 is activated, management data of each data block is read from the flash memory array 8 to form an L2P table storing the correspondence relationship between the logical address of data and the physical address of the accessed data. When the SSD 5 is initialized, the firmware stored in the flash memory array 8 of the SSD 5 already pre-determines that the FTL is established in the buffer memory 7 or the flash memory array 8. Since the access speed of the dynamic random access memory (DRAM) is 10 times faster than that of the flash memory, the buffer memory 7 is a DRAM type buffer memory. Thus, in the prior art, the FTL is preferably established in the buffer memory 7 of the SSD 5.
Since the FTL is preferably established in the buffer memory 7 of the SSD 5 in the prior art, the FTL cannot be established once the buffer memory 7 is broken or partially damaged. If the establishing position of FTL cannot be changed, the SSD 5 can no longer use the FTL to manage L2P table of the accessed data. To the worse, the SSD 5 will fail. If the FTL of the SSD 5 is established in the flash memory array having a slower access speed, the establishing position of the FTL cannot be adjusted according to the state of the electronic device storage system, and the access speed of the SSD cannot be increased. Therefore, the SSD still has any problems to resolve when it comes to the establishment method of the transition layer.
According to an object of the present invention, a method for dynamically establishing transition layer of SSD is provided. When a SSD is activated, the storage mode of the logical to physical (L2P) table is dynamically selected according to the state in the buffer memory of the SSD and the comparison between the capacity of the buffer memory and that of the L2P table. The establishing position of flash translation layer (FTL) is suitably adjusted according to the selected storage mode such that the lifespan of the SSD can be prolonged.
To achieve the above object of the present invention, a method for dynamically establishing a transition layer of SSD is disclosed in a first embodiment of the present invention. A SSD is activated. A memory capacity of a buffer memory is obtained. A memory capacity of a flash memory array is obtained to form an estimated capacity required for storing L2P table. The pre-determined capacity of the buffer memory for storing L2P table is compared with the estimated capacity required for storing L2P table. Whether the pre-determined capacity of the buffer memory for storing L2P table is not smaller than the estimated capacity required for storing L2P table is checked. If it is determined that the pre-determined capacity of the buffer memory for storing L2P table is not smaller than the estimated capacity required for storing L2P table, the full-table storage mode is selected, and the FTL is established in the buffer memory being a DRAM-type buffer memory. If the pre-determined capacity of the buffer memory for storing L2P table is smaller than the estimated capacity required for storing L2P table, then whether the SSD includes a buffer memory is checked. If it is determined that the pre-determined capacity of the buffer memory for storing L2P table is smaller than the estimated capacity required for storing L2P table, a partial-table storage mode is selected, and part of the FTL is established in the buffer memory, and the remaining part is established in the flash memory array. If it is determined that the SSD does not include any buffer memories, then a flash memory storage mode is selected, and the FTL is established in the flash memory array.
According to another object of the present invention, a method for dynamically establishing a transition layer of SSD is provided. Based on the part of the DRAM reserved by the host, the storage mode of FTL can be dynamically selected to increase the access speed.
To achieve the above object of the present invention, a method for dynamically establishing a transition layer of SSD is disclosed in a second embodiment of the present invention. A SSD is activated. A memory capacity of a buffer memory is obtained. A memory capacity of a flash memory array is obtained to form an estimated capacity required for storing L2P table. The pre-determined capacity of the buffer memory for storing L2P table is compared with the estimated capacity required for storing L2P table. Whether the pre-determined capacity of the buffer memory for storing L2P table is smaller than the estimated capacity required for storing L2P table is checked. If the pre-determined capacity of the buffer memory for storing L2P table is smaller than the estimated capacity required for storing L2P table, then whether the SSD does not include any buffer memories is checked. If it is determined that the SSD does not include any buffer memories, when whether part of the DRAM is reserved by the host for the SSD is checked. If it is determined that part of the DRAM is reserved by the host for the SSD, then the host storage mode is selected, and the FTL is established in the part of the DRAM reserved by the host. If it is determined that no part of the DRAM is reserved by the host, then the flash memory storage mode is selected for the establishment of FTL. If it is determined that the SSD includes a buffer memory, then the partial-table storage mode is selected, part of the FTL is established in the buffer memory, and the remaining part is established in the part of the DRAM reserved by the host.
The above and other aspects of the invention will become better understood with regard to the following detailed description of the preferred but non-limiting embodiment(s). The following description is made with reference to the accompanying drawings.
The technologies and effects adopted in the present invention to the abovementioned objects are described below in a number of exemplary embodiments with accompanying drawings.
Referring to
When the electronic device storage system 10 of the present invention activates the SSD 15, the controller 16 estimates the capacity required for forming an L2P table according to the memory capacity of the flash memory array 18. The transition layer selection unit 19 compares the pre-determined capacity of the buffer memory 17 for storing L2P table with the estimated capacity required for storing L2P table to determine the position for the establishment of FTL. Since the access speed of the DRAM-type buffer memory 17 is 10 times faster than that of the flash memory, the transition layer selection unit 19 preferably establishes the FTL in the buffer memory 17. The transition layer selection unit 19 compares the pre-determined capacity of the buffer memory 17 for storing L2P table with the estimated capacity required for storing L2P table. If it is determined that the pre-determined capacity of the buffer memory 17 for storing L2P table is not smaller than the estimated capacity required for storing L2P table, then the transition layer selection unit 19 selects the full-table storage mode (full L2P table mapping method), and establishes the entire FTL 20 in the buffer memory 17. The transition layer selection unit 19 further notices the controller 16 to read the management data of each data block from the flash memory array 18 to form an L2P table, which is entirely stored in the buffer memory 17. When the controller 16 receives the logical address of the accessed data from the host 11, the controller 16 controls the FTL for storing L2P table in the buffer memory 17 to quickly access data from the physical address of data stored in the flash memory array 18 corresponding to the logical address of the accessed data.
Referring to
When accessing data, if the controller 16 controls the FTL and finds out that the corresponding L2P table of the accessed data does not exist in the buffer memory 17, the controller 16 needs to delete part of the L2P table originally stored in the buffer memory 17 to free the storage space. Then, the controller 16 reads the correspondence relationship of the data from the L2P table stored in the flash memory array 18, and stores the correspondence relationship to the freed storage space of the buffer memory 17 for the access of data. In the partial-table storage mode, data needs to be exchanged between the buffer memory 17 and the flash memory array 18. Thus, the access speed in the partial-table storage mode is slower than that in the full-table storage mode.
Referring to
According to the method for dynamically establishing a transition layer of SSD disclosed in the first embodiment of the present invention, when the SSD is activated, the FTL is preferably established in the buffer memory to increase the access speed according to the state in the buffer memory of the SSD and the comparison between the capacity of the buffer memory and that of the L2P table, and the storage mode of the L2P table is dynamically selected. Thus, when the buffer memory is broken or partly damaged, the establishing position of the FTL is suitably adjusted, such that normal operation of the SSD can be maintained and the lifespan of the SSD can be prolonged.
As indicated in
According to the method for dynamically establishing a transition layer of SSD disclosed in the second embodiment of the present invention, the transition layer selection unit 19 compares the pre-determined capacity of the buffer memory for storing L2P table with the estimated capacity required for storing L2P table. if it is determined that the pre-determined capacity of the buffer memory for storing L2P table is smaller than the estimated capacity required for storing L2P table, the transition layer selection unit 19 further checks whether the SSD 15 includes a buffer memory. If it is determined that the SSD 15 includes a buffer memory, the transition layer selection unit 19 selects the partial-table storage mode, part of the FTL is established in the buffer memory, and the remaining part is established in the part of the DRAM 13 reserved by the host 11 to increase the data access speed.
According to the method for dynamically establishing a transition layer of SSD disclosed in the second embodiment of the present invention, by checking whether the host reserves part of the DRAM for the SSD to use and checking the state of the DRAM of the host, the FTL which should originally be established in the flash memory array can now be dynamically adjusted and established in the part of the DRAM reserved by the host to increase the access speed.
While the invention has been described by way of example and in terms of the preferred embodiment(s), it is to be understood that the invention is not limited thereto. On the contrary, it is intended to cover various modifications and similar arrangements and procedures, and the scope of the appended claims therefore should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements and procedures.
Number | Date | Country | Kind |
---|---|---|---|
201510105384.8 | Mar 2015 | CN | national |