TW202121176A - Data storage device and non-volatile memory control method - Google Patents
Data storage device and non-volatile memory control method Download PDFInfo
- Publication number
- TW202121176A TW202121176A TW109117980A TW109117980A TW202121176A TW 202121176 A TW202121176 A TW 202121176A TW 109117980 A TW109117980 A TW 109117980A TW 109117980 A TW109117980 A TW 109117980A TW 202121176 A TW202121176 A TW 202121176A
- Authority
- TW
- Taiwan
- Prior art keywords
- trimming
- length
- bit
- volatile memory
- information
- Prior art date
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
本案係有關於資料儲存裝置之修整(trimming)技術。This case is related to the trimming technology of data storage devices.
非揮發式記憶體有多種形式─例如,快閃記憶體(flash memory)、磁阻式隨機存取記憶體(Magnetoresistive RAM)、鐵電隨機存取記憶體(Ferroelectric RAM)、電阻式隨機存取記憶體(Resistive RAM)、自旋轉移力矩隨機存取記憶體(Spin Transfer Torque-RAM, STT-RAM)…等,用於長時間資料保存,可做為儲存媒體實現一資料儲存裝置。Non-volatile memory has 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 storage media to realize a data storage device.
非揮發式記憶體通常有其特殊的儲存特性。本技術領域需要相應非揮發式記憶體的儲存特性發展相應的控制技術。例如,符合非揮發式記憶體儲存特性的修整(trimming)技術。Non-volatile memory usually has its special storage characteristics. The technical field needs to develop corresponding control technology corresponding to the storage characteristics of non-volatile memory. For example, a trimming technology that meets the storage characteristics of non-volatile memory.
本案相應一種高效修整技術,提出一種復電技術。Corresponding to a high-efficiency repairing technology, this case proposes a power recovery technology.
根據本案一種實施方式實現的一資料儲存裝置包括一非揮發式記憶體、以及耦接該非揮發式記憶體的一控制器以及一暫存記憶體。該控制器係建構來在該暫存記憶體上重建該非揮發式記憶體的修整狀況。該控制器根據一程式化順序掃描該非揮發式記憶體,收集一串修整資訊旗標,據以解讀自該非揮發式記憶體掃描出的一串儲存資訊為邏輯位址、或是修整代號。該控制器根據解讀出的邏輯位址重建一主機-裝置映射表。該控制器根據解讀出的修整代號,判斷該非揮發式記憶體相應儲存空間係儲存中等長度修整之資訊、或大量修整之資訊。根據中等長度修整之資訊,該控制器將虛置映射資料填入該主機-裝置映射表。根據大量修整之資訊,該控制器重建一修整位元總表,該修整位元總表各位元對應一第一長度之修整。A data storage device implemented according to an embodiment of the present application includes a non-volatile memory, a controller coupled to the non-volatile memory, and a temporary memory. The controller is constructed to reconstruct the trim condition of the non-volatile memory on the temporary memory. The controller scans the non-volatile memory according to a programmed sequence, collects a series of trimming information flags, and interprets the series of stored information scanned from the non-volatile memory as logical addresses or trim codes. The controller reconstructs a host-device mapping table according to the decoded logical address. The controller determines whether the corresponding storage space of the non-volatile memory stores medium-length trimmed information or a large amount of trimmed information based on the decoded trim code. Based on the medium-length trimmed information, the controller fills the host-device mapping table with dummy mapping data. According to a large amount of trimming information, the controller rebuilds a trimming bit summary table, and each bit of the trimming bit summary table corresponds to a trimming of a first length.
一種實施方式中,一筆中等長度修整不超過該第一長度,且對齊一第二長度之分界。一筆中等長度修整之資訊包括該筆中等長度修整的起始邏輯位址以及長度。上述修整代號為一中等長度修整代號時,該控制器判斷該非揮發式記憶體相應儲存空間係儲存一筆中等長度修整的起始邏輯位址以及長度。In one embodiment, a stroke of intermediate length trimming does not exceed the first length, and is aligned with a boundary of a second length. The information of a mid-length trim includes the starting logical address and length of the mid-length trim. When the above-mentioned trimming code is a medium-length trimming code, the controller determines that the corresponding storage space of the non-volatile memory stores a medium-length trimmed initial logical address and length.
一種實施方式中,一筆大量修整對齊該第一長度之分界、且為該第一長度之N倍,對應該修整位元總表的N個位元,N為正整數。該修整位元總表包括複數個修整位元子表。上述N個位元對應到該等修整位元子表其中M個修整位元子表,M為正整數。該筆大量修整之資訊包括上述M個修整位元子表。上述修整代號為上述M個修整位元子表的M個子表編號時,該控制器判斷該非揮發式記憶體相應儲存空間係儲存上述M個修整位元子表。In one embodiment, a large amount of trimming is aligned with the boundary of the first length and is N times the first length, corresponding to N bits of the trimming bit table, and N is a positive integer. The total table of trimming bits includes a plurality of sub-tables of trimming bits. The above-mentioned N bits correspond to the M trimming bit subtables among the trimming bit subtables, and M is a positive integer. The large amount of trimmed information includes the above-mentioned M trimming bit subtables. When the dressing code is the M sub-table numbers of the M dressing bit sub-tables, the controller determines that the corresponding storage space of the non-volatile memory stores the M dressing bit sub-tables.
一種實施方式中,該主機-裝置映射表包括複數個映射子表。各映射子表以該第二長度為單位,管理該第一長度之邏輯位址區間的映射資料。In one embodiment, the host-device mapping table includes a plurality of mapping sub-tables. Each mapping sub-table uses the second length as a unit to manage the mapping data of the logical address interval of the first length.
以上控制該非揮發式記憶體的控制器也可以由其他架構實現。本案更可以前述概念實現非揮發式記憶體的控制方法。The above controller for controlling the non-volatile memory can also be implemented by other architectures. In this case, the aforementioned concept can be used to realize the control method of non-volatile memory.
下文特舉實施例,並配合所附圖示,詳細說明本發明內容。Hereinafter, specific embodiments are given in conjunction with the accompanying drawings to illustrate 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 the invention should be defined in accordance with the scope of the patent application.
非揮發式記憶體可以是快閃記憶體(Flash Memory)、磁阻式隨機存取記憶體(Magnetoresistive RAM)、鐵電隨機存取記憶體(Ferroelectric RAM)、電阻式記憶體(Resistive RAM,RRAM)、自旋轉移力矩隨機存取記憶體(Spin Transfer Torque-RAM, STT-RAM)…等,提供長時間資料保存之儲存媒體。以下特別以快閃記憶體為例進行討論。Non-volatile memory can be Flash Memory, Magnetoresistive RAM, Ferroelectric RAM, Resistive RAM, RRAM ), Spin Transfer Torque-RAM (STT-RAM), etc., provide storage media for long-term data storage. The following discussion takes the flash memory as an example.
現今資料儲存裝置常以快閃記憶體為儲存媒體,實現記憶卡(Memory Card)、通用序列匯流排閃存裝置(USB Flash Device)、固態硬碟(SSD) …等產品。有一種應用是採多晶片封裝、將快閃記憶體與其控制器包裝在一起─稱為嵌入式快閃記憶體模組(如eMMC)。Nowadays, data storage devices often use flash memory as storage media to realize products such as Memory Card, USB Flash Device, and Solid State Drive (SSD). One application is to use multi-chip packaging to package flash memory and its controller together-called embedded flash memory modules (such as eMMC).
以快閃記憶體為儲存媒體的資料儲存裝置可應用於多種電子裝置中。所述電子裝置包括智慧型手機、穿戴裝置、平板電腦、虛擬實境設備…等。電子裝置的運算模塊可視為主機(Host),操作所使用的資料儲存裝置,以存取其中快閃記憶體。The data storage device using flash memory as the storage medium can be applied to a variety of electronic devices. The electronic devices include smart phones, wearable devices, tablet computers, virtual reality equipment, 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 therein.
以快閃記憶體為儲存媒體的資料儲存裝置也可用於建構資料中心。例如,伺服器可操作固態硬碟(SSD)陣列形成資料中心。伺服器即可視為主機,操作所連結之固態硬碟,以存取其中快閃記憶體。Data storage devices using flash memory as storage media can also be used to construct data centers. For example, the server can operate a solid state drive (SSD) array to form a data center. The server can be regarded as the host, operating the connected solid-state drive to access the flash memory.
快閃記憶體有其特殊的儲存特性,以下敘述之。Flash memory has its special storage characteristics, which are described below.
主機(Host)端是以邏輯位址(例如,邏輯區塊位址LBA或全域主機頁編號GHP…等)來區別資料。至於資料實際儲存在快閃記憶體何處,則是以映射方式管理。The host side uses logical addresses (for example, logical block address LBA or global host page number GHP... etc.) to distinguish data. As for where the data is actually stored in the flash memory, it is managed by mapping.
快閃記憶體之物理空間是劃分為複數個區塊(Blocks)配置使用。第1圖圖解快閃記憶體中區塊Blk之結構。The physical space of the flash memory is divided into a plurality of blocks (Blocks) for allocation. Figure 1 illustrates the structure of the block Blk in the flash memory.
區塊Blk包括複數頁面(Pages),例如,頁面0…頁面255。各頁面包括複數個區段(Sectors),例如32個區段。每一區段可儲存512B長度的使用者資料;一頁面可供應16KB儲存空間。一種實施方式係根據頁面編號─由低編號至高編號─循序使用一區塊(Blk)的儲存空間。或者,某些實施方式使用的是數據吞吐量大幅提升的多通道技術,係將不同通道存取的區塊視為一個超級區塊(Super Block),將不同通道之間的頁面視為超級頁面(Super Page)。多通道技術可根據超級頁面編號─由低編號至高編號─循序使用一超級區塊的儲存空間。以下討論所指區塊也可以是超級區塊。The block Blk includes a plurality of pages (Pages), for example,
一種實施方式中,一區段(512B) 可對應一個邏輯區塊位址LBA。以4KB資料管理模式為例,八個連續區段組成的4KB空間為一資料管理單元,對應八個連續邏輯區塊位址LBAs之數據儲存,即對應一個全域主機頁編號GHP。一頁面的四段資料管理單元(共16KB)可對應四個全域主機頁編號GHPs。如第1圖所示,區塊Blk包括一閒置區域(spare area)Spare_Area,由各頁末端閒置空間組成,其中可標註對應頁面的四段資料管理單元所對應的四個全域主機頁編號GHPs。一種實施方式是在閒置區域Spare_Area為各段4KB資料管理單元規劃4B的全域主機頁編號GHP欄位(GHP entry)。除了載於該閒置區域Spare_Area,整個區塊Blk空間所映射的全域主機頁編號GHPs也可編排為區塊結尾資訊(end-of-block information,簡稱EoB),載於該區塊Blk最末的頁面255。閒置區域Spare_Area、或區塊結尾資訊(EoB)之全域主機頁編號GHPs記錄就是用於追蹤物理空間以及邏輯位址之間複雜的映射關係。In one embodiment, one sector (512B) can correspond to one logical block address LBA. Taking the 4KB data management mode as an example, a 4KB space composed of eight consecutive sections is a data management unit, corresponding to the data storage of eight consecutive logical block addresses LBAs, which corresponds to a global host page number GHP. One page of four-segment data management unit (16KB in total) can correspond to four global host page numbers GHPs. As shown in Figure 1, the block Blk includes a spare area Spare_Area, which is composed of spare spaces at the end of each page, and four global host page numbers GHPs corresponding to the four-segment data management unit of the corresponding page can be marked. One implementation is to plan a 4B global host page number GHP entry (GHP entry) for each section of 4KB data management unit in the spare area Spare_Area. In addition to being contained in the spare area Spare_Area, the global host page numbers GHPs mapped to the entire block Blk space can also be arranged as end-of-block information (EoB), which is contained in the last Blk of the block Page 255. Spare_Area, or the global host page number GHPs record of the end of block information (EoB) is used to track the complex mapping relationship between the physical space and the logical address.
特別是,快閃記憶體有一項重要特性,就是同樣邏輯位址的資料更新並非覆寫至舊資料的儲存空間。新版本的資料須寫入空白的空間。舊空間的內容無效。一區塊可能僅零星留存有效資料。由於快閃記憶體的儲存空間需抹除(erase)後方能再次使用,備用區塊逐漸消耗。備用區塊數量不足時(如,低於閥值),垃圾回收(Garbage Collection)需求產生。一區塊留存的零星有效資料經垃圾回收集中到其他空間。徒留無效資料的區塊則抹除釋出,拉升備用區塊數量,確保快閃記憶體之正常使用。垃圾回收也可能使得同區塊內容的邏輯順序更跳躍。In particular, an important feature of flash memory is that data updates with the same logical address are not overwritten to the storage space of the old data. The data of the new version must be written into the blank space. The content of the old space is invalid. A block may only retain valid data sporadically. Since the storage space of the flash memory needs to be erased before it can be used again, the spare blocks are gradually consumed. When the number of spare blocks is insufficient (for example, lower than the threshold), garbage collection (Garbage Collection) is required. The scattered valid data stored in one block is collected in other spaces through garbage collection. Blocks with invalid data are erased and released, increasing the number of spare blocks to ensure the normal use of flash memory. Garbage collection may also make the logical order of the contents of the same block jump more.
由前述內容可知,快閃記憶體的空間配置相當複雜。一種實施方式是除了維護前述物理至邏輯映射的資訊外(例如,為各4KB資料管理單元所儲存的4B全域主機頁編號GHP),更反向建立一主機-裝置映射表;如,一主機-快閃記憶體映射表(host-to-flash mapping table,H2F映射表),顯示主機操作用之全域主機頁編號GHP是映射到快閃記憶體哪些實體位址。It can be seen from the foregoing that the spatial configuration of flash memory is quite complicated. One implementation is to maintain the aforementioned physical-to-logical mapping information (for example, the 4B global host page number GHP stored for each 4KB data management unit), and create a host-device mapping table in the reverse direction; for example, a host- The host-to-flash mapping table (host-to-flash mapping table, H2F mapping table) shows which physical addresses of the flash memory the global host page number GHP used for host operation is mapped to.
然而,隨著製程進步,快閃記憶體尺寸越來越大。4TB的快閃記憶體,其主機-快閃記憶體映射表H2F會達4GB。8TB的快閃記憶體,其主機-快閃記憶體映射表H2F會達8GB。過分龐大的主機-快閃記憶體映射表H2F不容易動態管理。However, as the manufacturing process progresses, the size of the flash memory is getting larger and larger. For 4TB flash memory, the host-flash memory mapping table H2F will reach 4GB. For 8TB flash memory, the host-flash memory mapping table H2F will reach 8GB. The oversized host-flash memory mapping table H2F is not easy to dynamically manage.
一種解決方案是將主機-快閃記憶體映射表H2F切分為較小尺寸的映射子表,例如,對應不同邏輯位址群組G#(#為編號)的映射子表H2F_G#。被呼叫到的映射子表H2F_G#才載出參考或更新。相較於完整的主機-快閃記憶體映射表H2F,映射子表H2F_G#的動態更新只耗費少量系統資源。One solution is to divide the host-flash memory mapping table H2F into smaller-sized mapping sub-tables, for example, mapping sub-tables H2F_G# corresponding to different logical address groups G# (# is a number). Only the called mapping sub-table H2F_G# can be referenced or updated. Compared with the complete host-flash memory mapping table H2F, the dynamic update of the mapping sub-table H2F_G# only consumes a small amount of system resources.
本案特別討論快閃記憶體的修整(trim)操作。修整操作是用於無效所指定之邏輯位址區間。由於修整的邏輯位址區間常常尺寸可觀,涉及數量龐大的映射子表H2F_G#更新(載出填入虛置映射資料),非常耗時。本案提出一種新的修整方案,使得該主機-快閃記憶體映射表H2F可部分在修整完成後,再以背景方式更新。以下討論之。This case specifically discusses the trim operation of the flash memory. The trimming operation is used to invalidate the specified logical address range. Since the modified logical address range is often of considerable size, it involves a huge number of mapping sub-table H2F_G# updates (loading out and filling in dummy mapping data), which is very time-consuming. This case proposes a new trimming scheme, so that the host-flash memory mapping table H2F can be partially updated in the background after the trimming is completed. Discuss it below.
第2圖圖解根據本案一種實施方式所實現的一資料儲存裝置200,包括一快閃記憶體202、一控制器204以及一動態隨機存取記憶體(DRAM)206。主機208透過控制器204操作快閃記憶體202。資料儲存裝置200內部也可經控制器204發動快閃記憶體202之最佳化操作;例如,整理快閃記憶體202空間,使其發揮最大儲存效能。控制器204進行運算時是以動態隨機存取記憶體206暫存資料。動態隨機存取記憶體206也可以其他暫存記憶體取代,如靜態隨機存取記憶體SRAM,或其他控制器204得以高速存取的儲存空間。FIG. 2 illustrates a
動態隨機存取記憶體206有多種規劃,包括提供快取區Data_Cache,將資料收集成資料管理單元4KB大小後,再一一沖至(flush)快閃記憶體202的主動區塊A_Blk中。主動區塊A_Blk係選自閒置區塊,待完成寫入則視為資料區塊。完整的主機-快閃記憶體映射表H2F一般保存在快閃記憶體202的系統資訊區塊Info_Blk。資料自快取區Data_Cache沖至主動區塊A_Blk時,相關的映射子表H2F_G#自快閃記憶體202載出修正,再回存快閃記憶體202更新總表H2F。傳統修整也包括映射子表H2F_G#的載出修正以及回存。但大量修整涉及到複數個映射子表H2F_G#更新,非常耗時。本案提出替代方案。根據主機208發出的一修整指令(trim command),控制器204編寫該快取區Data_Cache快取一修整標籤Trim_Tag,反映修整狀況,使修整狀況也會沖至主動區塊A_Blk作非揮發式儲存。修整標籤Trim_Tag註明主機-快閃記憶體映射表H2F還有哪些部分沒有隨著修整指令更新。控制器204可以在填寫指令完成佇列(completion queue)回報主機208修整指令完成後,再找機會,根據修整標籤Trim_Tag,將映射子表H2F_G#一一載出更新,符合修整需求。如此一來,控制器204不會被修整指令困住。資料儲存裝置200效能顯著提升。The dynamic
為了幫助解讀該修整標籤Trim_Tag,控制器204更在該動態隨機存取記憶體206上維護修整資訊旗標表TIFM、修整代號Trim_Code、以及修整位元總表TBM。修整資訊旗標表TIFM以及修整代號Trim_Code的內容也會沖至主動區塊A_Blk的閒置區域210作非揮發式儲存,後續若有復電重建需求,就可以根據閒置區域210解讀出快閃記憶體202相對頁面是儲存修整標籤Trim_Tag。修整位元總表TBM是以簡單位元方式標註主機-快閃記憶體映射表H2F中未同步處,使控制器204正確回復主機208讀、寫指令。To help interpret the trim tag Trim_Tag, the
本案將修整分為三種類型:大量修整;中等長度修整;以及少量修整。大量修整對齊一第一長度之分界、且為該第一長度之N倍,N為正整數。中等長度修整不超過該第一長度,且對齊一第二長度之分界。少量修整短於該第二長度。一種實施方式中,映射子表H2F_G#管理的邏輯位址長度即該第一長度,例如2MB。一種實施方式中,資料管理單元尺寸(即快取區Data_Cache各儲存格尺寸)即該第二長度,例如4KB。三種尺寸的修整技術不同。少量修整是直接填虛置資料(dummy data)代表該段邏輯位址區間已修整。中等長度修整是快取起始邏輯位址以及長度。大量修整是快取該修整位元總表TBM的相關部分。In this case, the trimming is divided into three types: heavy trimming; medium length trimming; and small trimming. Mass trimming aligns to a boundary of a first length and is N times the first length, where N is a positive integer. The medium length trimming does not exceed the first length, and is aligned with the boundary of a second length. A small amount of trimming is shorter than this second length. In an implementation manner, the length of the logical address managed by the mapping sub-table H2F_G# is the first length, for example, 2MB. In one embodiment, the size of the data management unit (that is, the size of each cell in the cache area Data_Cache) is the second length, for example, 4KB. The trimming techniques for the three sizes are different. A small amount of trimming is to fill in dummy data directly, which means that the logical address range of the segment has been trimmed. The medium length trimming is to cache the starting logical address and length. A large number of trimming is to cache the relevant part of the trimming bit table TBM.
以下以邏輯區塊位址LBA 5~LBA 100664323之修整為例,討論本案控制器204之操作細節。The following takes the modification of the logical block addresses
第3圖圖解修整之分類。主機208對邏輯區塊位址LBA 5~LBA 100664323發出修整指令。控制器204分類該修整指令指定的修整範圍LBA 5~LBA 100664323,將之分為區間302、304、306、308以及310。區間306為大量修整,位於邏輯區塊位址LBA 4096~LBA 100663295,對齊2MB分界,儘可能的在整體修整範圍中,切出2MB倍數的最大修整。區間306之前包括:小於4KB的區間302,位於邏輯區塊位址LBA 5~LBA 7,對應首位少量修整;以及對齊4KB分界、但不足2MB的區間304,位於邏輯區塊位址LBA 8~LBA 4095,對應首位中等長度修整。區間306之後包括:對齊4KB分界但不足2MB的區間308,位於邏輯區塊位址LBA 100663296~LBA 100664319,對應末位中等長度修整;以及小於4KB的區間310,位於邏輯區塊位址LBA 100664320~LBA 100664323,對應末位少量修整。Figure 3 illustrates the classification of trimmings. The
第4圖圖解首位少量修整(302),其中修整邏輯區塊位址LBA 5~LBA 7,包括:步驟1,填寫4KB內容進快取區Data_Cache;以及,步驟2,更新主機-快閃記憶體映射表H2F。Figure 4 illustrates the first minor trimming (302), in which the logic
步驟1,控制器204將邏輯區塊位址LBA 0~LBA 4(不修整區間)的原本資料填入快取區Data_Cache的區間402,並對應要修整的邏輯區塊位址LBA 5~LBA 7填寫虛置資料(dummy data例如,零)至快取區Data_Cache的區間404。區間402中關於邏輯區塊位址LBA 0~LBA 4的2.5KB不修整資料、以及區間404中1.5KB的虛置資料組合成4KB資料,符合4KB資料管理單元,由快取區Data_Cache一個儲存格快取。
步驟2,控制器204在動態隨機記憶體206上更新邏輯區塊位址LBA 0~LBA 7(即GHP 0)對應的映射子表H2F_G0,以更新該主機-快閃記憶體映射表H2F。控制器204將全域主機頁編號GHP 0的映射資料指向該快取區Data_Cache上述區間402以及404組成的該4KB儲存格。如此一來,全域主機頁編號GHP 0的映射綁定此4KB內容。虛置資料代表邏輯區塊位址LBA 5~LBA 7的修整狀態。對應該快取區Data_Cache的複數個儲存格,控制器204會在動態隨機存取記憶體206上更維護一儲存資訊表(未繪製在此圖),在對應儲存格快取的是使用者資料時,記錄一邏輯位址;此例即記錄全域主機編號GHP 0,將與快取區Data_Cache儲存格內容一起沖至主動區塊A_Blk作為儲存資訊,例如,用作日後主機-快閃記憶體映射表H2F重建。後面討論的應用中,快取區Data_Cache儲存格儲存的可以不是使用者資訊,而是修整資訊,則該儲存資訊表可對應儲存其他內容,例如:修整代號。Step 2: The
第5圖圖解首位中等長度修整(304) ,其中修整邏輯區塊位址LBA 8~LBA 4095,包括:步驟1,更新主機-快閃記憶體映射表H2F;步驟2,編寫修整資訊旗標表TIFM、以及修整代號Trim_Code;以及,步驟3,將修整資訊填入快取區Data_Cache。Figure 5 illustrates the first medium-length trimming (304), in which the logic block address is
步驟1,控制器204在動態隨機記憶體206上更新邏輯區塊位址LBA 8~LBA 4095 (即GHP 1~GHP 511)對應的映射子表H2F_G0,以更新該主機-快閃記憶體映射表H2F。控制器204填入虛置映射資料(如,零)作為全域主機頁編號GHP 1~GHP 511的映射資料。不同於少量修整是填充虛置資料,中等長度資料修整是填充虛置映射資料。
步驟2,控制器204編寫修整資訊旗標表TIFM、以及修整代號Trim_Code。修整資訊旗標表TIFM各位元對應該快取區Data_Cache一個4KB儲存格。修整代號Trim_Code則是填入前述儲存資訊表中。接續在區間404後的4KB儲存格所對應的修整資訊旗標表TIFM位元設立為”1”,表示該儲存格4KB內容要解讀為修整資訊,不可當使用者資料解讀。控制器204是在上述儲存資訊表對應填寫4B的修整代號Trim_Code,包括:2B的數據”0xAAAA”;以及2B的虛置代號(例如全零)。此實施方式中,修整代號Trim_Code是以2B編寫。快取區Data_Cache是以切半的儲存格,用2KB空間儲存修整資訊。2KB”0xAAAA”代表2KB區間502所填寫的修整資訊係中等長度修整的起始邏輯位址以及長度。Step 2: The
步驟3,控制器204將修整資訊填入快取區Data_Cache,在2KB區間502中填入起始邏輯位址GHP 1以及修整長度511,註明修整範圍為GHP 1~GHP 511,即首位中等長度修整(304)要求修整的邏輯區塊位址LBA 8~LBA 4095。如圖所示,2KB區間502其他未使用到的地方是填入虛置資料。Step 3. The
大量修整(306)則用到修整位元總表(trim bit map,TBM),其中每1位元對應邏輯空間上2MB長度;”1”代表修整。4TB容量的裝置需建構256KB(=4TB/2MB)的修整位元總表TBM。如此龐大的修整位元總表TBM更可以2KB為單位分組,分為128個修整位元子表TBM_G#(#為子表編號)。完整256KB修整位元總表TBM可載於動態隨機存取記憶體206上動態管理。但寫入快取區 Data_Cache作為修整資訊沖至主動區塊A_Blk的可以只是修整位元子表TBM_G#。Mass trimming (306) uses trim bit map (TBM), where each bit corresponds to a length of 2MB in the logical space; "1" represents trimming. A 4TB capacity device needs to build a 256KB (=4TB/2MB) trimmed bit table TBM. Such a huge trimming bit total table TBM can be grouped in units of 2KB and divided into 128 trimming bit sub-tables TBM_G# (# is the sub-table number). The complete 256KB trimmed bit summary table TBM can be loaded on the dynamic
第6A圖以及第6B圖圖解大量修整(306),其中修整邏輯區塊位址LBA 4096~LBA 100663295,包括:步驟1,更新修整位元總表TBM;步驟2,編寫修整資訊旗標表TIFM、以及修整代號Trim_Code;以及,步驟3,將修整資訊填入快取區Data_Cache。Figure 6A and Figure 6B illustrate a large number of trimming (306), in which the logic block address of the trimming is
步驟1,控制器204對動態隨機記憶體206上暫存的256KB修整位元總表TBM進行更新。邏輯區塊位址LBA 4096~LBA 100663295即LBA 2MB~49152MB,對應修整位元總表TBM中的位元1~24596,屬修整位元總表TBM前3KB的內容。如圖所示,控制器204將修整位元總表TBM中的位元1~24596翻成”1”,其中涉及兩個修整位元子表:TBM_G0(第一段2KB內容);以及TBM_G1(第二段2KB內容)。
步驟2,控制器204編寫修整資訊旗標表TIFM、以及修整代號Trim_Code。控制器204是規劃修整位元子表TBM_G0(第一段2KB內容)、以及TBM_G1(第二段2KB內容)分別由快取區Data_Cache的2KB區間602、以及2KB區間604快取。區間602所屬該4KB空間(包括區間502以及602)早已由修整資訊旗標表TIFM中對應位元標示(“1”)。控制器204在此步驟是對接續4KB快取空間(包括區間604)進行標示,使修整資訊旗標表TIFM中對應位元也為“1”。控制器204編寫修整代號Trim_Code。對應區間502的0xAAAA之後是對應區間602填寫一子表編號0x0000(為修整位元子表TBM_G0之編號),再對應區間604填寫一子表編號0x0001(為修整位元子表TBM_G1之編號)。Step 2: The
步驟3,控制器204將修整資訊填入快取區Data_Cache,在2KB區間602填入修整位元子表TBM_G0,並在2KB區間604填入修整位元子表TBM_G1。Step 3, the
第6B圖圖解填入快取區Data_Cache區間602、604的修整位元子表TBM_G0、TBM_G1。2KB的修整位元子表TBM_G0中,只有第一個位元(對應首位少量、以及中等長度修整已經處理的GHP 0~GHP 511)為零,其餘位元都是1。2KB的修整位元子表TBM_G1中,頭1KB位元為1,其餘位元都是0。邏輯區塊位址範圍LBA 2MB~49152MB即(LBA 4096~LBA 100663295)被修整。Figure 6B illustrates the trimming bit sub-tables TBM_G0 and TBM_G1 filled in the
大量修整(306)後,控制器204進行末位中等長度修整(308)。隨後,控制器204進行末位少量修整(310)。After extensive trimming (306), the
第7圖圖解末位中等長度修整(308)。修整邏輯區塊位址LBA 100663296~LBA 100664319,對應全域主機頁編號GHP 0xC00000~GHP 0xC0007F,技術同首位中等長度修整(304)。Figure 7 illustrates the last mid-length trimming (308). The address of the trimming logic block is
步驟1,控制器204在動態隨機記憶體206上更新邏輯區塊位址LBA 100663296~LBA 100664319 (即GHP 0xC00000~GHP 0xC0007F)對應的映射子表H2F_G48,以更新該主機-快閃記憶體映射表H2F。控制器204填入虛置映射資料作為全域主機頁編號GHP 0xC00000~GHP 0xC0007F的映射資料。
步驟2,控制器204編寫修整資訊旗標表TIFM、以及修整代號Trim_Code。快取區Data_Cache上,2KB的區間702對應末位中等長度修整(308)。區間702所屬該4KB空間(包括區間604以及702)早已由修整資訊旗標表TIFM中對應位元標示(“1”),故此步驟沒有變動之。至於修整代號Trim_Code,在相應區間604的修整位元子表TBM_G1編號0x0001之後,控制器204相應區間702填上”0xAAAA”,代表2KB區間702所快取的是中等長度修整之修整資訊。Step 2: The
步驟3,控制器204將修整資訊填入快取區Data_Cache,在2KB區間702中填入起始邏輯位址GHP0xC0000以及修整長度0x80,註明修整範圍為GHP C0000~GHP 0xC0007F,即末位中等長度修整(308)要求修整的邏輯區塊位址LBA 100663296~LBA 100664319。Step 3. The
第8圖圖解末位少量修整(310),其中修整邏輯區塊位址LBA 100664320~LBA 100664323,對應全域主機頁編號GHP 0xC00080。技術同首位少量修整(302)。Figure 8 illustrates the last bit trimming (310), where the trim logic block address is
步驟1,控制器204對應修整邏輯區塊位址範圍LBA 100664320~LBA 100664323填寫虛置資料至快取區Data_Cache的區間802,並將邏輯位址LBA 100664324~LBA 100664327(不修整區間)的原本資料填入快取區Data_Cache的區間804。區間802的2KB虛置資料、以及區間804中關於邏輯位址LBA 100664324~LBA 100664327的2KB資料組合成4KB資料,符合4KB資料管理單元,由快取區Data_Cache一個儲存格快取。
步驟2,控制器204在動態隨機記憶體206上更新邏輯區塊位址LBA 100664320~LBA 100664327 (即GHP 0xC00080)對應的映射子表H2F_G48,以更新該主機-快閃記憶體映射表H2F。如此一來,全域主機頁編號GHP 0xC00080的映射綁定此4KB內容。虛置資料代表邏輯區塊位址LBA 100664320~LBA 100664323的修整狀態。Step 2: The
第9圖整理LBA 5~LBA 100664323修整指令執行後,動態隨機存取記憶體206上存在內容。Figure 9 summarizes the contents of the dynamic
快取區Data_Cache上,修整標籤Trim_Tag佔4個儲存格。區間402以及404相應首位少量修整(302),為原始資料(LBA 0~LBA4)以及虛置資料結合的4KB內容。區間502佔2KB,相應首位中等長度修整(304),所載為起始邏輯位址GHP 1以及長度511。區間602以及604各佔2KB,相應大量修等(306),所載為修整位元子表TBM_G0以及TBM_G1。區間702佔2KB,相應末位中等長度修整(308),所載為起始邏輯位址GHP 0xC00000以及修整長度0x80。區間802以及804相應末位少量修整(310),為虛置資料以及LBA 100664324~LBA 100664327原始資料結合的4KB內容。On the Data_Cache in the cache area, the trim tag Trim_Tag occupies 4 cells. The first part of the
相應該修整標籤Trim_Tag,修整資訊旗標表TIFM載有四個位元”0”、”1”、”1”、”0”。 中間的兩個”1”使得儲存資訊表上對應的8B全域主機頁編號GHP#儲存區域轉而儲存修整代號Trim_Code,為[0xAAAA; 0x0000; 0x0001; 0xAAAA]。Corresponding to the trimming tag Trim_Tag, the trimming information flag table TIFM contains four bits "0", "1", "1", and "0". The two "1"s in the middle make the corresponding 8B global host page number GHP# storage area on the storage information table change to store the trim code Trim_Code, which is [0xAAAA; 0x0000; 0x0001; 0xAAAA].
至於主機-快閃記憶體映射表H2F,動態隨機存取記憶體206上只載有最末少量修整(310)時處理到的映射子表H2F_G48。但結合已封存到系統資訊區塊Info_Blk的主機-快閃記憶體映射表H2F,可知前述修整過程中,映射資訊僅有部分更新,包括:GHP0指向區間402以及404所在4KB空間;GHP1~GHP511、GHP0xC0000~0xC0007F填虛置映射資料;且GHP 0xC00080指向區間802以及804所在4KB空間。未來得及更新的映射資訊載明在修整位元總表TBM。As for the host-flash memory mapping table H2F, the dynamic
如圖所示,修整位元總表TBM則在前3KB處,標示出LBA 2M~49152MB的已修整狀況,彌補主機-快閃記憶體映射表H2F未同步更新的部分。As shown in the figure, the trimming bit summary table TBM is in the first 3KB, indicating the trimmed status of LBA 2M~49152MB, to make up for the part of the host-flash memory mapping table H2F that has not been updated synchronously.
一種實施方式中,主機208發出讀取要求時,控制器204可根據主機208要求讀取的邏輯區塊位址區間查詢該修整位元總表TBM。”1”代表對應的2MB已修整。若為”0”,控制器204需再查詢該主機-快閃記憶體映射表H2F。虛置映射資料代表該段空間已修整。若指向虛置資料(如404、802),其解讀同修整空間。In one embodiment, when the
圖示佔據4個4KB快取儲存格的修整標籤Trim_Tag,需與其相應的修整資訊旗標[0, 1, 1, 0]、以及8B的修整代號Trim_Code([0xAAAA, 0x0000, 0x0001, 0xAAAA])沖 (flush)至快閃記憶體202主動區塊A_Blk做非揮發式儲存,以應付非預期斷電後,於復電程序重建修整狀況的需求。修整標籤Trim_Tag可寫入一頁的資料區。修整代號Trim_Code([0xAAAA, 0x0000, 0x0001, 0xAAAA])可以該頁之閒置區域210中,原本規劃來儲存映射之全域主機頁編號GHP#的地方。修整資訊旗標[0, 1, 1, 0]可在閒置區域210中另外儲存,也可另外編碼結合在修整代號Trim_Code中。The icon occupies 4 trimming tags Trim_Tag of 4KB cache cells, and the trimming information flags [0, 1, 1, 0] and 8B trimming code Trim_Code ([0xAAAA, 0x0000, 0x0001, 0xAAAA]) are required. Flush to the active block A_Blk of the
以下討論控制器204冗閒時,如何完成主機-快閃記憶體映射表H2F之更新。主機-快閃記憶體映射表H2F更新會一併維護快閃記憶體202各區塊的一有效頁數(valid page count)表。即使以修整位元總表TBM暫時應付修整指令,修整對有效頁數表的影響也能在控制器204冗閒時反應在有效頁數表上。The following discusses how to update the host-flash memory mapping table H2F when the
一種實施方式中,控制器204將該修整位元總表TBM的”1”值逐位元翻成”0”。每位元翻轉對應 2MB,係以前述中等長度修整技術(第5或7圖),將此2MB的修整反應在對應的映射子表H2F_G#、以及快取區Data_Cache上,並以前述大量修整區間的修整技術(第6A、6B圖),將有逐位元翻轉的修整位元子表TBM_G#一一快取於快取區Data_Cache。In one embodiment, the
第10A、10B以及10C圖圖解該修整位元總表TBM一位元之”1”至”0”翻轉。Figures 10A, 10B, and 10C illustrate the "1" to "0" reversal of one bit of the trimming bit table TBM.
第10A圖顯示翻轉的目標位元,即目標修整位元子表TBM_G0頭一個”1”位元,將之翻成”0”,即目標修整GHP 512~GHP 1023。Figure 10A shows the flipped target bit, that is, the first "1" bit in the target trimming bit sub-table TBM_G0, which is turned into "0", that is, the
第10B圖採用前述中等長度修整技術(第5或7圖),將目標位元相應的2MB目標修整(GHP 512~GHP 1023)更新至該主機-快閃記憶體映射表H2F,並包括快取區Data_Cache、修整資訊旗標表TIFM、以及修整代號Trim_Code的編寫。Figure 10B uses the aforementioned medium-length trimming technique (Figure 5 or 7) to update the 2MB target trimming (
步驟1,控制器204在動態隨機記憶體206上更新該2MB目標修整(GHP 512~GHP 1023)對應的映射子表H2F_G1,以更新該主機-快閃記憶體映射表H2F。控制器204填入虛置映射資料(如,零)作為全域主機頁編號GHP 512~GHP 1023的映射資料。
步驟2,控制器204編寫修整資訊旗標表TIFM、以及修整代號Trim_Code。修整資訊旗標表TIFM的一位元設定“1”,標示此次目標位元翻轉會使用到的快閃區Data_Cache儲存格。控制器204是規劃快取區Data_Cache的2KB區間1002(半個儲存格)儲存此目標修整(GHP 512~GHP 1023)的起始邏輯位址GHP 512以及長度512。對應的4B修整代號Trim_Code即以”0xAAAA”指示區間1002內容的解讀方式。剩餘2B修整代號Trim_Code則暫填虛置數據。Step 2: The
步驟3,對應”0xAAAA”修整代號,控制器204將目標修整(GHP 512~GHP 1023)起始邏輯位址GHP 512以及長度512填入快取區Data_Cache的2KB半個儲存格1002。Step 3. Corresponding to the “0xAAAA” trim code, the
第10C圖採用前述大量區間修整技術(第6A、6B圖),將目標位元已翻轉的目標修整位元子表TBM_G0載入快取區Data_Cache。Figure 10C uses the aforementioned mass interval trimming technology (Figures 6A and 6B) to load the target trimming bit sub-table TBM_G0 whose target bit has been flipped into the cache Data_Cache.
步驟1,控制器204對動態隨機記憶體206上暫存的256KB之修整位元總表TBM進行更新。即第二位元翻”0”。
步驟2,控制器204編寫修整資訊旗標表TIFM、以及修整代號Trim_Code。控制器204是規劃區間1004快取該目標修整位元子表TBM_G0。區間1004所屬該4KB空間(包括區間1002以及1004)早已由修整資訊旗標表TIFM中對應位元標示(“1”),此處不再調整。但該修整代號Trim_Code中,控制器204在對應區間1002的0xAAAA之後的2B填寫該目標修整位元子表TBM_G0之目標子表編號0x0000。Step 2: The
步驟3,控制器204在2KB區間1004中填入最新版本的該目標修整位元子表TBM_G0。Step 3: The
整理之,控制器204是在填寫一指令完成佇列(completion queue)回報主機208一第一指令完成後,但尚未自一指令佇列(command queue)獲得主機208發出的一第二指令時,利用此閒冗區間,逐位元將修整位元總表TBM狀況更新到主機-快閃記憶體映射表H2F。每位元翻轉指涉及一個映射子表H2F_G#更新,不會過度耗時。In summary, the
以下更討論主機208的寫入指令。倘若要求寫入的邏輯位址是由該修整位元總表TBM標示成已修整,控制器204需要以前述修整位元總表TBM翻轉技術更新該主機-快閃記憶體映射表H2F(第10A~10C圖),再進行寫入動作。The write command of the
第11圖圖解LBA 10240(5MB)起始的12KB寫入如何被回應。Figure 11 illustrates how the initial 12KB write of LBA 10240 (5MB) is responded to.
快取區Data_Cache以2KB區間1102以及2KB區間1104反映該修整位元總表TBM相應位元之翻轉。此例中,該修整位元總表TBM的第三個位元(對應5MB,屬修整位元子表TBM_G0)為翻轉的目標位元,對應2MB目標修整GHP 1024~1535,其映射資訊屬映射子表H2F_G3。控制器204將映射子表H2F_G3為全域主機頁GHP 1024~1535全數填上虛置映射資料,並在快取區Data_Cache半個儲存格的2KB空間1102儲存目標修整GHP 1024~1535的起始邏輯位址GHP 1024、以及長度512。隨後,控制器204翻轉該修整位元總表TBM,並將翻轉後的該修整位元子表TBM_G0填入儲存格1104。同前述技術,雖未繪製在圖中,但對應區間1102、1104的填寫,控制器204還將修整資訊旗標表TIFM對應位元設立為”1”,且修整代號Trim_Code為[0xAAAA, 0x0000]。The cache area Data_Cache uses
映射子表H2F_G3反映出GHP 1024~1535修整狀況後,控制器204就可以安心進行其上12KB的使用者資料寫入。如圖所示,控制器204將12KB寫入資料快取於區間1106所標示的三個儲存格。此時,本全為虛置映射資料的映射子表H2F_G3,其中全域主機頁編號GHP1279~1281會改成指向區間1106。全域主機頁編號GHP 1024~1278、以及GHP 1282~1535的修整狀態仍可由其虛置映射資訊觀察而得。After the mapping sub-table H2F_G3 reflects the modification status of
一種實施方式中,非預期斷電事件發生時,為了善用裝置電力,控制器204可能只會挽救動態隨機存取記憶體206部分內容,例如,只將快取區Data_Cache內容、快取區Data_Cache各儲存格對應資訊(包括標示邏輯位址、或修整代號的各儲存格儲存資訊、以及修整資訊旗標表TIFM)沖至快閃記憶體202。修整位元總表TBM會遺失。主機-快閃記憶體映射表H2F部分內容可能也來不及更新。因此,非預期斷電之復電(sudden power-off recovery,SPOR)需要一個重建機制,重建修整位元總表TBM、以及主機-快閃記憶體映射表H2F。In one embodiment, when an unexpected power failure event occurs, in order to make good use of the device power, the
第12A、12B、12C圖根據本案一種實施方式圖解表格重建機制。Figures 12A, 12B, and 12C illustrate the table reconstruction mechanism according to an embodiment of this case.
參閱第12A圖,復電時,控制器204掃描快閃記憶體202(例如,根據系統資訊區塊Info_Blk所載的區塊使用順序),於各區塊的區塊結尾資訊EoB中收集到一串修整資訊旗標1202。各位元對應所屬區塊相對位置的4KB資料、以及該4KB資料的4B儲存資訊(為全域主機頁編號GHP#、或是修整代號Trim_Code)。位元值”0”,則對應的該4KB資料被解讀為使用者資料,對應的4B儲存資訊乃映射之全域主機頁編號GHP#。位元值”1”,則對應的該4KB資料被解讀為修整資訊,對應的4B儲存資訊乃修整代號Trim_Code。該串修整資訊旗標1202對應五段各為4KB的資料,且對應的五段各為4B的儲存資訊1204。儲存資訊1204也可以是自區塊結尾資訊EoB取得。Referring to Figure 12A, when power is restored, the
如圖所示,該串修整資訊旗標1202中,第一個”1”值對應儲存資訊1204內的4B儲存資訊[0xAAAA, 0X0003],表示其在區塊中對應的4KB資料乃兩種類型的修整資訊。”0xAAAA”表示前端2KB資料乃一中等長度修整的起始邏輯位址、以及長度。非”0xAAAA”的”0x0003”則應當解讀為一子表編號,表示後端2KB資料乃一大量修整的修整位元子表TBM_G3。該串修整資訊旗標1202另有第二個”1”值,對應儲存資訊1204內的4B儲存資訊[0xAAAA, 虛置資料],表示其在區塊中對應的4KB資料只有前端2KB資料有意義。”0xAAAA”表示前端2KB資料乃一中等長度修整的起始邏輯位址、以及長度。以下特別討論該串修整資訊旗標1202中第一個”1”值所涉及的表格重建。As shown in the figure, the first "1" value in the modified
參閱第12B圖,根據”0xAAAA”,區塊中對應的2KB資料乃一中等長度修整的起始邏輯位址GHP0x100、以及長度0x80。控制器204在動態隨機存取記憶體206上,將相應的映射子表H2F_G0載出,令全域主機頁編號GHP0x100~GHP0x17F的映射資料都填虛置映射資料。因此,主機-快閃記憶體映射表H2F更新,確實反映出全域主機頁編號GHP0x100~GHP0x17F的修整狀態。Referring to Figure 12B, according to "0xAAAA", the corresponding 2KB data in the block is a medium-length trimmed starting logical address GHP0x100 and a length of 0x80. The
參閱第12C圖,根據” 0x0003”, 區塊中對應的2KB資料乃一大量修整的修整位元子表TBM_G3。控制器204會將此2KB修整位元子表TBM_G3更新到動態隨機存取記憶體206上完整維護的修整位元總表TBM中,重建修整位元總表TBM。Referring to Figure 12C, according to "0x0003", the corresponding 2KB data in the block is a subtable TBM_G3 with a large number of trimming bits. The
第13圖根據本案一種實施方式圖解修整指令(trim command)處理方法。步驟S1302接收一修整指令。步驟S1304分類該修整範圍(第3圖)。步驟S1306進行首位少量修整(第4圖),若不存在首位少量修整可跳過此步驟。步驟S1308進行首位中等長度修整(第5圖),若不存在首位中等長度修整可跳過此步驟。步驟S1310進行大量修整(第6A、6B圖),若不存在大量修整可跳過此步驟。步驟S1312進行末位中等長度修整(第7圖),若不存在末位中等長度修整可跳過此步驟。步驟S1314進行末位少量修整(第8圖),若不存在末位少量修整可跳過此步驟。各分類修整完畢後,該修整指令即完成。如,控制器204可回填指令完成佇列(completion queue)告知主機208修整完成,控制器204可再接收主機208其他指令。如前述,流程中大量修整(S1310)並不會耗費資源在主機-快閃記憶體映射表H2F更新上。控制器204以第13圖修整程序快速回應修整指令,進而執行主機208接續其他要求。Figure 13 illustrates a trim command processing method according to an embodiment of the present case. Step S1302 receives a trimming instruction. Step S1304 classifies the trimming range (Figure 3). In step S1306, the first minor trimming is performed (Figure 4). If there is no leading minor trimming, this step can be skipped. In step S1308, the first mid-length trimming is performed (Figure 5). If there is no first mid-length trimming, this step can be skipped. Step S1310 performs a large amount of trimming (Figure 6A, 6B). If there is no large amount of trimming, this step can be skipped. Step S1312 performs last mid-length trimming (Figure 7). If there is no last mid-length trimming, this step can be skipped. Step S1314 performs the last small trimming (Figure 8). If there is no last small trimming, this step can be skipped. After the finishing of each category, the finishing instruction is completed. For example, the
第13圖修整程序後,動態隨機存取記憶體206所維護的內容可如第9圖所示。關於主機208再發出的讀取指令,控制器204會參考該修整位元總表TBM進行,避免漏掉尚未更新到主機-快閃記憶體映射表H2F的修整狀況。非預期斷電時,控制器204會將修整標籤Trim_Tag、TIFM中相應的修整資訊旗標、以及修整代號Trim_Code沖(flush)至快閃記憶體202,以應付復電需求。After the trimming process in FIG. 13, the content maintained by the dynamic
第14圖為流程圖,根據本案一種實施方式圖解如何根據該修整位元總表TBM背景更新該主機-快閃記憶體映射表H2F。Figure 14 is a flowchart illustrating how to update the host-flash memory mapping table H2F according to the background of the trimming bit summary table TBM according to an embodiment of this case.
步驟S1402,對應一修整位元子表TBM_G#中一位元的”1”à”0”翻轉,控制器204以中等長度修整更新該主機-快閃記憶體映射表H2F(包括相應映射子表H2F_G#填寫虛置映射資料、且將其起始邏輯位址以及長度快取於快取區Data_Cache)。步驟S1404,控制器204以大量修整將新版的該修整位元子表TBM_G#快取於該快取區Data_Cache。步驟S1406判斷控制器204是否閒冗;例如,主機208塞入指令佇列(command queue)中的指令是否都執行完畢。空閒的控制器204可更在步驟S1408確定該修整位元總表TBM尚未完全被”1”à”0”翻轉時,再次進行步驟S1402以及S1404。若控制器204有待應付的主機208指令,則進行步驟S1410回應主機208新發出的指令。Step S1402, corresponding to the one-bit "1"→"0" in the trimming bit sub-table TBM_G#, the
第15圖為流程圖,根據本案一種實施方式圖解如何回應主機208發出的寫入指令。FIG. 15 is a flowchart illustrating how to respond to the write command sent by the
步驟S1502,控制器204接收一寫入指令。步驟S1504,控制器204查詢該修整位元總表TBM,確定該寫入指令要求寫入資料的邏輯位址是否被該修整位元總表TBM標註。若是標註在一修整位元子表TBM_G#的一位元Bit#,控制器204進行步驟S1506,對該修整位元子表TBM_G#的該位元Bit#作”1”à”0”翻轉,其中以中等長度修整更新該主機-快閃記憶體映射表H2F(包括相應映射子表H2F_G#填寫虛置映射資料、且將其起始邏輯位址以及長度快取於快取區Data_Cache),再以大量修整將新版的該修整位元子表TBM_G#快取於該快取區Data_Cache。步驟S1508,控制器204將寫入資料快取於該快取區Data_Cache。步驟S1510,控制器204更新主機-快閃記憶體映射表H2F,將寫入資料的映射資訊填為該快取區Data_Cache。以上步驟妥善應付大量修整後發生的少量寫入。In step S1502, the
第16圖為流程圖,根據本案一種實施方式圖解如何一復電程序。Figure 16 is a flowchart illustrating how to perform a power recovery procedure according to an embodiment of this case.
步驟S1602復電。步驟S1604,控制器204掃描快閃記憶體202(例如,根據程式化順序),獲得一串修整資訊旗標。步驟S1606,控制器204判讀該串修整資訊旗標其中一位元。若為”1”,控制器204以步驟S1608更判讀修整代號。若為”0xAAAA”,控制器204以步驟S1610解讀出一中等長度修整之起始邏輯位址以及修整長度,據以重建該主機-快閃記憶體映射表H2F中對應部分(填虛置映射資料)。步驟S1608若判斷出修整代號為一修整位元子表TBM_G#的子表編號,控制器204以步驟S1612解讀出修整位元子表TBM_G#,據以重建該修整位元總表TBM。步驟S1614判別是否該修整資訊旗標對應的兩個修整代號都完成判讀。若否,控制器204再次進行步驟S1608。若是,控制器204以步驟S1616判斷是否該串修整資訊旗標處理完畢。若否,控制器重回步驟S1606。若是,流程結束。Step S1602 restores power. In step S1604, the
步驟S1606若判讀一修整資訊旗標為”0”,則進行步驟S1618,控制器204解讀出4KB使用者資料對應的全域主機頁編號GHP#,據以更新該主機-快閃記憶體映射表H2F。Step S1606: If it is determined that a trimming information flag is "0", then step S1618 is performed, and the
以上控制器204對快閃記憶體202之操作設計也可以由其他結構實現。凡是根據前述概念執行修整者,都屬於本案欲保護範圍。本案更可以前述概念實現非揮發式記憶體的控制方法。The operation design of the
雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明,任何熟悉此項技藝者,在不脫離本發明之精神和範圍內,當可做些許更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in preferred embodiments as above, it is not intended to limit the present invention. Anyone familiar with the art can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of protection shall be subject to the scope of the attached patent application.
200:資料儲存裝置
202:快閃記憶體
204:控制器
206:動態隨機存取記憶體(DRAM)
208:主機
210:主動區塊A_Blk的閒置區域
302…310:修整邏輯位址範圍分類區間
402、404、502、602、604、702、802、804、1002、1004、1102、1104、1106:快取區Data_Cache之儲存區間
1202:一串修整資訊旗標
1204:一串儲存資訊
A_Blk:主動區塊
Blk:區塊
Data_Cache:快取區
GHP0、GHP1、GHP511、GHP0x100、GHP0x17F 、GHP0xC00000、GHP0xC0007F、GHP0xC00080:全域主機頁編號的映射資訊
H2F:主機-快閃記憶體映射表
H2F_G0、H2F_G48、H2F_G#:映射子表
Info_Blk:系統資訊區塊
S1302…S1314、S1402…S1410、S1502…S1510、S1602…S1618:步驟
Spare_Area:閒置區域
TBM:修整位元總表
TBM_G0、TBM_G1、TBM_G2、TBM_G3、TBM_G127:修整位元子表
TIFM:修整資訊旗標表
Trim_Code:修整代碼
Trim_Tag:修整標籤200: Data storage device
202: flash memory
204: Controller
206: Dynamic Random Access Memory (DRAM)
208: Host
210: idle area of
第1圖圖解快閃記憶體中區塊Blk之結構; 第2圖圖解根據本案一種實施方式所實現的一資料儲存裝置200; 第3圖圖解修整之分類; 第4圖圖解首位少量修整(302),其中修整邏輯區塊位址LBA 5~LBA 7; 第5圖圖解首位中等長度修整(304) ,其中修整邏輯區塊位址LBA 8~LBA 4095; 第6A圖以及第6B圖圖解大量修整(306),其中修整邏輯區塊位址LBA 4096~LBA 100663295; 第7圖圖解末位中等長度修整(308); 第8圖圖解末位少量修整(310),其中修整邏輯區塊位址LBA 100664320~LBA 100664323; 第9圖整理LBA 5~LBA 100664323修整指令執行後,動態隨機存取記憶體206上存在內容; 第10A、10B以及10C圖圖解該修整位元總表TBM一位元之”1”至”0”翻轉; 第11圖圖解LBA 10240(5MB)起始的12KB寫入如何被回應; 第12A、12B、12C圖根據本案一種實施方式圖解表格重建機制; 第13圖根據本案一種實施方式圖解修整指令(trim command)處理方法; 第14圖為流程圖,根據本案一種實施方式圖解如何根據該修整位元總表TBM背景更新該主機-快閃記憶體映射表H2F; 第15圖為流程圖,根據本案一種實施方式圖解如何回應主機208發出的寫入指令;以及 第16圖為流程圖,根據本案一種實施方式圖解如何一復電程序。Figure 1 illustrates the structure of block Blk in flash memory; Figure 2 illustrates a data storage device 200 implemented according to an embodiment of the present case; Figure 3 illustrates the classification of trimmings; Figure 4 illustrates the first minor trimming (302), where the trimming logic block addresses are LBA 5~LBA 7; Figure 5 illustrates the first medium-length trimming (304), where the trimming logic block address is LBA 8~LBA 4095; Figures 6A and 6B illustrate a large number of trimming (306), where the trimming logic block addresses are LBA 4096~LBA 100663295; Figure 7 illustrates the last mid-length trimming (308); Figure 8 illustrates the last bit trimming (310), where the trimming logic block addresses are LBA 100664320~LBA 100664323; Figure 9 summarizes the contents of the dynamic random access memory 206 after the LBA 5~LBA 100664323 trimming instructions are executed; Figures 10A, 10B and 10C illustrate the "1" to "0" reversal of one bit of the trimming bit table TBM; Figure 11 illustrates how the initial 12KB write of LBA 10240 (5MB) is responded; Figures 12A, 12B, and 12C illustrate the table reconstruction mechanism according to an implementation of this case; Figure 13 illustrates a trim command processing method according to an embodiment of this case; Figure 14 is a flowchart showing how to update the host-flash memory mapping table H2F according to the background of the trimming bit summary table TBM according to an embodiment of this case; Figure 15 is a flowchart illustrating how to respond to the write command sent by the host 208 according to an embodiment of this case; and Figure 16 is a flowchart illustrating how to perform a power recovery procedure according to an embodiment of this case.
200:資料儲存裝置200: Data storage device
202:快閃記憶體202: flash memory
204:控制器204: Controller
206:動態隨機存取記憶體(DRAM)206: Dynamic Random Access Memory (DRAM)
208:主機208: Host
210:主動區塊A_Blk的閒置區域210: idle area of active block A_Blk
A_Blk:主動區塊A_Blk: active block
Data_Cache:快取區Data_Cache: Cache area
H2F:主機-快閃記憶體映射表H2F: host-flash memory mapping table
H2F_G#:映射子表H2F_G#: Mapping sub-table
Info_Blk:系統資訊區塊Info_Blk: system information block
TBM:修整位元總表TBM: Total table of trimming bits
TIFM:修整資訊旗標表TIFM: trimming information flag table
Trim_Code:修整代碼Trim_Code: trim code
Trim_Tag:修整標籤Trim_Tag: Trimming tag
Claims (16)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/025,004 US11748023B2 (en) | 2019-11-29 | 2020-09-18 | Data storage device and non-volatile memory control method |
CN202011173409.5A CN112885397B (en) | 2019-11-29 | 2020-10-28 | Data storage device and non-volatile memory control method |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US201962941936P | 2019-11-29 | 2019-11-29 | |
US62/941,936 | 2019-11-29 |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202121176A true TW202121176A (en) | 2021-06-01 |
TWI745987B TWI745987B (en) | 2021-11-11 |
Family
ID=77516515
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW109117978A TWI745986B (en) | 2019-11-29 | 2020-05-29 | Data storage device and non-volatile memory control method |
TW109117977A TWI742698B (en) | 2019-11-29 | 2020-05-29 | Data storage device and non-volatile memory control method |
TW109117980A TWI745987B (en) | 2019-11-29 | 2020-05-29 | Data storage device and non-volatile memory control method |
Family Applications Before (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW109117978A TWI745986B (en) | 2019-11-29 | 2020-05-29 | Data storage device and non-volatile memory control method |
TW109117977A TWI742698B (en) | 2019-11-29 | 2020-05-29 | Data storage device and non-volatile memory control method |
Country Status (1)
Country | Link |
---|---|
TW (3) | TWI745986B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11669270B1 (en) | 2021-12-23 | 2023-06-06 | Hefei Core Storage Electronic Limited | Multi-channel memory storage device, memory control circuit unit and data reading method |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI423026B (en) * | 2010-10-29 | 2014-01-11 | Phison Electronics Corp | Data writing method, memory controller and memory storage apparatus |
US9274937B2 (en) * | 2011-12-22 | 2016-03-01 | Longitude Enterprise Flash S.A.R.L. | Systems, methods, and interfaces for vector input/output operations |
US8949512B2 (en) * | 2012-02-17 | 2015-02-03 | Apple Inc. | Trim token journaling |
US10430328B2 (en) * | 2014-09-16 | 2019-10-01 | Sandisk Technologies Llc | Non-volatile cache and non-volatile storage medium using single bit and multi bit flash memory cells or different programming parameters |
US10452532B2 (en) * | 2017-01-12 | 2019-10-22 | Micron Technology, Inc. | Directed sanitization of memory |
CN108733577B (en) * | 2017-04-21 | 2021-10-22 | 群联电子股份有限公司 | Memory management method, memory control circuit unit and memory storage device |
TWI634424B (en) * | 2017-05-08 | 2018-09-01 | 慧榮科技股份有限公司 | Data storage device and operating method therefor |
TWI639918B (en) * | 2017-05-11 | 2018-11-01 | 慧榮科技股份有限公司 | Data storage device and operating method therefor |
TWI672590B (en) * | 2017-06-27 | 2019-09-21 | 慧榮科技股份有限公司 | Data storage device |
-
2020
- 2020-05-29 TW TW109117978A patent/TWI745986B/en active
- 2020-05-29 TW TW109117977A patent/TWI742698B/en active
- 2020-05-29 TW TW109117980A patent/TWI745987B/en active
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11669270B1 (en) | 2021-12-23 | 2023-06-06 | Hefei Core Storage Electronic Limited | Multi-channel memory storage device, memory control circuit unit and data reading method |
TWI825551B (en) * | 2021-12-23 | 2023-12-11 | 大陸商合肥兆芯電子有限公司 | Multi-channel memory storage device, memory control circuit unit and data reading method |
Also Published As
Publication number | Publication date |
---|---|
TWI745986B (en) | 2021-11-11 |
TW202121413A (en) | 2021-06-01 |
TWI742698B (en) | 2021-10-11 |
TW202121425A (en) | 2021-06-01 |
TWI745987B (en) | 2021-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112882650B (en) | Data storage device and non-volatile memory control method | |
US9792067B2 (en) | Trim command processing in a solid state drive | |
KR101916206B1 (en) | Methods, devices and systems for two stage power-on map rebuild with free space accounting in a solid state drive | |
JP6210570B2 (en) | Method, apparatus and system for physical logical mapping in solid state drives | |
CN100487672C (en) | Method and apparatus for splitting a logical block | |
JP6192024B2 (en) | Method, data storage device and system for fragmented firmware table reconstructed in a solid state drive | |
US9213633B2 (en) | Flash translation layer with lower write amplification | |
KR101562781B1 (en) | Self-journaling and hierarchical consistency for non-volatile storage | |
US8291155B2 (en) | Data access method, memory controller and memory storage system | |
CN107784121B (en) | Lowercase optimization method of log file system based on nonvolatile memory | |
JP6076506B2 (en) | Storage device | |
CN112882649B (en) | Data storage device and non-volatile memory control method | |
DE102009026178A1 (en) | Multi-level-control multi-flash device, has smart storage transaction manager managing transactions from host, and set of non-volatile memory blocks storing host data at block location identified by physical block address | |
US11520696B2 (en) | Segregating map data among different die sets in a non-volatile memory | |
KR20070024504A (en) | Storage device, memory management method and program | |
KR20060046181A (en) | Memory card, semiconductor device, and method of controlling semiconductor memory | |
US20170357462A1 (en) | Method and apparatus for improving performance of sequential logging in a storage device | |
JP4460967B2 (en) | MEMORY CARD, NONVOLATILE SEMICONDUCTOR MEMORY, AND SEMICONDUCTOR MEMORY CONTROL METHOD | |
CN111104345A (en) | SSD power-on recovery method, system and host | |
TWI745987B (en) | Data storage device and non-volatile memory control method | |
CN111610929A (en) | Data storage device and non-volatile memory control method | |
CN112885397B (en) | Data storage device and non-volatile memory control method | |
TWI724550B (en) | Data storage device and non-volatile memory control method | |
CN117369715A (en) | System, method and apparatus for updating usage reclamation units based on references in storage devices |