TWI696916B - 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
- TWI696916B TWI696916B TW108106466A TW108106466A TWI696916B TW I696916 B TWI696916 B TW I696916B TW 108106466 A TW108106466 A TW 108106466A TW 108106466 A TW108106466 A TW 108106466A TW I696916 B TWI696916 B TW I696916B
- Authority
- TW
- Taiwan
- Prior art keywords
- block
- data
- active block
- controller
- source block
- 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)…等,用於長時間資料保存,可做為儲存媒體實現一資料儲存裝置。Non-volatile memory comes in many forms-for example, flash memory, magnetoresistive RAM, ferroelectric RAM, resistive random access Memory (Resistive RAM), Spin Transfer Torque-RAM (STT-RAM), etc. are used for long-term data storage, and can be used as a storage medium to realize a data storage device.
非揮發式記憶體通常有其特殊的儲存特性。本技術領域需要相應非揮發式記憶體的儲存特性發展相應的控制技術。Non-volatile memory usually has its special storage characteristics. The technical field needs to develop corresponding control technology 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 configures an active block from a plurality of idle blocks of the non-volatile memory to fill in write data requested by the host. When the number of idle blocks is less than a critical number, the controller uses the active block as the destination of the effective data of the source block. The controller uses the active block as a destination for the transfer of valid data in the second source block when a second source block meets an endangered condition.
一種實施方式中,該控制器令一來源區塊的有效資料完全搬移到該主動區塊後,方允許另一來源區塊的有效資料搬移到該主動區塊。In one embodiment, the controller allows valid data of one source block to be completely moved to the active block before allowing valid data of another source block to be moved to the active block.
一種實施方式中,該控制器以複數個批次將一來源區塊的有效資料搬移到該主動區塊,並於不同批次間允許該主機發出的寫入資料填入該主動區塊。In one embodiment, the controller moves the valid data of a source block to the active block in multiple batches, and allows write data sent by the host to be filled into the active block between different batches.
一種實施方式中,該控制器估算一來源區塊的有效資料量以及該主動區塊的閒置空間之間的一比例,並根據該比例設定各批次搬移的有效資料量。根據該比例,該控制器更可設定兩個批次之間允許該主機填入該主動區塊的寫入資料量。In one embodiment, the controller estimates a ratio between the effective data amount of a source block and the free space of the active block, and sets the effective data amount of each batch moved according to the ratio. According to this ratio, the controller can also set the amount of write data that allows the host to fill in the active block between the two batches.
一種實施方式中,該控制器估算一來源區塊的有效資料量以及該主機要求的寫入資料量之間的一比例,並根據該比例設定各批次搬移的有效資料量。In one embodiment, the controller estimates a ratio between the amount of effective data in a source block and the amount of written data requested by the host, and sets the amount of effective data moved in each batch according to the ratio.
一種實施方式中,滿足該瀕損條件的該第二來源區塊為錯誤更正失效。In one embodiment, the second source block satisfying the endangered condition is an error correction failure.
一種實施方式中,滿足該瀕損條件的該第二來源區塊是做預防性搬移。In one embodiment, the second source block that meets the endangered condition is for preventive removal.
一種實施方式中,滿足該瀕損條件的該第二來源區塊是做損耗平均搬移。In one embodiment, the second source block that satisfies the endangered condition is moved for average wear.
一種實施方式中,該控制器將一來源區塊的有效資料全數搬移到該主動區塊後,是在該主動區塊完成結尾寫入前釋出該來源區塊為閒置區塊。In one embodiment, after the controller transfers all the valid data of a source block to the active block, the source block is released as an idle block before the active block completes the end writing.
一種實施方式中,該控制器操作一旗標。該控制器在一來源區塊的有效資料全數搬移到該主動區塊後,方以該旗標標示該主動區塊允許保存其他來源區塊的有效資料。In one embodiment, the controller operates a flag. After all the valid data of a source block is moved to the active block, the controller marks the active block with the flag to allow the valid data of other source blocks to be saved.
以上控制器對非揮發式記憶體之操作也可以由其他結構實現。本案更可以前述概念實現非揮發式記憶體的控制方法,包括:根據一主機之要求操作一非揮發式記憶體;自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料;在該等閒置區塊之數量小於一臨界數量時,以該主動區塊為一第一來源區塊的有效資料的搬移目的地;且在一第二來源區塊符合一瀕損條件時,以該主動區塊為該第二來源區塊的有效資料的搬移目的地。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 Required write data; when the number of these idle blocks is less than a critical number, the active block is used as the destination of the effective data of the first source block; and a second source block matches one When the condition is in jeopardy, the active block is used as the transfer destination of valid data of the second source block.
下文特舉實施例,並配合所附圖示,詳細說明本發明內容。In the following, the embodiments are specifically described, and in conjunction with the accompanying drawings, the content of the present invention is explained 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 memory cards, USB flash devices, solid state drives (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 can operate an array of solid state drives (SSDs) to form a data center. The server can be regarded as a host, operating the connected solid-state hard drive to access the flash memory.
第1圖根據本案一種實施方式圖解資料儲存裝置100。資料儲存裝置100包括快閃記憶體102以及控制器104。主機106透過控制器104而間接存取快閃記憶體102。控制器104除了接收及執行來自主機(Host)106的寫入命令,更主動搬移快閃記憶體102所儲存的使用者資料。FIG. 1 illustrates the
快閃記憶體有其特殊的儲存特性,以下敘述之。Flash memory has its special storage characteristics, described below.
主機106是以邏輯位址(例如,邏輯區塊位址LBA或全域主機頁面編號GHP…等)區別使用者資料。快閃記憶體102之物理空間則是劃分為複數個區塊(Blocks)配置使用。各區塊(Block)包括複數頁面(Pages)。各頁面包括N個區段(Sectors),N為大於1的整數,如:4。16KB空間的頁面可分為四個區段,各區段為4KB。一種實施方式中,一區塊係根據頁面編號,由低至高編號配置來儲存使用者資料。The
一種實施方式中,資料儲存裝置採用多通道技術,可將不同通道的多個區塊可以虛擬成一個超級區塊,多個頁面可以虛擬成一個超級頁面,並以超級區塊、超級頁面進行資料儲存空間的管理,可加快資料儲存裝置的資料吞吐量。In one embodiment, the data storage device uses 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 for 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).
快閃記憶體的儲存空間需先抹除方能再次使用,抹除(Erase)的最小單位為區塊。區塊可區分成資料區塊、主動區塊以及閒置區塊。閒置區塊可作為主動區塊以寫入使用者資料。當主動區塊寫滿使用者資料後,經過關閉處理(寫入EOB(End of Block)資訊),主動區塊變更為資料區塊。隨著使用者資料的更新,部份儲存在資料區塊的使用者資料會由有效資料變更為無效資料。當資料區塊所儲存的使用者資料皆為無效資料時,經抹除處理後則變更為閒置區塊。在另一種實施例中,充滿無效資料的資料區塊會變更為閒置區塊,而抹除處理乃等到閒置區塊作為主動區塊時再予以執行。The storage space of the flash memory needs to be erased before it can be used again. The smallest unit of erase (Erase) is the 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 full of 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.
快閃記憶體的使用涉及資料搬移程序,可分成垃圾回收程序以及非垃圾回收程序。當閒置區塊數量不足時,可對儲存空間進行垃圾回收(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, 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 migration 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 realized by means of data copying.
圖中將快閃記憶體102的閒置區塊歸屬至閒置區塊池108,資料區塊歸屬至資料區塊池110。當有主機106提出寫入命令、或控制器104啟動資料搬移程序時,控制器104自閒置區塊池108中選擇一個閒置區塊作為主動區塊A0,此時閒置區塊池108的閒置區塊數量會減一。之後,將使用者資料寫入至主動區塊A0中。當主動區塊A0關閉而成為資料區塊後,資料區塊數量會加一。In the figure, the idle blocks of the
本案提出一種高效能資料儲存的方法,可滿足各種資料儲存的需求。除了儲存來自於主機的使用者資料(主機106以寫入指令要求寫入快閃記憶體102)之外,啟動資料搬移程序,例如,垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移、或是其他,都可以利用本案高效能資料儲存方法來儲存來源方塊(資料區塊)的使用者資料。This case proposes a high-efficiency data storage method that can meet the needs of various data storage. In addition to storing user data from the host (host 106 requests to write to
控制器104一般以一個主動區塊(標示為A0)接收來自主機的使用者資料,此使用者資料通常由寫入命令所提供。特別是,相較於以另一個主動區塊(稱之A1以與A0區別)儲存來自來源區塊的使用者資料,本案控制器104令主動區塊A0也作為資料搬移程序的目的地,而不是使用主動區塊A1。一旦有資料搬移需求,例如,垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移、或是其他,本案可將資料搬移程序中的來源區塊的使用者資料收集至主動區塊A0。相較於傳統技術同時配置主動區塊A0以及主動區塊A1,本案設計有數種優點,並描述如下。The
首先,本案中主動區塊A0不只可以儲存來自主機以寫入指令要求寫入的使用者資料,更可以儲存來自來源區塊的使用者資料,因此,可降低閒置區塊的使用量。First of all, in this case, the active block A0 can not only store the user data written by the host with 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 outage, the Sudden Power Off Recovery (SPOR) procedure must specifically consider the reliability of the data and will discard the unclosed active 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 that specifically uses the active block A1 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 procedure can avoid writing false data and overcome the above-mentioned problems.
一種實施方式中,控制器104令一來源區塊(無論屬垃圾回收或非垃圾回收)的有效資料完全搬移到該主動區塊A0後,方允許另一來源區塊(無論屬垃圾回收或非垃圾回收)的有效資料搬移到該主動區塊A0。In one embodiment, the
如前述,資料搬移程序可區分成垃圾回收程序以及非垃圾回收程序。當閒置區塊數量少於臨界數量TH1,控制器104啟動垃圾回收程序,並以主動區塊A0作為垃圾回收程序中的目的區塊,如垃圾回收路徑GC所示。As mentioned above, the data movement procedure can be divided into garbage recycling procedures and non-garbage recycling procedures. When the number of idle blocks is less than the critical number TH1, the
非垃圾回收程序,例如錯誤更正失效搬移、預防性搬移、損耗平均搬移等等,控制器104也以主動區塊A0作為非垃圾回收程序中的目的區塊,如非垃圾回收路徑Non_GC標示。For non-garbage collection procedures, such as error correction failure movement, preventive movement, average loss movement, etc., the
一種實施方式中,除了儲存來自主機106的使用者資料之外,主動區塊A0也作為垃圾回收程序的目的區塊。主動區塊A0儲存來自主機106的使用者資料後,如果主動區塊A0未被關閉,則主動區塊A0可作為垃圾回收程序中的目的區塊以儲存來自來源區塊BLK#0之使用者資料。在此設定下,如果來源區塊(以BLK#0為例)的所有有效資料已完成搬移,則來源區塊BLK#0可被回收而成為閒置區塊,無須等待主動區塊A0關閉。In one embodiment, in addition to storing user data from the
一種實施方式中,除了儲存來自主機106的使用者資料之外,主動區塊A0可作為非垃圾回收程序的目的區塊。主動區塊A0儲存來自主機106的使用者資料後,如果主動區塊A0未被關閉,則主動區塊A0可作為非垃圾回收程序的目的區塊以儲存來自來源區塊(以BLK#1為例)之使用者資料。在此設定下,如果來源區塊BLK#1的所有有效資料已完成搬移,則來源區塊BLK#1可被回收而成為閒置區塊,無須等待主動區塊A0關閉。In one embodiment, in addition to storing user data from the
一種實施方式中,除了儲存來自主機106的使用者資料之外,主動區塊A0可作為垃圾回收程序以及非垃圾回收程序的目的區塊。主動區塊A0儲存來自主機的使用者資料後,如果主動區塊A0未被關閉,控制器104可啟動垃圾回收程序而將來源區塊(以BLK#0為例)之使用者資料搬移至主動區塊A0。如果主動區塊A0仍未關閉,控制器104可啟動非垃圾回收程序而將來源區塊BLK#0之使用者資料搬移至主動區塊A0。更甚者,主動區塊A0可作為非垃圾回收程序的目的區塊以儲存來自來源區塊(以BLK#1為例)之使用者資料。在此設定下,如果來源區塊BLK#0或來源區塊BLK#1的所有有效資料已完成搬移,則來源區塊BLK#0或來源區塊BLK#1可被回收而成為閒置區塊,無須等待主動區塊A0關閉。In one embodiment, in addition to storing user data from the
另外,來自主機、垃圾回收程序或非垃圾回收程序的使用者資料較佳為分段(分批次)地且交錯地儲存或搬移至主動區塊A0,其中,分段表示儲存或搬移一定數量的使用者資料至主動區塊A0,或在預設時間儲存或搬移一定數量的使用者資料至主動區塊A0;交錯表示資料由多個資料來源輪流提供,其中,資料來源可為主機、垃圾回收程序或非垃圾回收程序的來源區塊。In addition, user data from the host, garbage collection program or non-garbage collection program is preferably stored or moved to the active block A0 in segments (batch) and interleaved, where segment means storing or moving a certain amount User data to the active block A0, or store or move a certain amount of user data to the active block A0 at a preset time; interleaved means that the data is provided in turn by multiple data sources, where the data source can be host, junk Source block of the recycling process or non-garbage recycling process.
一種實施方式中,控制器104估算來源區塊的有效資料量以及來自於主機106的使用者資料量的比例,並根據該比例設定分段搬移以及分段寫入的資料量。在另一種實施方式中,控制器104估算來源區塊的有效資料量以及主動區塊A0的閒置空間的比例,並根據該比例設定分段搬移以及分段寫入的資料量。In one embodiment, the
第2A-2B圖以流程圖圖解根據本案一種實施方式實現的高效能資料儲存方法,並使用旗標cleanflag來控制資料的搬移。Figures 2A-2B are flowcharts illustrating a high-performance data storage method implemented according to an embodiment of the present case, and use a flag cleanflag to control the movement of data.
步驟S202:控制器104配置主動區塊A0。控制器104自閒置區塊池108配置其中之一閒置區塊作為主動區塊A0。Step S202: The
步驟S204:控制器104初始化旗標cleanflag為”DISABLE”。旗標cleanflag狀態”DISABLE”代表主動區塊A0也可配置為資料搬移程序的目的區塊。Step S204: The
步驟S206:控制器104判斷是否執行資料搬移程序?如果是則執行步驟S210,如果否則執行步驟S208。當預設條件滿足時,例如,閒置區塊數量少於臨界數量TH1,或是產生錯誤更正失效,則控制器104啟動(執行)資料搬移程序。Step S206: The
步驟S208:控制器104判斷是否關閉主動區塊A0?如果是則執行步驟S214,如果否則執行步驟S212。假如主動區塊A0仍有閒置空間以儲存資料,則控制器104不關閉主動區塊A0。Step S208: The
步驟S212:控制器104將來自主機106的使用者資料寫入主動區塊A0,之後,回到步驟S206。在上述中控制器104先執行步驟S206,之後,才會執行步驟S208以及步驟S212,這表示控制器104會優先搬移資料搬移程序的使用者資料。在另一實施例中,控制器104可先執行步驟S208以及步驟S212,之後,再執行步驟S206,在此設定下,控制器104會優先將主機106的使用者資料寫入主動區塊A0。Step S212: The
步驟S214:控制器104關閉主動區塊A0。假如主動區塊A0已無閒置空間以儲存資料,則控制器104關閉主動區塊A0,並將EOB資訊寫入主動區塊A0的最後一個頁面中。Step S214: The
步驟S210:控制器104決定資料搬移程序的資料搬移量,其中,資料搬移量可為固定值、由來源區塊的資料量與來自主機106的使用者資料量的比例所決定、或由來源區塊的資料量以及主動區塊A0的閒置空間的比例所決定。來源區塊可為垃圾回收程序或非垃圾回收程序的來源區塊。資料搬移量較佳為有效資料的數量。Step S210: The
步驟S216:控制器104將旗標cleanflag設為”START”,其中,”START” 代表主動區塊A0作為資料搬移的目的區塊,並準備執行資料的搬移。Step S216: The
步驟S218:控制器104從來源區塊搬移資料搬移量的使用者資料至主動區塊A0。控制器104可一次性或分段地將來源區塊的使用者資料搬移至主動區塊A0。假設來源區塊有x使用者資料,而來自主機106的使用者資料量為n*x,兩者的比例為1:n,x例如=16,n例如=10。如果為分段進行資料搬移,則每一次分段中控制器104可搬移M筆使用者資料至主動區塊A0,M例如=4,各段搬移的數量=4。第3圖圖解一種分段搬移的例子。使用者資料Data#0…Data#3搬移到主動區塊A0後,可穿插主機106寫入使用者資料至主動區塊A0,再將使用者資料Data#4…Data#7搬移到主動區塊A0;剩餘八筆使用者資料也是如是方式自來源區塊搬移到主動區塊A0。如果為一次性進行資料搬移,則不穿插主機106寫入使用者資料,控制器104將16筆使用者資料全部搬移到主動區塊A0。另外,在進行資料搬移時,M較佳為區段的倍數,且可涵蓋整數倍頁面。例如,控制器104一次只寫入一個頁面的資料,則M=4,表示一頁的四個區段一起搬移。一種實施方式中,控制器104一次寫入一個超級頁面的資料,M=16。Step S218: The
步驟S220:控制器104將旗標cleanflag設為”FINISH”,其中,”FINISH”表示一次性或分段地資料搬移已完成。Step S220: The
步驟S222:控制器104將來自主機106的使用者資料寫入至主動區塊A0。在資料搬移量的使用者資料該階段已搬移完成之後,控制器104將資料的來源改為主機106,即將來自主機106的使用者資料寫入至主動區塊A0。其中,控制器104可寫入固定筆數的使用者資料,或由上述比例計算出的40(n*M,n=10且M=4)筆使用者資料寫入至主動區塊A0。Step S222: The
步驟S224:控制器104判斷資料搬移程序是否執行完畢?如果是則執行步驟S226,如果否則執行步驟S216。假如控制器104是分段地將來源區塊的使用者資料搬移至主動區塊A0,控制器104會重覆執行步驟S216~S224,例如重覆次數=4(共16筆且每段4筆,則重複4次,分四段搬移)。Step S224: The
步驟S226:控制器104將旗標cleanflag設為” DISABLE”。Step S226: The
步驟S228:控制器104將來源區塊變更為閒置區塊,此時,閒置區塊池的數量加1。步驟S228可無關主動區塊A0關閉與否。閒置區塊數量可及時被補上。Step S228: The
在步驟S212、步驟S214、步驟S218以及步驟S222的其中之一,控制器104更包括依據主動區塊A0所儲存的使用者資料更新邏輯-物理位址映射表,其中,控制器104較佳先產生主動區塊A0的使用者資料的物理-邏輯位址映射表後,再以物理-邏輯位址映射表來更新邏輯-物理位址映射表。In one of step S212, step S214, step S218, and step S222, the
一種實施方式中,步驟S222可以包括時限判斷。超過該時限,流程即進行步驟S224。In one embodiment, step S222 may include time limit judgment. If the time limit is exceeded, the flow proceeds to step S224.
一種實施方式中,分段搬移(S218)以及分段寫入(S222)的資料量係取決於來源區塊的有效資料量以及主動區塊A0的閒置空間的比例。若主動區塊A0僅餘少量閒置空間,但來源區塊的有效資料量很多,則控制器104調高各段搬移的有效資料(S218)、或/以及限制各段寫入的主機106使用者資料(S222)。如此一來,主機區塊A0關閉前,來源區塊可完全搬移。In one embodiment, the amount of data for the segmented move (S218) and the segmented write (S222) depends on the effective data amount of the source block and the ratio of the free space of the active block A0. If there is only a small amount of free space in the active block A0, but the amount of valid data in the source block is large, 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之操作也可以由其他結構實現。凡是不為了資料於區塊間的搬移更配置主動區塊A1者,都屬於本案欲保護範圍。本案更可以前述概念實現非揮發式記憶體的控制方法。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 art can make 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 deemed as defined by the scope of the attached patent application.
100~資料儲存裝置; 102~快閃記憶體; 104~控制器; 106~主機; 108~閒置區塊池; 110~資料區塊池; A0~主動區塊; Data#0…Data#7~使用者資料; GC~垃圾回收路徑; Non_GC~非垃圾回收的其他有效資料搬移路徑; S202…S228~步驟。100~ data storage device; 102~ flash memory; 104~ controller; 106~ host; 108~ idle block pool; 110~ data block pool; A0~ active block;
第1圖根據本案一種實施方式圖解資料儲存裝置100;以及 第2A-2B圖以流程圖圖解根據本案一種實施方式實現的高效能資料儲存方法,並使用旗標cleanflag來控制資料的搬移;且 第3圖圖解一種分段搬移的例子。Figure 1 illustrates a
100~資料儲存裝置; 102~快閃記憶體; 104~控制器; 106~主機; 108~閒置區塊池; 110~資料區塊池; A0~主動區塊; GC~垃圾回收路徑;以及 Non_GC~非垃圾回收的其他有效資料搬移路徑。100~ data storage device; 102~ flash memory; 104~ controller; 106~ host; 108~ idle block pool; 110~ data block pool; A0~ active block; GC~ garbage collection path; and Non_GC ~Non-garbage collection of other effective data moving path.
Claims (22)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910323781.0A CN110888591B (en) | 2018-09-07 | 2019-04-22 | Data storage device and non-volatile memory control method |
US16/505,264 US10896004B2 (en) | 2018-09-07 | 2019-07-08 | Data storage device and control method for non-volatile memory, with shared active block for writing commands and internal data 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 |
---|---|
TW202011196A TW202011196A (en) | 2020-03-16 |
TWI696916B true TWI696916B (en) | 2020-06-21 |
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 After (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
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 |
Country Status (1)
Country | Link |
---|---|
TW (4) | TWI696916B (en) |
Families Citing this family (3)
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 |
TWI775143B (en) * | 2020-09-09 | 2022-08-21 | 群聯電子股份有限公司 | Memory management method, memory storage device and memory control circuit unit |
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 |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060155920A1 (en) * | 2004-12-16 | 2006-07-13 | Smith Peter J | Non-volatile memory and method with multi-stream updating |
CN101645309A (en) * | 2008-08-05 | 2010-02-10 | 威刚科技(苏州)有限公司 | Non-volatile memory device and control method thereof |
US20130173875A1 (en) * | 2011-12-28 | 2013-07-04 | Samsung Electronics Co., Ltd. | Method of managing storage region of memory device, and storage apparatus using the method |
CN104732153A (en) * | 2013-12-18 | 2015-06-24 | 群联电子股份有限公司 | Data erasing method, storage control circuit unit and storage storing device |
TWI604441B (en) * | 2016-01-29 | 2017-11-01 | 瑞昱半導體股份有限公司 | Ssd controlling circuit for determining reusability of data block of ssd |
TWI613652B (en) * | 2017-03-27 | 2018-02-01 | 慧榮科技股份有限公司 | Data storage device and operating method therefor |
TWI615710B (en) * | 2016-12-14 | 2018-02-21 | 群聯電子股份有限公司 | Memory management method, memory storage device and memory control circuit unit |
CN107817943A (en) * | 2016-09-13 | 2018-03-20 | 大心电子股份有限公司 | Data transmission method, memory storage apparatus and memorizer control circuit unit |
TWI627531B (en) * | 2016-11-28 | 2018-06-21 | 慧榮科技股份有限公司 | Data storage device and operating method therefor |
Family Cites Families (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8626936B2 (en) * | 2008-01-23 | 2014-01-07 | International Business Machines Corporation | Protocol independent server replacement and replication in a storage area network |
US8688894B2 (en) * | 2009-09-03 | 2014-04-01 | Pioneer Chip Technology Ltd. | Page based management of flash storage |
US8463826B2 (en) * | 2009-09-03 | 2013-06-11 | Apple Inc. | Incremental garbage collection for non-volatile memories |
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 |
TWI526830B (en) * | 2013-11-14 | 2016-03-21 | 群聯電子股份有限公司 | Data writing method, memory 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 |
US20170123666A1 (en) * | 2015-10-30 | 2017-05-04 | Sandisk Technologies Inc. | System and method for managing maintenance scheduling in a non-volatile memory |
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 |
US10229049B2 (en) * | 2015-12-17 | 2019-03-12 | Toshiba Memory Corporation | Storage system that performs host-initiated garbage collection |
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 |
-
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
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060155920A1 (en) * | 2004-12-16 | 2006-07-13 | Smith Peter J | Non-volatile memory and method with multi-stream updating |
CN101645309A (en) * | 2008-08-05 | 2010-02-10 | 威刚科技(苏州)有限公司 | Non-volatile memory device and control method thereof |
US20130173875A1 (en) * | 2011-12-28 | 2013-07-04 | Samsung Electronics Co., Ltd. | Method of managing storage region of memory device, and storage apparatus using the method |
CN104732153A (en) * | 2013-12-18 | 2015-06-24 | 群联电子股份有限公司 | Data erasing method, storage control circuit unit and storage storing device |
TWI604441B (en) * | 2016-01-29 | 2017-11-01 | 瑞昱半導體股份有限公司 | Ssd controlling circuit for determining reusability of data block of ssd |
CN107817943A (en) * | 2016-09-13 | 2018-03-20 | 大心电子股份有限公司 | Data transmission method, memory storage apparatus and memorizer control circuit unit |
TWI627531B (en) * | 2016-11-28 | 2018-06-21 | 慧榮科技股份有限公司 | Data storage device and operating method therefor |
TWI615710B (en) * | 2016-12-14 | 2018-02-21 | 群聯電子股份有限公司 | Memory management method, memory storage device and memory control circuit unit |
TWI613652B (en) * | 2017-03-27 | 2018-02-01 | 慧榮科技股份有限公司 | Data storage device and operating method therefor |
Also Published As
Publication number | Publication date |
---|---|
TW202036300A (en) | 2020-10-01 |
TWI714975B (en) | 2021-01-01 |
TW202011199A (en) | 2020-03-16 |
TWI768346B (en) | 2022-06-21 |
TWI712882B (en) | 2020-12-11 |
TW202011198A (en) | 2020-03-16 |
TW202011196A (en) | 2020-03-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11593259B2 (en) | Directed sanitization of memory | |
CN110955384B (en) | Data storage device and non-volatile memory control method | |
US9448919B1 (en) | Data storage device accessing garbage collected memory segments | |
US20180285258A1 (en) | Garbage collection | |
US20160062885A1 (en) | Garbage collection method for nonvolatile memory device | |
US11188461B2 (en) | Garbage collection adapted to memory device life expectancy | |
CN115576862A (en) | Garbage collection adapted to host write activity | |
KR101718713B1 (en) | Non-volatile memory system | |
US11334480B2 (en) | Data storage device and non-volatile memory control method | |
TWI696916B (en) | Data storage device and control method for non-volatile memory | |
TW201905711A (en) | Data storage device and method for operating non-volatile memory | |
TWI718710B (en) | Data storage device and non-volatile memory control method | |
JP2022111152A (en) | Device and system for address destination for adjustable width superblock | |
CN111610930A (en) | Data storage device and non-volatile memory control method | |
TWI517165B (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
TW202032563A (en) | Data storage device and control method for non-volatile memory | |
CN110888820B (en) | Data storage device and non-volatile memory control method | |
EP3814911A1 (en) | Controlling nand operation latency | |
US10896004B2 (en) | Data storage device and control method for non-volatile memory, with shared active block for writing commands and internal data collection | |
US11036414B2 (en) | Data storage device and control method for non-volatile memory with high-efficiency garbage collection | |
TW202013191A (en) | Data storage device and control method for non-volatile memory |