1. Field of the Invention
The present invention relates to a method of managing a non-volatile memory and a non-volatile storage device using the same, and more particularly, to a method of managing a non-volatile memory which is capable of writing data and mapping information into a memory page by a programming operation on the memory page and a non-volatile storage device using the same.
2. Description of the Prior Art
In a typical non-volatile storage device, the host usually manages the non-volatile memory based on a unit of sector, and the minimum programming unit of the non-volatile memory is usually determined based on a unit of a memory page. Traditionally, the size of a sector is defined to be equal to the size of a memory page, so that the programming efficiency can be maximized when page mapping is utilized. When the host needs to write a sector of data into the non-volatile memory, the data can be written into an entire memory page using page mapping, and no space in the memory page is wasted.
In recent years, with higher requirements for large storage space, the size of non-volatile memory is increased continuously, and the size of memory page is correspondingly increased. However, the sector size remains without notable change. In such a condition, when a sector of data within a memory page needs to be updated, this sector of updated data should be written into a new memory page and there will be redundant memory space in the new memory page required to be filled with other data in the original memory page, which causes a waste of memory space and reduction of programming efficiency. For example, please refer to
In a typical non-volatile memory, data is written into a memory page in a programming operation, and such data may be a user data, mapping information of user data, garbage collection data, or wear-leveling data, etc. Different types of data among these data may be programmed into different memory pages. For example, when a sector of user data needs to be written into the non-volatile memory, the mapping information corresponding to the data should be updated accordingly; hence at lease 2 memory pages are assigned to process the user data (1 page for user data and 1 page for mapping information). In such a condition, the memory page used to store the user data may be wasted and the writing operation may need further programming operation for updating the mapping information. Therefore, the programming capability of the memory controller may not be utilized efficiently. Thus, there is a need for improvement over the prior art.
It is therefore an objective of the present invention to provide a method of managing a non-volatile memory which is capable of writing data and mapping information into a memory page by a programming operation.
The present invention discloses a method of managing a non-volatile memory. The non-volatile memory comprises a plurality of memory blocks, and each of the plurality of memory blocks comprises a plurality of memory pages. The method comprises partitioning a memory page among the plurality of memory pages into a plurality of clusters; and writing data and a mapping information corresponding to the data into different clusters of the plurality of clusters.
The present invention further discloses a non-volatile storage device, which comprises a non-volatile memory and a memory controller. The non-volatile memory comprises a plurality of memory blocks, each comprising a plurality of memory pages. The memory controller, coupled to the non-volatile memory, is utilized for managing the non-volatile memory by executing the following steps: partitioning a memory page among the plurality of memory pages into a plurality of clusters; and writing data and a mapping information corresponding to the data into different clusters of the plurality of clusters.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
In the prior art, when a sector of data (4 kB) needs to be written into a memory page (16 kB), the bandwidth of the controller 210 will be wasted, and the redundant memory space in the non-volatile memory 220 should be utilized for storing other data. On the other hand, when the size of a memory page is equal to the size of a sector, the efficiency can be maximized. Therefore, it is desirable to partition a memory page into a plurality of clusters according to the sector size, so that a sector of data can be stored in a cluster. In such a condition, the physical address of the memory page can be mapping to the logical address with a unit of cluster. For example, if the size of a memory page is equal to 16 kB and the size of a sector is equal to 4 kB, the memory page is preferably partitioned into 4 clusters, so that each sector of data can be stored in an entire cluster. In the memory page, a physical cluster is mapping to a logical cluster. As a result, each cluster can be utilized for storing a sector of data, and no memory space is wasted.
In order to efficiently utilize the memory space and the bandwidth of the memory controller 210, the clusters in each memory page should be fully occupied by useful data. In some embodiments, in each programming operation the length of user data required to be written may not be equal to 4 sectors. If there are only 2 sectors of user data required to be stored, only 2 clusters in the memory page are occupied by desired user data. In such a condition, the other 2 clusters can be utilized for storing other data such as mapping information, garbage collection data or wear-leveling data. Therefore, the data written into a memory page may include different types of data such as a user data, mapping information, garbage collection data, and wear-leveling data. As a result, different types of data may be written into a memory page in a programming operation.
For example, please refer to
In general, the mapping information M1 records the information related to the logical addresses of the user data D2-D4 mapping to the physical addresses of the corresponding clusters in the memory page P3. The mapping information M1 may also include information related to mapping from a physical address to a logical address. In some embodiments, the mapping information M1 includes the information related to mapping from the physical address of the memory page P3 to the logical addresses of the user data D2-D4. In some embodiments, the controller may use those mapping information, logical address mapping to physical address and physical address mapping to logical address, to operate garbage collection and/or wear-leveling.
Please note that, when the mapping information stored in a specific memory page includes information related to mapping of the data stored in other clusters of the specific memory page, the data and the corresponding mapping information can be updated in a programming operation. In such a condition, power-off recovery (POR) management may be performed more easily. In a conventional non-volatile memory, data and corresponding mapping information should be written into the non-volatile memory separately. Once an accidental power off occurs, the memory controller should perform POR according to whether the data has been updated and whether the corresponding mapping information has been updated. In comparison, in the non-volatile memory of the above embodiment of the present invention, data and corresponding mapping information can be written into different clusters by a programming operation. In such a condition, when an accidental power off occurs and POR needs to be performed, the question can be simplified to whether the data and corresponding mapping information have been updated; that is, the data and corresponding mapping information are inevitably updated at the same time, which significantly reduces complexity of performing POR.
In some embodiments, there may be only one sector of user data required to be stored in the non-volatile memory, and mapping information is updated correspondingly. Please refer to
Please note that the data to be filled into clusters may have a size greater than a cluster size; hence more than one cluster are required for storing the data, as shown by the memory page P42 in
For a typical non-volatile memory, the process of garbage collection involves moving valid data from a memory page to another memory page before erasing the memory block. The process of wear-leveling involves arranging data so that erasures and writes of data are distributed evenly across the non-volatile memory, in order to prolong the life of the non-volatile memory. In the conventional non-volatile memory, the data processed by the operation of garbage collection and wear-leveling may be performed individually. In comparison, in the above embodiment of the present invention, since a memory page is partitioned into clusters and each physical cluster is mapping to the logical cluster, garbage collection data and wear-leveling data can be written into different clusters of a memory page. As shown in the memory page P41 of
Please note that the above embodiments may also be applied to multi-plane programming. In some embodiments, several memory pages in different memory blocks of different planes can be combined into a super page. Please refer to
Similarly, when the size of data is greater than a cluster size, more than one cluster is required for storing the data, as shown by the super page P5B. The super page P5B is composed of memory pages P52 and P53, wherein the memory page P52 is located on the plane PL0 and the memory page P53 is located on the plane PL1. The size of each memory page is equal to 8 kB, and the unit of sector that the host manages the non-volatile memory is 4 kB; hence each of the memory pages P52 and P53 may be partitioned into 2 clusters. Mapping information and user data are stored in a cluster of the memory page P52, respectively. Garbage collection data GC3 has a size equal to 8 kB, and should occupy 2 clusters in the super page P5B. As shown in
In some embodiments with the super page, backup can be performed indifferent memory pages within the super page. Please refer to
In the conventional non-volatile storage system, when user data needs to be written into the non-volatile memory, the backup scheme is usually performed by reserving the user data in a buffer of the host until the programming is completed successfully. In such a condition, the buffer is occupied during the entire programming time. In comparison, if the user data is written into 2 memory pages in a programming operation, one of the memory pages can be considered as a backup. In such a condition, the buffer of the host can be released after the host commands the memory controller to program, which significantly reduces the requirement of buffer space usage.
Please refer to
Please note that, the present invention is capable of partitioning a memory page into clusters according to the size of sector that the host manages the non-volatile memory, and writing different types of data into different clusters. Those skilled in the art can make modifications and alternations accordingly. For example, in a programming operation, the written data can be any types of data according to system requirements, which may be but not limited to user data, garbage collection data, wear-leveling data or mapping information corresponding to each kind of data. In addition, the placement of these data in different clusters may also be determined according to system requirements, e.g. POR or backup requirements.
In the prior art, when a sector of data within a memory page needs to be updated, this sector of updated data should be written into a new memory page and there will be redundant memory space in the new memory page required to be filled with other data in the original memory page, which causes a waste of memory space and reduction of programming efficiency. Besides, only one type of data can be written into a memory page in each programming operation. In comparison, the memory page can be partitioned into a plurality of clusters and each logical cluster is mapping to a physical cluster. Different types of data can be stored in different clusters in the same memory page, which enhances efficiency of bandwidth usage of the memory controller and the memory space usage. In addition, the performance of user data backup and POR management may also be enhanced.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
This application claims the benefit of U.S. Provisional Application No. 61/818,884, filed on May 2, 2013 and entitled “Address transfer & data management for a non-volatile memory”, the contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61818884 | May 2013 | US |