TW202011199A - Data storage device and control method for non-volatile memory - Google Patents
Data storage device and control method for non-volatile memory Download PDFInfo
- Publication number
- TW202011199A TW202011199A TW108107913A TW108107913A TW202011199A TW 202011199 A TW202011199 A TW 202011199A TW 108107913 A TW108107913 A TW 108107913A TW 108107913 A TW108107913 A TW 108107913A TW 202011199 A TW202011199 A TW 202011199A
- Authority
- TW
- Taiwan
- Prior art keywords
- data
- block
- source block
- controller
- volatile memory
- Prior art date
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Memory System (AREA)
- Read Only Memory (AREA)
Abstract
Description
本案係有關於非揮發式記憶體之控制。This case is about the control of non-volatile memory.
非揮發式記憶體有多種形式─例如,快閃記憶體(flash memory)、磁阻式隨機存取記憶體(Magnetoresistive RAM)、鐵電隨機存取記憶體(Ferroelectric RAM)、電阻式隨機存取記憶體(Resistive RAM)、自旋轉移力矩隨機存取記憶體(Spin Transfer Torque-RAM, STT-RAM)…等,用於長時間資料保存,可做為儲存媒體實現一資料儲存裝置。There are many forms of non-volatile memory-for example, flash memory (flash memory), magnetoresistive random access memory (Magnetoresistive RAM), ferroelectric random access memory (Ferroelectric RAM), resistive random access Memory (Resistive RAM), spin transfer torque random access memory (Spin Transfer Torque-RAM, STT-RAM), etc., used for long-term data storage, can be used as a storage medium to achieve a data storage device.
非揮發式記憶體通常有其特殊的儲存特性。本技術領域需要相應非揮發式記憶體的儲存特性發展相應的控制技術。Non-volatile memory usually has its special storage characteristics. The technical field needs to develop corresponding control technologies for the storage characteristics of the corresponding non-volatile memory.
根據本案一種實施方式所實現的一資料儲存裝置包括一非揮發式記憶體以及一控制器。該控制器根據一主機之要求操作該非揮發式記憶體。該控制器自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料。該控制器更以該主動區塊作為該非揮發式記憶體中一第一來源區塊的有效資料的搬移目的地。該控制器以複數批次搬移該第一來源區塊的有效資料至該主動區塊,並在不同批次間允許該主機要求的寫入資料填入該主動區塊。該控制器在沒有一第二來源區塊存在時,令搬移該第一來源區塊的上述批次各自搬移一第一資料量。該控制器在存在該第二來源區塊時,令搬移該第一來源區塊的上述批次各自搬移一第二資料量。該第二資料量高於該第一資料量。A data storage device implemented according to an embodiment of the present case includes a non-volatile memory and a controller. The controller operates the non-volatile memory according to the requirements of a host. The controller configures an active block from a plurality of idle blocks of the non-volatile memory to fill in the write data requested by the host. The controller further uses the active block as a transfer destination of valid data of a first source block in the non-volatile memory. The controller moves the valid data of the first source block to the active block in a plurality of batches, and allows write data requested by the host to be filled into the active block between different batches. When there is no second source block, the controller causes each batch of the first source block to move a first amount of data. When the second source block exists, the controller causes the batches moving the first source block to move a second amount of data. The second data volume is higher than the first data volume.
一種實施方式中,該控制器在更存在一第三來源區塊時,調升該第二資料量。In one embodiment, the controller increases the second data amount when there is a third source block.
一種實施方式中,該控制器令該第一來源區塊的有效資料完全搬移到該主動區塊後,方允許該第二來源區塊的有效資料搬移到該主動區塊。In one embodiment, the controller allows the effective data of the first source block to be completely moved to the active block before allowing the effective data of the second source block to be moved to the active block.
一種實施方式中,該控制器是在搬移該第一來源區塊的有效資料之初,就設定搬移該第一來源區塊的上述批次各自搬移的資料量。In one embodiment, the controller sets the amount of data to be moved by the batch of the first source block at the beginning of moving the valid data of the first source block.
一種實施方式中,該控制器根據該第一來源區塊的有效頁數x以及該主動區塊的閒置頁數y估算一比例x:(y-x),等效為1:n。該控制器根據來源區塊的總數設定一數值a。該控制器在僅該第一來源區塊存在時,設定該數值a為一常態值,並在不只該第一來源區塊存在時,設定該數值a大於該常態值。該控制器以一比例a:n實行該第一來源區塊一批次的搬移以及該主機要求的寫入資料之寫入。In one embodiment, the controller estimates a ratio x:(y-x) based on the number of valid pages x of the first source block and the number of idle pages y of the active block, which is equivalent to 1:n. The controller sets a value a based on the total number of source blocks. The controller sets the value a to a normal value when only the first source block exists, and sets the value a to be greater than the normal value when not only the first source block exists. The controller implements a batch of movement of the first source block and a writing of writing data requested by the host at a ratio of a:n.
一種實施方式中,該控制器更根據該非揮發式記憶體程式化的反應時間設定一數值M。該控制器自該第一來源區塊搬移a*M頁有效資料至該主動區塊後,允許該主機要求的n*M頁寫入資料填入該主動區塊。In one embodiment, the controller further sets a value M according to the programmed reaction time of the non-volatile memory. After the controller transfers a*M pages of valid data from the first source block to the active block, the controller allows n*M pages requested by the host to write data to fill in the active block.
一種實施方式中,該控制器估算上述數值a*M以及n*M後,先搬移a*M頁有效資料至該主動區塊,方允許該主機要求的n*M頁寫入資料填入該主動區塊。In one embodiment, after the controller estimates the above values a*M and n*M, it first moves a*M pages of valid data to the active block before allowing the host to write n*M pages of data to fill in the Active block.
一種實施方式中,來源區塊之選定,係因應該等閒置區塊之數量小於一臨界數量、或發現錯誤更正失效、或進行預防性搬移、或滿足損耗平均。In one embodiment, the source block is selected due to the fact that the number of idle blocks should be less than a critical number, or that an error correction or failure is found, or a preventive move is performed, or the loss average is met.
一種實施方式中,該控制器將該第一來源區塊的有效資料全數搬移到該主動區塊後,是在該主動區塊完成結尾寫入前釋出該第一來源區塊為閒置區塊。In one embodiment, the controller transfers all the valid data of the first source block to the active block, and then releases the first source block as an idle block before the active block completes the end writing .
以上控制器對非揮發式記憶體之操作也可以由其他結構實現。本案更可以前述概念實現非揮發式記憶體的控制方法,包括:根據一主機之要求操作一非揮發式記憶體;自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料;更以該主動區塊作為該非揮發式記憶體中一第一來源區塊的有效資料的搬移目的地;以複數批次搬移該第一來源區塊的有效資料至該主動區塊,並在不同批次間允許該主機要求的寫入資料填入該主動區塊;在沒有一第二來源區塊存在時,令搬移該第一來源區塊的上述批次各自搬移一第一資料量;且在存在該第二來源區塊時,令搬移該第一來源區塊的上述批次各自搬移一第二資料量。該第二資料量高於該第一資料量。The operation of the above controller on the non-volatile memory can also be realized by other structures. In this case, the non-volatile memory control method can be implemented by the aforementioned concept, including: operating a non-volatile memory according to the requirements of a host; configuring a plurality of idle blocks from the non-volatile memory with an active block to fill in the host Requested write data; use the active block as the destination of the effective data of a first source block in the non-volatile memory; move the effective data of the first source block to the active in multiple batches Block, and allow the write data requested by the host to be filled into the active block between different batches; when there is no second source block, make the batches that move the first source block move one each The first data amount; and when the second source block exists, the batches moving the first source block are each moved a second data amount. The second data volume is higher than the first data volume.
下文特舉實施例,並配合所附圖示,詳細說明本發明內容。The following describes the embodiments in detail and the accompanying drawings to explain the content of the present invention in detail.
以下敘述列舉本發明的多種實施例。以下敘述介紹本發明的基本概念,且並非意圖限制本發明內容。實際發明範圍應依照申請專利範圍界定之。The following description lists various embodiments of the present invention. The following description introduces the basic concept of the present invention and is not intended to limit the content of the present invention. The actual scope of invention shall be defined in accordance with the scope of patent application.
非揮發式記憶體可以是快閃記憶體(Flash Memory)、磁阻式隨機存取記憶體(Magnetoresistive RAM)、鐵電隨機存取記憶體(Ferroelectric RAM)、電阻式記憶體(Resistive RAM,RRAM)、自旋轉移力矩隨機存取記憶體(Spin Transfer Torque-RAM, STT-RAM)…等,提供長時間資料保存之儲存媒體。以下特別以快閃記憶體為例進行討論。Non-volatile memory can be flash memory (Flash Memory), magnetoresistive random access memory (Magnetoresistive RAM), ferroelectric random access memory (Ferroelectric RAM), resistive memory (Resistive RAM, RRAM ), spin transfer torque random access memory (Spin Transfer Torque-RAM, STT-RAM), etc., provide storage media for long-term data storage. The following uses flash memory as an example for discussion.
現今資料儲存裝置常以快閃記憶體為儲存媒體,用以儲存來自於主機的使用者資料。資料儲存裝置的種類眾多,包括記憶卡(Memory Card)、通用序列匯流排閃存裝置(USB Flash Device)、固態硬碟(SSD) …等產品。有一種應用是採多晶片封裝、將快閃記憶體與其控制器包裝在一起─稱為嵌入式快閃記憶體模組(如eMMC)。Today's data storage devices often use flash memory as a storage medium to store user data from the host. There are many types of data storage devices, including products such as Memory Card, USB Flash Device, Solid State Drive (SSD), etc. One application is to use a multi-chip package to package the flash memory and its controller—called an embedded flash memory module (such as eMMC).
以快閃記憶體為儲存媒體的資料儲存裝置可應用於多種電子裝置中。所述電子裝置包括智慧型手機、穿戴裝置、平板電腦、虛擬實境設備…等。電子裝置的運算模塊可視為主機(Host),操作所使用的資料儲存裝置,以存取其中快閃記憶體。A data storage device using flash memory as a storage medium can be applied to various electronic devices. The electronic device includes a smart phone, a wearable device, a tablet computer, a virtual reality device, etc. The computing module of the electronic device can be regarded as a host, which operates the data storage device used to access the flash memory.
以快閃記憶體為儲存媒體的資料儲存裝置也可用於建構數據中心。例如,伺服器可操作固態硬碟(SSD)陣列形成數據中心。伺服器即可視為主機,操作所連結之固態硬碟,以存取其中快閃記憶體。A data storage device using flash memory as a storage medium can also be used to construct a data center. For example, a server may operate a solid state drive (SSD) array to form a data center. The server can be regarded as a host, operating the connected solid-state drive to access the flash memory.
第1圖根據本案一種實施方式圖解資料儲存裝置100。資料儲存裝置100包括快閃記憶體102以及控制器104。主機106透過控制器104而間接存取快閃記憶體102。控制器104除了接收及執行來自主機(Host)106的寫入命令,更主動搬移快閃記憶體102所儲存的使用者資料。FIG. 1 illustrates the data storage device 100 according to an embodiment of the present case. The data storage device 100 includes a flash memory 102 and a
快閃記憶體有其特殊的儲存特性,以下敘述之。Flash memory has its special storage characteristics, described below.
主機106端是以邏輯位址(例如,邏輯區塊位址LBA或全域主機頁編號GHP…等)區別使用者資料。快閃記憶體102之物理空間則是劃分為複數個區塊(Blocks)配置使用。各區塊(Block)包括複數頁(Pages)。各頁包括N個區段(Sectors),N為大於一的整數,如:4。16KB空間的頁可分為四個區段,各區段為4KB。一種實施方式中,一區塊係根據頁編號,由低至高編號配置來儲存資料。The
一種實施方式中,資料儲存裝置採用多通道技術,可將不同通道的多個區塊可以虛擬成一個超級區塊,多個頁面可以虛擬成一個超級頁面,並以超級區塊、超級頁面進行資料儲存空間的管理,可加快資料儲存裝置的資料吞吐量。In one embodiment, the data storage device adopts multi-channel technology, which can virtualize multiple blocks of different channels into a super block, and multiple pages can be virtualized into a super page, and use super blocks and super pages to perform data Storage space management can speed up the data throughput of data storage devices.
資料儲存裝置將使用者資料的邏輯位址與物理位址的對應關係記錄在邏輯-物理位址映射表(Logical-Physical Mapping Table,L2P Table)中。The data storage device records the correspondence between the logical address and the physical address of the user data in a logical-physical mapping table (Logical-Physical Mapping Table, L2P Table).
快閃記憶體102的儲存空間需先抹除方能再次使用,抹除(Erase)的最小單位為區塊。區塊可區分成資料區塊、主動區塊以及閒置區塊。閒置區塊可作為主動區塊以寫入使用者資料。當主動區塊寫滿使用者資料後,經過關閉處理(寫入EOB(End of Block)資訊),主動區塊變更為資料區塊。隨著使用者資料的更新,部份儲存在資料區塊的使用者資料會由有效資料變更為無效資料。當資料區塊所儲存的使用者資料皆為無效資料時,經抹除處理後則變更為閒置區塊。在另一種實施例中,充滿無效資料的資料區塊會變更為閒置區塊,而抹除處理乃等到閒置區塊作為主動區塊時再予以執行。The storage space of the flash memory 102 needs to be erased before it can be used again. The smallest unit of erase (Erase) is a block. Blocks can be divided into data blocks, active blocks and idle blocks. Idle blocks can be used as active blocks to write user data. After the active block is filled with user data, after the closing process (writing EOB (End of Block) information), the active block is changed to a data block. With the update of user data, some user data stored in the data block will be changed from valid data to invalid data. When the user data stored in the data block is all invalid data, it will be changed to an idle block after being erased. In another embodiment, the data block filled with invalid data will be changed to an idle block, and the erasing process will not be executed until the idle block is used as the active block.
快閃記憶體的使用涉及資料搬移程序,可分成垃圾回收程序以及非垃圾回收程序。當閒置區塊數量不足時(例如,少於一臨界數量TH1),可對儲存空間進行垃圾回收(Garbage Collection)處理。例如,當多個資料區塊(又稱來源區塊)僅儲存零星有效資料時,可進行垃圾回收處理而將有效資料集中到一個主動區塊(又稱目的區塊),以回收多個資料區塊,增加閒置區塊數量。The use of flash memory involves data movement procedures, which can be divided into garbage collection procedures and non-garbage collection procedures. When the number of idle blocks is insufficient (for example, less than a critical number TH1), garbage collection (Garbage Collection) can be performed on the storage space. For example, when multiple data blocks (also known as source blocks) only store sporadic valid data, garbage collection can be performed to collect valid data into one active block (also known as destination block) to recover multiple data Blocks, increase the number of idle blocks.
非垃圾回收程序的種類很多,是根據瀕損條件判斷。例如,產生錯誤更正失效(ECC failed)的資料區塊(來源區塊)也需要進行資料搬移以及時搶救其中尚可讀出的使用者資料。另外,過於頻繁讀取的資料區塊(來源區塊)也需要進行資料搬移,避免資料區塊的資料保存能力降低所導致的使用者資料損壞,此操作又稱預防性搬移(Early Move)。另外,資料搬移也可能因應區塊間的損耗平均(Wear Leveling)考量而啟動,例如,將讀取次數低的資料區塊(來源區塊)的使用者資料(包括有效資料及無效資料)全部搬移到抹除計數較高的主動區塊(目的區塊),以回收該資料區塊。另外,損耗平均程序亦可與垃圾回收程序予以結合,即損耗平均程序中搬移多個資料區塊(來源區塊)的有效資料至抹除計數較高的主動區塊(目的區塊)。There are many types of non-garbage recycling programs, which are judged based on endangered conditions. For example, data blocks (source blocks) that generate ECC failed also need to be moved to rescue user data that is still readable. In addition, data blocks (source blocks) that are read too frequently also need to be moved to avoid damage to user data caused by the reduced data storage capacity of the data blocks. This operation is also called preventive move (Early Move). In addition, data movement may also be initiated in response to wear leveling considerations between blocks. For example, all user data (including valid and invalid data) of data blocks (source blocks) with low reading frequency Move to the active block (destination block) with a higher erase count to recover the data block. In addition, the wear leveling process can also be combined with the garbage collection process, that is, moving the effective data of multiple data blocks (source blocks) to the active block (destination block) with a higher erase count in the wear leveling process.
需注意的是,資料搬移較佳是以資料複製的方式來實現。It should be noted that the data movement is preferably achieved by means of data copying.
本案對以上有效資料搬移提出一種高效能方案。一旦有資料搬移需求,例如,以上垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移、或是其他,都可採用本案搬移技巧。This case proposes a high-efficiency solution to the above effective data movement. Once there is a need to move data, for example, the above garbage collection, error correction failure transfer, preventive transfer, average loss transfer, or other, the transfer technique of this case can be used.
圖中將快閃記憶體102的閒置區塊歸屬至閒置區塊池108,資料區塊歸屬至資料區塊池110。當有主機106提出寫入命令、或控制器104啟動資料搬移程序時,控制器104自閒置區塊池108中選擇一個閒置區塊作為主動區塊A0,此時閒置區塊池108的閒置區塊數量會減一。之後,將使用者資料寫入至主動區塊A0中。當主動區塊A0關閉而成為資料區塊後,資料區塊數量會加一。In the figure, the idle blocks of the flash memory 102 are assigned to the
快閃記憶體一般以主動區塊A0接收主機的使用者資料,此使用者資料通常由寫入命令所提供(參閱主機寫入資料路徑Host_Data)。特別是,相較於以另一個主動區塊(稱之A1以與A0區別)儲存來自來源區塊的使用者資料,本案控制器104令主動區塊A0也作為資料搬移程序的目的地,而不是使用主動區塊A1。一旦有資料搬移需求,例如,垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移、或是其他,本案可將資料搬移程序中的來源區塊的使用者資料收集至主動區塊A0(參閱資料搬移路徑Blk_Data)。。特別是,本案令同一區塊的有效資料係分割成多個批次搬移到該主動區塊A0。本案為不同區塊,適應性設定單批次搬移的有效資料量。越多資料區塊產生有效資料搬移需求,單批次搬移的有效資料量越高。主機寫入資料路徑Host_Data以及資料搬移路徑Blk_Data所提供給主動區塊A0的資料量係動態調配。以下更詳細討論之。The flash memory generally receives the user data of the host in the active block A0. This user data is usually provided by the write command (refer to the host write data path Host_Data). In particular, compared to storing user data from the source block in another active block (called A1 to distinguish it from A0), the
相較於傳統技術同時配置主動區塊A0以及主動區塊A1,如本案善用主動區塊A0有數種優點,並描述如下。Compared with the conventional technology, the active block A0 and the active block A1 are configured at the same time. For example, the active block A0 has several advantages and is described as follows.
首先,本案中主動區塊A0不只可以儲存來自主機以寫入指令要求寫入的使用者資料,更可以儲存來自來源區塊的使用者資料,因此,可降低閒置區塊的使用量。First of all, in this case, the active block A0 can not only store the user data written by the host by the write command, but also store the user data from the source block. Therefore, the usage of idle blocks can be reduced.
在傳統有使用主動區塊A1的例子中,因應突發斷電事件,突發斷電事件回復(Sudden Power Off Recovery,SPOR)程序須特別考量資料可靠度,會捨棄尚未關閉(Closed)的主動區塊A1,仍以來源區塊上的使用者資料為準。因此,只要主動區塊A1尚未關閉,資料搬移程序中的所有來源區塊都必須留存,不能釋出。上述設計明顯地拖累來源區塊的回收,造成閒置區塊數量無法及時地增加,甚至導致不同種類的資料搬移程序的啟動。In the traditional example of using the active block A1, in response to a sudden power failure event, the Sudden Power Off Recovery (SPOR) procedure must specifically consider the reliability of the data, and will discard the unclosed initiative. Block A1 is still subject to the user data on the source block. Therefore, as long as the active block A1 has not been closed, all source blocks in the data movement process must be retained and cannot be released. The above design obviously hinders the recovery of source blocks, resulting in the number of idle blocks not increasing in time, and even leading to the start of different types of data movement procedures.
相較傳統技術,本案是以主動區塊A0作為資料搬移程序中的目的區塊。突發斷電事件回復(SPOR)程序不會全然丟棄該主動區塊A0。在資料搬移完成後,資料搬移程序中的來源區塊即可回收,無須為了SPOR程序而留存。因此,相較於傳統特別再以主動區塊A1作為目的區塊的技術,本案的閒置區塊數量可有效地增加,克服上述問題。Compared with the traditional technology, this case takes the active block A0 as the target block in the data transfer procedure. The SPOR procedure will not completely discard the active block A0. After the data migration is completed, the source block in the data migration process can be recovered without the need to retain it for the SPOR process. Therefore, compared with the traditional technology in which the active block A1 is specifically used as the target block, the number of idle blocks in this case can be effectively increased to overcome the above-mentioned problems.
此外,傳統技術為了令作為目的區塊的主動區塊A1及早關閉,可能會填入部份虛假資料(dummy data),這將降低資料區塊的資料儲存量,也增加區塊的抹寫頻率,縮短快閃記憶體壽命。相較之,以主動區塊A0作資料搬移程序的目的地,可以避免虛假資料的寫入,克服上述問題。In addition, in order to close the active block A1 as the target block early, the traditional technology may fill in some dummy data, which will reduce the data storage capacity of the data block and increase the frequency of block erasure , Shorten the life of flash memory. In contrast, using the active block A0 as the destination of the data movement process can avoid writing false data and overcome the above-mentioned problems.
一種實施方式中,控制器104令一來源區塊(無論屬垃圾回收或非垃圾回收)的有效資料完全搬移到該主動區塊A0後,方允許另一來源區塊(無論屬垃圾回收或非垃圾回收)的有效資料搬移到該主動區塊A0。In one embodiment, the
本案特別令同一來源區塊的有效資料係分批搬移至主動區塊A0。各批次間,主機要求的寫入資料可填入該主動區塊A0。有效資料搬移以及來自主機之寫入資料的填寫之間可存在比例關係。本案適應性設定該比例關係。若發生資料搬移需求的來源區塊並不只單一個,本案提高單批次所搬移的有效資料量,及早結束當前來源區塊之有效資料搬移,以應付下一個來源區塊。In this case, the effective data of the same source block is moved to the active block A0 in batches. Between each batch, the write data requested by the host can be filled into the active block A0. There can be a proportional relationship between the movement of valid data and the filling of written data from the host. This case adaptively sets the proportional relationship. If there is more than one source block for data movement, this case increases the amount of effective data moved in a single batch, and ends the effective data movement of the current source block early to meet the next source block.
第1圖中,主機106要求的寫入資料係經主機寫入資料路徑Host_Data)。垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移等等,各種以主動區塊A0為目的地的有效資料搬移,在第1圖是以資料搬移路徑Blk_Data表示。凡是自資料區塊池110選定資料區塊作為來源區塊,將其中有效資料搬移到主動區塊A0者,都屬於該資料搬移路徑Blk_Data所涵蓋技術。本案係動態調配路徑Host_Data以及路徑Blk_Data之使用。In Figure 1, the write data requested by the
一種實施方式中,控制器104在前一個來源區塊搬移完畢後,又允許其他來源區塊同樣以主動區塊A0為有效資料搬移目的地。例如,一來源區塊的垃圾回收完成後,控制器104允許另一個來源區塊以同樣的主動區塊A0為目的地,進行非垃圾回收(錯誤更正失效搬移、預防性搬移、損耗平均搬移等等)的有效資料搬移。例如,對一來源區塊進行非垃圾回收的有效資料搬移後,控制器104允許另一個來源區塊以同樣的主動區塊A0為目的地,再次實施非垃圾回收的有效資料搬移。如此一來,主動區塊A0關閉(例如,以是否完成EOB資訊為判斷標準)前,閒置區塊數量有機會被充分補充(可補充不只一個閒置區塊)。In one embodiment, after the previous source block has been moved, the
一種實施方式中,同一來源區塊的有效資料係分批搬移至主動區塊A0。各批次間,主機106要求的寫入資料填入該主動區塊A0。或者,各批次間,控制器104是令該快閃記憶體102回覆主機106的讀取要求。不同批次的間距可以由寫入該主動區塊A0的主機106資料量決定、或是計時定義。批次間可能有新的有效資料搬移需求發生。控制器104是待當前來源區塊的批次搬移結束後,才會處理另一個來源區塊的批次搬移。In one embodiment, the valid data of the same source block is moved to the active block A0 in batches. Between each batch, the write data requested by the
一種實施方式中,該控制器104根據一來源區塊的有效資料量以及該主動區塊A0的閒置空間估算一比例,並根據該比例設定各批次搬移的有效資料量。根據該比例,該控制器104更可設定兩個批次之間允許該主機106填入該主動區塊A0的寫入資料量。In one embodiment, the
面臨資料搬移需求的來源區塊可能不只單一個。一種實施方式動態調配上述比例,對正要處理的該個來源區塊作設定,決定各批次搬移的有效資料量。一種實施方式中,有資料搬移需求的來源區塊有兩個。第一來源區塊的有效資料有x頁。該主動區塊A0有y頁閒置空間。本案可估算出一比例x:(y-x),等效為1:n。本案可調整該比例為a:n,a為大於一常態值的數值。例如,常態值可為1,a可為2。考量快閃記憶體102程式化(包括主機106寫入以及來源區塊搬移)的反應時間,本案發展出的搬移策略為:每將a*M頁有效資料自第一來源區塊搬移到主動區塊A0(對應路徑Blk_Data),即穿插以主動區塊A0儲存主機106發下的n*M頁寫入資料(對應路徑Host_Data)。倍數a使得第一來源區塊的有效資料及早收集至主動區塊A0。控制器104得以及時進行第二來源區塊的有效資料搬移。控制器104將針對第二來源區塊的有效資料量以及主動區塊A0此時的閒置空間,估算出新的比例。控制器104也會確認是否又有其他來源區塊待搬移,以調整該比例,產生適合該第二來源區塊的搬移策略。There may be more than one source block facing the need for data movement. One embodiment dynamically allocates the above ratio, sets the source block to be processed, and determines the amount of effective data moved in each batch. In one embodiment, there are two source blocks that require data movement. The valid data of the first source block is x pages. The active block A0 has y pages of free space. In this case, a ratio x:(y-x) can be estimated, which is equivalent to 1:n. In this case, the ratio can be adjusted to a:n, where a is a value greater than a normal value. For example, the normal value may be 1, and a may be 2. Considering the response time of flash memory 102 programming (including
一種實施方式中,第一來源區塊設定搬移策略時,不只有第二來源區塊在等待,更有第三來源區塊需要搬移。a值可設定成更大(相較於只有第一以及第二來源區塊的例子)。In one embodiment, when the first source block sets the migration strategy, not only the second source block is waiting, but also the third source block needs to be moved. The value of a can be set larger (compared to the example with only the first and second source blocks).
快閃記憶體102程式化(包括主機106寫入以及來源區塊搬移)的反應時間受到多種因素影響。本案特別考量該反應時間,設定前述M值。一種實施方式中,一次程式化M頁可使快閃記憶體102寫入時序最佳化。例如,在等待第一筆M頁程式化的確收回應時,第二筆M頁即可快取至控制器104等待存入該快閃記憶體102:操作效能遠優於單頁程式化。The response time of flash memory 102 programming (including
一種實施方式中,控制器104是優先進行資料搬移,次而才考量主機106之寫入要求。例如,一有需要資料搬移的來源區塊,控制器104評估出搬移策略後,即進行第一批資料搬移。第一批資料搬移結束後,才允許再接收主機106要求的寫入資料。此設計確保同一來源區塊收集在同一主動區塊A0上。In one embodiment, the
第2圖以流程圖圖解根據本案一種實施方式對快閃記憶體102所實施的資料搬移。FIG. 2 is a flowchart illustrating the data movement performed on the flash memory 102 according to an embodiment of the present case.
步驟S202:控制器104配置主動區塊A0。控制器104自閒置區塊池108配置其中之一閒置區塊作為主動區塊A0。Step S202: The
步驟S204:控制器104判斷是否執行資料搬移程序?如果是則執行步驟S212,如果否則執行步驟S206。當預設條件滿足時,例如,閒置區塊數量少於臨界數量TH1,或是產生錯誤更正失效搬移、預防性搬移、損耗平均搬移任一,則控制器104啟動(執行)資料搬移程序。Step S204: The
步驟S206:控制器104判斷是否關閉主動區塊A0?如果是則執行步驟S210,如果否則執行步驟S208。假如主動區塊A0仍有閒置空間以儲存資料,則控制器104不關閉主動區塊A0。Step S206: The
步驟S208:控制器104將來自主機106的使用者資料寫入主動區塊A0,之後,回到步驟S204。在上述中控制器104先執行步驟S204,之後,才會執行步驟S206以及步驟S208/S210,這表示控制器104會優先搬移資料搬移程序的使用者資料。在另一實施例中,控制器104可將步驟S204排在主機106使用者資料填寫之後;在此設定下,控制器104會優先將主機106的使用者資料寫入主動區塊A0。Step S208: The
步驟S210:控制器104關閉主動區塊A0。假如主動區塊A0已無閒置空間以儲存資料,則控制器104關閉主動區塊A0,並將EOB資訊寫入主動區塊A0的最後一個頁面中。Step S210: The
倘若步驟S204顯示存在資料搬移需求,流程進入步驟S212,規劃一來源區塊之有效資料的搬移策略。控制器104除了考量來源區塊的有效資料量、主動區塊A0的閒置狀況,更考量是否還有更多來源區塊待搬移。控制器104因而評估得一搬移策略。例如,每搬移a*M頁有效資料,即穿插n*M頁的主機106寫入資料。步驟S214以及步驟S216即反覆執行以完成該搬移策略。If step S204 shows that there is a data movement requirement, the flow proceeds to step S212 to plan a migration strategy for valid data of a source block. The
步驟S214以主動區塊A0為目的地,搬移來源區塊的a*M頁有效資料。步驟S216,主動區塊A0重啟對主機106發來的寫入資料之接收工作。控制器104允許主機106要求的n*M頁寫入資料填入該主動區塊A0。步驟S218,控制器104判斷是否完成該來源區塊的有效資料搬移。若否,流程回到步驟S214,繼續下一批次a*M頁的有效資料搬移。若步驟S218判定該來源區塊的有效資料搬移完成,流程進入步驟S204以及其後步驟,規劃如何使用主動區塊A0空間應付另一個資料搬移需求。Step S214 takes the active block A0 as the destination and moves a*M pages of valid data from the source block. In step S216, the active block A0 restarts the reception of the written data sent from the
一種實施方式中,步驟S216可以包括一時限判斷。超過該時限,流程即進行步驟S218。In one embodiment, step S216 may include a time limit judgment. If the time limit is exceeded, the flow proceeds to step S218.
第3圖更根據本案一種實施方式詳細說明步驟S212,其中決定步驟S214各批次所進行的資料搬移頁數a*M、以及步驟S216所穿插的主機106寫入頁數n*M。FIG. 3 further describes step S212 in detail according to an embodiment of the present case, in which the number of data transfer pages a*M performed by each batch in step S214 and the number of pages n*M written by the
步驟S302,該控制器104根據來源區塊的有效資料量以及該主動區塊A0的閒置空間估算一比例1:n。例如,來源區塊的有效資料有x頁。主動區塊A0有y頁閒置空間。根據步驟S302,控制器104估算出一比例x:(y-x),等效為1:n。In step S302, the
步驟S304,控制器104判斷是否有複數個來源區塊有資料搬移需求。若否,流程進入步驟S306。控制器104令數值a為一常態值(例如,1),表示無加速搬移的必要。反之,若有複數個來源區塊需要搬移,流程進入步驟S308。控制器104令數值a大於該常態值(例如,2),以加速搬移。越多來源區塊等待資料搬移,數值a可設定越大。In step S304, the
第3圖程序所求出的n值以及所規劃的a值,即套用於步驟S214以及S216,決定各批次進行的資料搬移頁數a*M、以及各批次間允許穿插的主機106寫入頁數n*M。The n value and the planned a value obtained by the program in FIG. 3 are applied to steps S214 and S216 to determine the number of data transfer pages a*M for each batch, and the
使用者操作習慣可能導致裝置反覆斷電、上電(稱為power cycling)。例如,手機使用者開蓋查看信息又蓋上。閒置區塊大量消耗,發生垃圾回收需求。特定區塊也有可能過於頻繁讀取,導致錯誤更正失效(ECC failed)搬移、預防性搬移(early move)、損耗平均(wear leveling)搬移、或是其他有效資料搬移求發生。本案使得過低的閒置區塊數量得以及時補足。The user's operating habits may cause the device to repeatedly power off and power on (called power cycling). For example, mobile phone users open the cover to view the information and then cover it. Large amounts of idle blocks are consumed and garbage collection needs occur. Certain blocks may also be read too frequently, leading to ECC failed movement, early move, wear leveling movement, or other valid data movement requests. This case allowed the excessively low number of idle blocks to be replenished in time.
以上控制器104對快閃記憶體102之操作也可以由其他結構實現。凡是動態調配主動區塊A0之使用方式(例如,動態調配路徑Blk_Data以及路徑Host_Data之使用比例),都屬於本案欲保護範圍。本案更可以前述概念實現非揮發式記憶體的控制方法。The above operation of the
雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明,任何熟悉此項技藝者,在不脫離本發明之精神和範圍內,當可做些許更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Anyone who is familiar with this skill can do some modifications and retouching without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of protection shall be as defined in the scope of the attached patent application.
100:資料儲存裝置;102:快閃記憶體;104:控制器;106:主機;108:閒置區塊池;110:資料區塊池;A0:主動區塊;Blk_Data:資料搬移路徑;Host_Data:主機寫入資料路徑;S202…S218、S302…S308:步驟。100: data storage device; 102: flash memory; 104: controller; 106: host; 108: idle block pool; 110: data block pool; A0: active block; Blk_Data: data migration path; Host_Data: The host writes the data path; S202...S218, S302...S308: steps.
第1圖根據本案一種實施方式圖解一資料儲存裝置100; 第2圖以流程圖圖解根據本案一種實施方式對快閃記憶體102所實施的資料搬移;以及 第3圖更根據本案一種實施方式詳細說明步驟S208,其中將決定步驟S210各批次所進行的資料搬移頁數a*M、以及步驟S212所穿插的主機106寫入頁數n*M。Figure 1 illustrates a data storage device 100 according to an embodiment of the case; Figure 2 illustrates in a flowchart the data movement performed on the flash memory 102 according to an embodiment of the case; and Figure 3 is more detailed according to an embodiment of the case Step S208 will be described, in which the number of data transfer pages a*M determined in each batch of step S210 and the number of pages n*M written by the
100:資料儲存裝置 100: data storage device
102:快閃記憶體 102: Flash memory
104:控制器 104: controller
106:主機 106: Host
108:閒置區塊池 108: idle block pool
110:資料區塊池 110: data block pool
A0:主動區塊 A0: Active block
Blk_Data:資料搬移路徑 Blk_Data: data migration path
Host_Data:主機寫入資料路徑 Host_Data: Host write data path
Claims (18)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910445239.2A CN110888593B (en) | 2018-09-07 | 2019-05-27 | Data storage device and non-volatile memory control method |
US16/505,192 US11036414B2 (en) | 2018-09-07 | 2019-07-08 | Data storage device and control method for non-volatile memory with high-efficiency garbage collection |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US201862728134P | 2018-09-07 | 2018-09-07 | |
US62/728,134 | 2018-09-07 |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202011199A true TW202011199A (en) | 2020-03-16 |
TWI712882B TWI712882B (en) | 2020-12-11 |
Family
ID=70766513
Family Applications (4)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW108106466A TWI696916B (en) | 2018-09-07 | 2019-02-26 | Data storage device and control method for non-volatile memory |
TW109116356A TWI768346B (en) | 2018-09-07 | 2019-02-26 | Data storage device and control method for non-volatile memory |
TW108107912A TWI714975B (en) | 2018-09-07 | 2019-03-08 | Data storage device and control method for non-volatile memory |
TW108107913A TWI712882B (en) | 2018-09-07 | 2019-03-08 | Data storage device and control method for non-volatile memory |
Family Applications Before (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW108106466A TWI696916B (en) | 2018-09-07 | 2019-02-26 | Data storage device and control method for non-volatile memory |
TW109116356A TWI768346B (en) | 2018-09-07 | 2019-02-26 | Data storage device and control method for non-volatile memory |
TW108107912A TWI714975B (en) | 2018-09-07 | 2019-03-08 | Data storage device and control method for non-volatile memory |
Country Status (1)
Country | Link |
---|---|
TW (4) | TWI696916B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI748542B (en) * | 2020-07-01 | 2021-12-01 | 慧榮科技股份有限公司 | Electronic device, flash memory controller and method for performing garbage collection operation on flash memory module |
US11307982B2 (en) | 2020-09-09 | 2022-04-19 | Phison Electronics Corp. | Memory management method with a data merging process based on risk physical units and distribution counts, memory storage device and memory control circuit unit |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11809314B2 (en) | 2021-11-21 | 2023-11-07 | Silicon Motion, Inc. | Method and apparatus for performing access control of memory device with aid of multi-stage garbage collection management |
Family Cites Families (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7412560B2 (en) * | 2004-12-16 | 2008-08-12 | Sandisk Corporation | Non-volatile memory and method with multi-stream updating |
US8626936B2 (en) * | 2008-01-23 | 2014-01-07 | International Business Machines Corporation | Protocol independent server replacement and replication in a storage area network |
CN101645309B (en) * | 2008-08-05 | 2013-05-22 | 威刚科技(苏州)有限公司 | Non-volatile memory device and control method thereof |
US8463826B2 (en) * | 2009-09-03 | 2013-06-11 | Apple Inc. | Incremental garbage collection for non-volatile memories |
US8688894B2 (en) * | 2009-09-03 | 2014-04-01 | Pioneer Chip Technology Ltd. | Page based management of flash storage |
US8463983B2 (en) * | 2009-09-15 | 2013-06-11 | International Business Machines Corporation | Container marker scheme for reducing write amplification in solid state devices |
KR101774496B1 (en) * | 2010-12-08 | 2017-09-05 | 삼성전자주식회사 | Non-volatile memory device, devices having the same, method of operating the same |
US20120297121A1 (en) * | 2011-05-17 | 2012-11-22 | Sergey Anatolievich Gorobets | Non-Volatile Memory and Method with Small Logical Groups Distributed Among Active SLC and MLC Memory Partitions |
KR20130076429A (en) * | 2011-12-28 | 2013-07-08 | 삼성전자주식회사 | Method for managing storage space in memory device and storage device using method thereof |
TWI526830B (en) * | 2013-11-14 | 2016-03-21 | 群聯電子股份有限公司 | Data writing method, memory control circuit unit and memory storage apparatus |
CN104732153B (en) * | 2013-12-18 | 2018-01-12 | 群联电子股份有限公司 | Data erasing method, memorizer control circuit unit and memory storage apparatus |
TWI524183B (en) * | 2014-01-09 | 2016-03-01 | 群聯電子股份有限公司 | Data writing method, memory control circuit unit and memory storage apparatus |
JP2016184402A (en) * | 2015-03-26 | 2016-10-20 | パナソニックIpマネジメント株式会社 | Memory controller, nonvolatile storage device, nonvolatile storage system, and memory control method |
TWI563507B (en) * | 2015-07-01 | 2016-12-21 | Phison Electronics Corp | Memory management method, memory control circuit unit and memry storage apparatus |
US9778855B2 (en) * | 2015-10-30 | 2017-10-03 | Sandisk Technologies Llc | System and method for precision interleaving of data writes in a non-volatile memory |
US10102119B2 (en) * | 2015-10-30 | 2018-10-16 | Sandisk Technologies Llc | Garbage collection based on queued and/or selected write commands |
US20170123666A1 (en) * | 2015-10-30 | 2017-05-04 | Sandisk Technologies Inc. | System and method for managing maintenance scheduling in a non-volatile memory |
US10229049B2 (en) * | 2015-12-17 | 2019-03-12 | Toshiba Memory Corporation | Storage system that performs host-initiated garbage collection |
CN107025941A (en) * | 2016-01-29 | 2017-08-08 | 瑞昱半导体股份有限公司 | Solid state hard disc controls circuit |
CN107817943B (en) * | 2016-09-13 | 2020-12-15 | 深圳大心电子科技有限公司 | Data transmission method, memory storage device and memory control circuit unit |
TWI691839B (en) * | 2016-11-28 | 2020-04-21 | 慧榮科技股份有限公司 | Method for data management |
TWI615710B (en) * | 2016-12-14 | 2018-02-21 | 群聯電子股份有限公司 | Memory management method, memory storage device and memory control circuit unit |
US10318423B2 (en) * | 2016-12-14 | 2019-06-11 | Macronix International Co., Ltd. | Methods and systems for managing physical information of memory units in a memory device |
TWI613652B (en) * | 2017-03-27 | 2018-02-01 | 慧榮科技股份有限公司 | Data storage device and operating method therefor |
-
2019
- 2019-02-26 TW TW108106466A patent/TWI696916B/en active
- 2019-02-26 TW TW109116356A patent/TWI768346B/en active
- 2019-03-08 TW TW108107912A patent/TWI714975B/en active
- 2019-03-08 TW TW108107913A patent/TWI712882B/en active
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI748542B (en) * | 2020-07-01 | 2021-12-01 | 慧榮科技股份有限公司 | Electronic device, flash memory controller and method for performing garbage collection operation on flash memory module |
US11194502B1 (en) | 2020-07-01 | 2021-12-07 | Silicon Motion, Inc. | Electronic device, flash memory controller and method for performing garbage collection operation on flash memory module |
US11307982B2 (en) | 2020-09-09 | 2022-04-19 | Phison Electronics Corp. | Memory management method with a data merging process based on risk physical units and distribution counts, memory storage device and memory control circuit unit |
TWI775143B (en) * | 2020-09-09 | 2022-08-21 | 群聯電子股份有限公司 | Memory management method, memory storage device and memory control circuit unit |
Also Published As
Publication number | Publication date |
---|---|
TWI696916B (en) | 2020-06-21 |
TWI768346B (en) | 2022-06-21 |
TW202011198A (en) | 2020-03-16 |
TW202036300A (en) | 2020-10-01 |
TW202011196A (en) | 2020-03-16 |
TWI712882B (en) | 2020-12-11 |
TWI714975B (en) | 2021-01-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210073120A1 (en) | Directed sanitization of memory | |
USRE49508E1 (en) | Memory system and method for controlling nonvolatile memory | |
US10956083B2 (en) | Method and system for input-output throttling to improve quality of service in a solid state drive | |
US9128618B2 (en) | Non-volatile memory controller processing new request before completing current operation, system including same, and method | |
US20160062885A1 (en) | Garbage collection method for nonvolatile memory device | |
US9189383B2 (en) | Nonvolatile memory system and data processing method | |
KR20120030137A (en) | Memory system having persistent garbage collection | |
KR20130032157A (en) | Data storage device and data write method thereof | |
CN113168374A (en) | Write command retention in partition namespaces | |
TWI712882B (en) | Data storage device and control method for non-volatile memory | |
US11334480B2 (en) | Data storage device and non-volatile memory control method | |
TWI718710B (en) | Data storage device and non-volatile memory control method | |
CN114746834A (en) | Partition append command scheduling based on partition status | |
CN117043753A (en) | Different write priorities in ZNS devices | |
CN110888820B (en) | Data storage device and non-volatile memory control method | |
CN110888593B (en) | Data storage device and non-volatile memory control method | |
CN110888591B (en) | Data storage device and non-volatile memory control method | |
TWI726381B (en) | Data storage device and control method for non-volatile memory | |
CN114746835A (en) | Keep partitions open with intermediate fills | |
TWI846532B (en) | Data storage device and non-volatile memory control method | |
TWI724550B (en) | Data storage device and non-volatile memory control method |