TWI740446B - Computer program product and method and apparatus for managing garbage collection (gc) processes - Google Patents
Computer program product and method and apparatus for managing garbage collection (gc) processes Download PDFInfo
- Publication number
- TWI740446B TWI740446B TW109111695A TW109111695A TWI740446B TW I740446 B TWI740446 B TW I740446B TW 109111695 A TW109111695 A TW 109111695A TW 109111695 A TW109111695 A TW 109111695A TW I740446 B TWI740446 B TW I740446B
- Authority
- TW
- Taiwan
- Prior art keywords
- pages
- block
- type
- physical block
- flash memory
- Prior art date
Links
Images
Landscapes
- Memory System (AREA)
Abstract
Description
本發明涉及儲存裝置,尤指一種管理垃圾回收程序的電腦程式產品及方法及裝置。 The invention relates to a storage device, in particular to a computer program product, method and device for managing garbage collection procedures.
閃存通常分為NOR閃存與NAND閃存。NOR閃存為隨機存取裝置,中央處理器(Host)可於位址腳位上提供任何存取NOR閃存的位址,並及時地從NOR閃存的資料腳位上獲得儲存於該位址上的資料。相反地,NAND閃存並非隨機存取,而是序列存取。NAND閃存無法像NOR閃存一樣,可以存取任何隨機位址,中央處理器反而需要寫入序列的位元組(Bytes)的值到NAND閃存中,用於定義請求命令(Command)的類型(如,讀取、寫入、抹除等),以及用在此命令上的位址。位址可指向一個頁面(閃存中寫入作業的最小資料塊)或一個區塊(閃存中抹除作業的最小資料塊)。 Flash memory is generally divided into NOR flash memory and NAND flash memory. NOR flash memory is a random access device. The central processing unit (Host) can provide any address to access the NOR flash memory on the address pin, and obtain the data stored at that address from the data pin of the NOR flash memory in time material. On the contrary, NAND flash memory is not random access, but serial access. NAND flash memory cannot access any random address like NOR flash memory. Instead, the central processing unit needs to write the value of the sequence of bytes (Bytes) into the NAND flash memory to define the type of request command (Command) (such as , Read, write, erase, etc.), and the address used in this command. The address can point to a page (the smallest data block for a write operation in the flash memory) or a block (the smallest data block for an erase operation in the flash memory).
經過多次的存取後,一個實體塊可能包含有效及無效頁面(又稱為過期頁面),其中,有效頁面儲存有效的使用者資料,無效頁面儲存無效的(舊的)使用者資料。當閃存控制器偵測到儲存裝置的可用空間低於閥值時,可發出讀取命令指示儲存裝置讀取並蒐集數個實體塊中有效頁面的使用者資料,接著,發出寫入命令指示儲存裝置重新寫入蒐集起來的有效使用者資料至閒置區塊或主動區塊的空實體頁面,使得這些包含無效的使用者資料的資料塊可變更成為閒置區塊,於抹除後,即可提供資料儲存空間。如上所述的程序稱為 垃圾回收(Garbage Collection,GC)。然而,垃圾回收程序若設計不良會影響儲存裝置的整體效能。因此,本發明提出一種管理垃圾回收程序的電腦程式產品及方法及裝置,用於優化垃圾回收程序的執行時間。 After multiple accesses, a physical block may contain valid and invalid pages (also called expired pages), where valid pages store valid user data, and invalid pages store invalid (old) user data. When the flash memory controller detects that the available space of the storage device is lower than the threshold, it can issue a read command to instruct the storage device to read and collect user data of valid pages in several physical blocks, and then issue a write command to instruct storage The device rewrites the collected valid user data to the empty physical page of the idle block or the active block, so that these data blocks containing invalid user data can be changed to idle blocks, which can be provided after erasing Data storage space. The procedure described above is called Garbage Collection (Garbage Collection, GC). However, poorly designed garbage collection procedures will affect the overall performance of the storage device. Therefore, the present invention provides a computer program product, method, and device for managing garbage collection procedures, which are used to optimize the execution time of garbage collection procedures.
有鑑於此,如何減輕或消除上述相關領域的缺失,實為有待解決的問題。 In view of this, how to reduce or eliminate the deficiencies in the above-mentioned related fields is indeed a problem to be solved.
本說明書涉及一種電腦程式產品,用於管理垃圾回收程序,包含由閃存控制器的處理單元載入並執行的程式碼:決定待處理的多個來源塊;將來源塊中小於第一類型實體塊的空頁面總數的有效頁面的使用者資料寫入第二類型實體塊中的空頁面;以及將第二類型實體塊中剩餘的空頁面填滿虛假值。 This manual relates to a computer program product used to manage garbage collection procedures, including program code loaded and executed by the processing unit of the flash memory controller: determine multiple source blocks to be processed; reduce the source blocks to be smaller than the first type of physical block The user data of the valid pages of the total number of empty pages is written into the empty pages in the second type of physical block; and the remaining empty pages in the second type of physical block are filled with false values.
本說明書另涉及一種垃圾回收程序管理方法,由閃存控制器執行,包含:決定待處理的多個來源塊;將來源塊中小於第一類型實體塊的空頁面總數的有效頁面的使用者資料寫入第二類型實體塊中的空頁面;以及將第二類型實體塊中剩餘的空頁面填滿虛假值。 This manual also relates to a garbage collection program management method, executed by the flash memory controller, including: determining multiple source blocks to be processed; writing user data of valid pages in the source blocks that are less than the total number of empty pages of the first type of physical block Inserting empty pages in the second type of physical block; and filling the remaining empty pages in the second type of physical block with false values.
本說明書更另涉及一種垃圾回收程序管理裝置,包含:閃存介面;和處理單元。閃存介面耦接閃存模組,並處理單元耦接閃存介面。處理單元決定閃存模組中待處理的多個來源塊;驅動閃存介面將來源塊中小於第一類型實體塊的空頁面總數的有效頁面的使用者資料寫入第二類型實體塊中的空頁面;以及驅動閃存介面將第二類型實體塊中剩餘的空頁面填滿虛假值。 This specification also relates to a garbage collection program management device, including: a flash memory interface; and a processing unit. The flash memory interface is coupled to the flash memory module, and the processing unit is coupled to the flash memory interface. The processing unit determines multiple source blocks to be processed in the flash memory module; the drive flash interface writes user data of valid pages in the source block that is less than the total number of empty pages in the first type of physical block into the empty pages in the second type of physical block ; And drive the flash memory interface to fill the remaining empty pages in the second type of physical block with false values.
每個來源塊包含至少一個無效頁面,第一類型實體塊的空頁面總數大於第二類型實體塊的空頁面總數。 Each source block contains at least one invalid page, and the total number of empty pages of the first type of physical block is greater than the total number of empty pages of the second type of physical block.
上述實施例的優點之一,通過如上所述的寫入操作,可減少關閉實體塊所需使用的資源和時間,提升執行垃圾回收程序的效率。 One of the advantages of the above-mentioned embodiment is that through the above-mentioned write operation, the resources and time required to close the physical block can be reduced, and the efficiency of executing the garbage collection procedure can be improved.
本發明的其他優點將搭配以下的說明和圖式進行更詳細的解說。 Other advantages of the present invention will be explained in more detail with the following description and drawings.
10:電子裝置 10: Electronic device
110:主機端 110: host side
130:閃存控制器 130: flash memory controller
131:主機介面 131: Host Interface
132:匯流排 132: Bus
134:處理單元 134: Processing Unit
136:隨機存取記憶體 136: Random Access Memory
138:直接記憶體存取控制器 138: Direct Memory Access Controller
139:閃存介面 139: Flash interface
150:閃存模組 150: Flash memory module
151:介面 151: Interface
153#0~153#15:NAND閃存單元 153#0~153#15: NAND flash memory unit
CH#0~CH#3:通道
CE#0~CE#3:致能訊號
310、330:資料平面 310, 330: data plane
310#0~310#m,330#0~330#m:實體塊 310#0~310#m,330#0~330#m: physical block
P#0~P#n:實體頁面
410#0~410#5:SLC塊 410#0~410#5: SLC block
430:TLC塊 430: TLC block
S510~S560:方法步驟 S510~S560: Method steps
610:SLC塊 610: SLC block
710#0~710#5:SLC塊 710#0~710#5: SLC block
730:TLC塊 730: TLC block
750:SLC塊 750: SLC block
圖1為依據本發明實施例的電子裝置的系統架構圖。 FIG. 1 is a system architecture diagram of an electronic device according to an embodiment of the invention.
圖2為依據本發明實施例的閃存模組的示意圖。 FIG. 2 is a schematic diagram of a flash memory module according to an embodiment of the invention.
圖3為依據本發明實施例的NAND閃存單元的示意圖。 FIG. 3 is a schematic diagram of a NAND flash memory cell according to an embodiment of the invention.
圖4為依據一些實施方式的垃圾回收示意圖。 FIG. 4 is a schematic diagram of garbage collection according to some embodiments.
圖5為依據本發明實施例的垃圾回收程序的寫入方法的流程圖。 Fig. 5 is a flowchart of a method for writing a garbage collection program according to an embodiment of the present invention.
圖6和圖7為依據本發明實施例的垃圾回收示意圖。 6 and 7 are schematic diagrams of garbage collection according to an embodiment of the present invention.
以下說明為完成發明的較佳實現方式,其目的在於描述本發明的基本精神,但並不用以限定本發明。實際的發明內容必須參考之後的權利要求範圍。 The following descriptions are preferred implementations for completing the invention, and their purpose is to describe the basic spirit of the invention, but not to limit the invention. The actual content of the invention must refer to the scope of the claims that follow.
必須了解的是,使用於本說明書中的“包含”、“包括”等詞,用以表示存在特定的技術特徵、數值、方法步驟、作業處理、元件以及/或組件,但並不排除可加上更多的技術特徵、數值、方法步驟、作業處理、元件、組件,或以上的任意組合。 It must be understood that the words "including" and "including" used in this specification are used to indicate the existence of specific technical features, values, method steps, operations, elements, and/or components, but they do not exclude the possibility of adding More technical features, values, method steps, job processing, components, components, or any combination of the above.
於權利要求中使用如“第一”、“第二”、“第三”等詞是用來修飾權利要求中的元件,並非用來表示之間具有優先順序,前置關係,或者是一個元件先於另一個元件,或者是執行方法步驟時的時間先後順序,僅用來區別具有相同名字的元件。 Words such as "first", "second", and "third" in the claims are used to modify the elements in the claims, not to indicate that there is a priority, prerequisite relationship, or an element Prior to another element, or the chronological order of execution of method steps, is only used to distinguish elements with the same name.
必須了解的是,當元件描述為“連接”或“耦接”至另一元件時,可以是直接連結、或耦接至其他元件,可能出現中間元件。相反地,當元件描述為“直接連接”或“直接耦接”至另一元件時,其中不存在任何中間元件。使用來描述元件之間關係的其他語詞也可類似方式解讀,例如“介於”相對於“直接介於”,或者是“鄰接”相對於“直接鄰接”等等。 It must be understood that when an element is described as being “connected” or “coupled” to another element, it can be directly connected or coupled to other elements, and intervening elements may appear. Conversely, when an element is described as being "directly connected" or "directly coupled" to another element, there are no intervening elements. Other terms used to describe the relationship between elements can also be interpreted in a similar manner, such as "between" versus "directly between", or "adjacent" versus "directly adjacent" and so on.
參考圖1。電子裝置10包含主機端(Host Side)110、閃存控制器130及閃存模組150,並且閃存控制器130及閃存模組150可合稱為裝置
端(Device Side)。電子裝置10可實施於個人電腦、筆記型電腦(Laptop PC)、平板電腦、手機、數位相機、數位攝影機等電子產品之中。主機端110與閃存控制器130的主機介面(Host Interface)137可以通用序列匯流排(Universal Serial Bus,USB)、先進技術附著(advanced technology attachment,ATA)、序列先進技術附著(serial advanced technology attachment,SATA)、快速周邊元件互聯(peripheral component interconnect express,PCI-E)、通用快閃記憶儲存(Universal Flash Storage UFS)、嵌入式多媒體卡(Embedded Multi-Media Card eMMC)等通訊協定彼此溝通。閃存控制器130的閃存介面(Flash Interface)139與閃存模組150可以雙倍資料率(Double DataRate DDR)通訊協定彼此溝通,例如,開放NAND快閃介面(Open NAND Flash Interface ONFI)、雙倍資料率開關(DDR Toggle)或其他通訊協定。閃存控制器130包含處理單元134,可使用多種方式實施,如使用通用硬體(例如,單一處理器、具平行處理能力的多處理器、圖形處理器或其他具運算能力的處理器),並且在執行軟體以及/或韌體指令時,提供之後描述的功能。處理單元134通過主機介面131接收主機命令,例如讀取命令(Read Command)、寫入命令(Write Command)、抹除命令(Erase Command)等,排程並執行這些命令。閃存控制器130另包含隨機存取記憶體(Random Access Memory ,RAM)136,可實施為動態隨機存取記憶體(Dynamic Random Access Memory,DRAM)、靜態隨機存取記憶體(Static Random Access Memory,SRAM)或上述兩者的結合,用於配置空間作為資料緩衝區,儲存從主機端110讀取並即將寫入閃存模組150的使用者資料(也可稱為主機資料),以及從閃存模組150讀取並即將輸出給主機端110的使用者資料。隨機存取記憶體136另可儲存執行過程中需要的資料,例如,變數、資料表、主機-閃存對照表(Host-to-Flash,H2F
Table)、閃存-主機對照表(Flash-to-Host,F2H Table)等。閃存介面139包含NAND閃存控制器(NAND Flash Controller,NFC),提供存取閃存模組150時需要的功能,例如命令序列器(Command Sequencer)、低密度奇偶校驗(Low Density Parity Check,LDPC)等。
Refer to Figure 1. The
閃存控制器130中可配置匯流排架構(Bus Architecture)132,用於讓元件之間彼此耦接以傳遞資料、位址、控制訊號等,這些元件包含主機介面131、處理單元134、RAM 136、直接記憶體存取(Direct Memory Access,DMA)控制器138、閃存介面139等。於一些實施例中,主機介面131、處理單元134、RAM 136、DMA控制器138與閃存介面139可通過單一匯流排彼此耦接。於另一些實施例中,閃存控制器130中可配置高速匯流排,用於讓處理單元134、DMA控制器138與RAM 136彼此耦接,並且配置低速匯流排,用於讓處理單元134、DMA控制器138、主機介面131與閃存介面139彼此耦接。DMA控制器138可依據處理單元134的指令,通過匯流排架構132在元件間搬移資料,例如,將主機介面131或閃存介面139中特定資料緩存器(Data Buffer)的資料搬到RAM 136中的特定位址,將RAM 136中特定位址的資料搬到將主機介面131或閃存介面139中的特定資料緩存器等。
The
匯流排包含並行的物理線,連接閃存控制器130中兩個以上的組件。匯流排是一種共享的傳輸媒體,在任意的時間上,只能有兩個裝置可以使用這些線來彼此溝通,用於傳遞資料。資料及控制訊號能夠在組件間分別沿資料和控制線進行雙向傳播,但另一方面,位址訊號只能沿位址線進行單向傳播。例如,當處理單元134想要讀取RAM 136的特定位址上的資料時,處理單元134在位址線上傳送此位址給RAM 136。接著,此位址的資料會在資料線上回覆給處理單元134。為了完成資料讀取操作,控制訊號會使用控制線進行傳遞。
The bus bar includes parallel physical lines to connect more than two components in the
閃存模組150提供大量的儲存空間,通常是數百個千兆位元組(Gigabytes,GB),甚至是數個兆兆位元組(Terabytes,TB),用於儲存大量的使用者資料,例如高解析度圖片、影片等。閃存模組150中包含控制電路以及記憶體陣列,記憶體陣列中的記憶單元可包含單層式單元(Single Level Cells,SLCs)、多層式單元(Multiple Level Cells,MLCs)三層式單元(Triple Level Cells,TLCs)、四層式單元(Quad-Level Cells,QLCs)或上述的任意組合。處理單元134通過閃存介面139寫入使用者資料到閃存模組150中的指定位址(目的位址),以及從閃存模組150中的指定位址(來源位址)讀取使用者資料。閃存介面139使用數個電子訊號來協調閃存控制器130與閃存模組150間的資料與命令傳遞,包含資料線(Data Line)、時脈訊號(clock signal)與控制訊號(control signal)。資料線可用於傳遞命令、位址、讀出及寫入的資料;控制訊號線可用於傳遞晶片致能(Chip Enable CE)、位址提取致能(Address Latch Enable ALE)、命令提取致能(Command Latch Enable CLE)、寫入致能(Write Enable WE)等控制訊號。
The
當一個實體塊的每個記憶單元設置為單層式單元而可記錄二個狀態時,一個實體字元線只儲存單一頁面的使用者資料。當一個實體塊的每個記憶單元設置為多層式單元而可記錄四個狀態時,一個實體字元線可儲存二個頁面的使用者資料,包含最高有效位元頁面(Most Significant Bit,MSB Page)和最低有效位元頁面(Least Significant Bit page,LSB)。當一個實體塊的每個記憶單元設置為三層式單元而可記錄八個狀態時,一個實體字元線可儲存三個頁面的使用者資料,包含最高有效位元頁面、中間有效位元頁面(Center Significant Bit,CSB Page)和最低有效位元頁面。當一個實體塊的每個記憶單元設置為四層式單元而可記錄十六個狀態時,一個實體字元線可儲存除了最高有效位元頁面、中間有效位元頁面 和最低有效位元頁面的使用者資料之外,更包括儲存頂部有效位元頁面(Top Significant Bit,TSB Page)的使用者資料。以上所述包含SLC、MLC、TLC及QLC的記憶單元的實體塊可視為不同類型的實體塊。 When each memory cell of a physical block is set as a single-layer cell and can record two states, a physical character line only stores a single page of user data. When each memory unit of a physical block is set as a multi-layer unit and can record four states, one physical character line can store two pages of user data, including the Most Significant Bit (MSB Page) ) And the Least Significant Bit page (LSB). When each memory cell of a physical block is set as a three-layer cell and can record eight states, one physical character line can store three pages of user data, including the most significant bit page and the middle effective bit page (Center Significant Bit, CSB Page) and the least significant bit page. When each memory cell of a physical block is set as a four-layer cell and can record 16 states, one physical word line can store except for the most significant bit page and the middle effective bit page In addition to the user data on the least significant bit page, it also includes storing the user data on the top significant bit page (TSB Page). The above-mentioned physical blocks of memory cells including SLC, MLC, TLC, and QLC can be regarded as different types of physical blocks.
參考圖2,閃存模組150中的介面151可包含四個輸出入通道(I/O channels,以下簡稱通道)CH#0至CH#3,每一個通道連接四個NAND閃存單元,例如,通道CH#0連接NAND閃存單元153#0、153#4、153#8及153#12。每個NAND閃存單元可封裝為獨立的芯片(die)。閃存介面139可通過介面151發出致能訊號CE#0至CE#3中的一個來致能NAND閃存單元153#0至153#3、153#4至153#7、153#8至153#11、或153#12至153#15,接著以並行的方式從致能的NAND閃存單元讀取使用者資料,或者寫入使用者資料至致能的NAND閃存單元。
Referring to FIG. 2, the
每個NAND閃存單元可包含多個資料平面(Data Planes),每個資料平面可包含多個實體塊(Physical Blocks),並且每個實體塊可包含多個實體頁面(Physical Pages)。參考圖3的實施例,NAND閃存單元153#0包含兩個資料平面310及330。資料平面310包含實體塊310#0至310#m,且資料平面330包含實體塊330#0至330#m。每個實體塊包含n+1個實體頁面。NAND閃存單元、實體塊和實體頁面可分別使用邏輯單元號(Logical Block Number,LUN)、塊編號(Block Number)和頁面編號(Page Number)識別,而以上編號的任意組合可稱為閃存模組150的實體位址。每個資料平面中的任一個實體塊可設置為SLC、MLC、TLC或QLC塊。
Each NAND flash memory cell may include multiple data planes, each data plane may include multiple physical blocks (Physical Blocks), and each physical block may include multiple physical pages (Physical Pages). Referring to the embodiment of FIG. 3, the NAND
當閃存模組150的可用儲存空間少於閥值時,例如1/2的實體塊、1/3的實體塊,閃存控制器130啟動垃圾回收(Garbage Collection,GC)程序,用於釋放出無效頁面的儲存空間。在這裡需要注意的是,GC程序是一種閃存控制器130主動發動的程序,而不是受到主機端
110的指揮來發動。在一些實施方式中,處理單元134可蒐集多個SLC塊(可稱為來源塊)的有效頁面的使用者資料,然後將搜集完成的使用者資料寫入TLC塊(可稱為目的塊)的空頁面。來源塊被處理單元134抹除後,即可提供儲存空間給未來接收到的使用者資料。然而,當來源塊的有效頁面的數目少於一個TLC塊的頁面總數時,剩餘未寫入使用者資料的空頁面需要填滿虛假值來關閉實體塊(Close Block)。參考圖4,處理單元134搜集SLC塊410#0至410#5中有效頁面的使用者資料(以斜線的方塊表示),並且將蒐集到的使用者資料寫入TLC塊430中的空頁面(以斜線的方塊表示)。接著,處理單元134將剩餘的空頁面填滿虛假值(Dummy Values)。雖然虛假值是沒有用的,但填滿虛假值也是一種寫入操作,閃存模組150同樣需要花費相同於寫入使用者資料的時間來完成操作。
When the available storage space of the
為了解決如上所述實施方式的問題,本發明實施例提出一種GC程序的管理方法,由處理單元134載入和執行相關韌體或軟體指令時實施。參考圖5,詳細步驟說明如下:
In order to solve the problems of the above-mentioned embodiments, an embodiment of the present invention proposes a GC program management method, which is implemented when the
步驟S510:決定閃存模組150中待處理的來源塊。處理單元134可選擇多個包含無效頁面的實體塊,當作來源塊。來源塊可以是SLC、MLC、TLC、QLC塊,或者以上的任意組合。
Step S510: Determine the source block to be processed in the
步驟S520:計算來源塊中的有效頁面數目。 Step S520: Calculate the number of valid pages in the source block.
步驟S530:判斷有效頁面數目是否等於或大於一個TLC塊的頁面總數。如果是,流程進行步驟S540的處理;否則,流程進行步驟S550的處理。 Step S530: Determine whether the number of valid pages is equal to or greater than the total number of pages in one TLC block. If so, the flow proceeds to the processing of step S540; otherwise, the flow proceeds to the processing of step S550.
步驟S540:將來源塊中ixN個有效頁面的使用者資料寫入閃存模組150中至少一個TLC塊(也稱為目的塊),ixN<M,i代表大於零的正整數,M代表有效頁面數目,N代表一個TLC塊的頁面總數。處理單元134驅動閃存介面139來完成多個來源塊中ixN個有效頁面的讀取操作,以及TLC塊的寫入操作。
Step S540: Write user data of ixN valid pages in the source block into at least one TLC block (also called destination block) in the
步驟S550:將來源塊中剩餘有效頁面(其數目不足一個TLC塊的頁面總數)的使用者資料寫入閃存模組150中至少一個SLC塊(也稱為目的塊)的空頁面。於此需注意的是,來源塊中剩餘有效頁面的數目可能超過一個SLC塊的頁面總數。處理單元134驅動閃存介面139來完成一個或多個來源塊中剩餘有效頁面的讀取操作,以及一個或多個SLC塊的寫入操作。
Step S550: Write the user data of the remaining valid pages in the source block (the number of which is less than the total number of pages of one TLC block) into the empty page of at least one SLC block (also referred to as the destination block) in the
步驟S560:將閃存模組150中SLC塊(目的塊)中剩餘的空頁面填滿虛假值。在這裏需要注意的是,由於TLC塊的寫入操作使用粗略到精細(Foggy-to-Fine,F2F)的技術,其寫入資料的步驟複雜度相較於寫入SLC塊為高,並且其所需要的時間通常也較長。此外,由於TLC塊的空頁面總數相較於SLC塊的空頁面總數為多,大約是SLC塊的空頁面的三倍,TLC塊的剩餘空頁面總數通常會比SLC塊的剩餘空頁面總數多。
Step S560: Fill the remaining empty pages in the SLC block (destination block) in the
對比於圖4所示的使用案例,參考圖6。通過如上所述的方法,由於處理單元134將蒐集到的SLC塊410#0至410#5中有效頁面的使用者資料(以斜線的方塊表示)寫入SLC塊610中的空頁面(以斜線的方塊表示),因此,需要填寫的虛假值較少。
In contrast to the use case shown in Figure 4, refer to Figure 6. Through the method described above, the
此外,參考圖7所示的另一個使用案例。處理單元134搜集SLC塊710#0至710#5中有效頁面的使用者資料(以斜線的方塊表示),將蒐集到的使用者資料寫入TLC塊730中的所有頁面(以斜線的方塊表示),並且將剩餘的使用者資料寫入SLC塊750中的頁面(以斜線的方塊表示)。接著,處理單元134將SLC塊750中的剩餘空頁面填滿虛假值。
In addition, refer to another use case shown in Figure 7. The
雖然圖6和圖7顯示的每個實體塊中的有效頁面和無效頁面分別是兩塊連續的區域,但這只是方便說明的簡化表達。實際上,每個實體塊中的有效頁面和無效頁面經常是互相交錯,本發明並不因此受限。例如,一個實體塊的有效頁面為頁面P#0~5、P#10~15、P#20~25
和P#30~35。
Although the effective page and the invalid page in each physical block shown in FIG. 6 and FIG. 7 are two continuous areas respectively, this is only a simplified expression for convenience of description. In fact, valid pages and invalid pages in each physical block are often interleaved with each other, and the present invention is not limited thereby. For example, the effective pages of a physical block are
如上所述本發明實施例的GC程序管理方法可經過適當修改後應用到QLC塊的情境。步驟S530可修改為判斷有效頁面數目是否等於或大於一個QLC塊的頁面總數。步驟S540可修改為將閃存模組150的來源塊中ixN個有效頁面的使用者資料寫入閃存模組150中至少一個QLC塊(也稱為目的塊)的空頁面,ixN<M,i代表大於零的正整數,M代表有效頁面數目,N代表一個QLC塊的頁面總數。步驟S550可修改為將來源塊中剩餘有效頁面(其數目不足一個QLC塊的頁面總數)的使用者資料寫入閃存模組150中至少一個SLC塊(也稱為目的塊)的空頁面。
As described above, the GC program management method of the embodiment of the present invention can be appropriately modified and applied to the context of the QLC block. Step S530 can be modified to determine whether the number of valid pages is equal to or greater than the total number of pages in one QLC block. Step S540 can be modified to write user data of ixN valid pages in the source block of the
於本發明的一個面向,處理單元134決定待處理的多個來源塊,其中,每個來源塊包含至少一個無效頁面;將來源塊中不足(或小於)一個第一類型實體塊的頁面總數的有效頁面的使用者資料寫入第二類型實體塊中的空頁面,其中,一個第一類型實體塊的頁面總數高於一個第二類型實體塊的頁面總數;以及將第二類型實體塊中剩餘的空頁面填滿虛假值,用於避免花費太多時間和資源來填寫虛假值。舉例來說,一個第一類型實體塊(如TLC或QLC塊)的頁面總數至少兩倍於一個第二類型實體塊(如SLC塊)的頁面總數。一個第一類型實體塊的頁面總數和一個第二類型實體塊的頁面總數分別指在一個第一類型實體塊和一個第二類型實體塊中用來儲存使用者資料的最大空頁面總數。
In one aspect of the present invention, the
所以,相較於以前的實施方式,通過步驟S530的判斷和步驟S560的寫入操作,可減少關閉實體塊所需使用的資源和時間,提升執行垃圾回收程序的效率。 Therefore, compared with the previous embodiment, the judgment in step S530 and the writing operation in step S560 can reduce the resources and time required to close the physical block, and improve the efficiency of the garbage collection procedure.
本發明所述的方法中的全部或部分步驟可以計算機指令實現,例如儲存裝置中的韌體轉換層(Firmware Translation Layer,FTL)、特定硬體的驅動程式等。此外,也可實現於其他類型程式。所屬技術 領域具有通常知識者可將本發明實施例的方法撰寫成計算機指令,為求簡潔不再加以描述。依據本發明實施例方法實施的計算機指令可儲存於適當的電腦可讀取媒體,例如DVD、CD-ROM、USB碟、硬碟,亦可置於可通過網路(例如,網際網路,或其他適當載具)存取的網路伺服器。 All or part of the steps in the method of the present invention can be implemented by computer instructions, such as a firmware translation layer (FTL) in a storage device, a driver of a specific hardware, and the like. In addition, it can also be implemented in other types of programs. Technology Those with ordinary knowledge in the field can write the methods of the embodiments of the present invention into computer instructions, which will not be described for brevity. The computer instructions implemented according to the method of the embodiment of the present invention can be stored in an appropriate computer readable medium, such as DVD, CD-ROM, USB disk, hard disk, and can also be placed on a network (such as the Internet, or Other appropriate vehicles).
雖然圖1、2中包含了以上描述的元件,但不排除在不違反發明的精神下,使用更多其他的附加元件,已達成更佳的技術效果。此外,雖然圖5的流程圖採用指定的順序來執行,但是在不違反發明精神的情況下,熟習此技藝人士可以在達到相同效果的前提下,修改這些步驟間的順序,所以,本發明並不侷限於僅使用如上所述的順序。此外,熟習此技藝人士亦可以將若干步驟整合為一個步驟,或者是除了這些步驟外,循序或平行地執行更多步驟,本發明亦不因此而侷限。 Although FIGS. 1 and 2 include the above-described elements, it is not excluded that, without violating the spirit of the invention, more other additional elements can be used to achieve better technical effects. In addition, although the flowchart in FIG. 5 is executed in a specified order, those skilled in the art can modify the order of these steps on the premise of achieving the same effect without violating the spirit of the invention. Therefore, the present invention does not It is not limited to using only the sequence described above. In addition, those skilled in the art can also integrate several steps into one step, or in addition to these steps, perform more steps sequentially or in parallel, and the present invention is not limited thereby.
雖然本發明使用以上實施例進行說明,但需要注意的是,這些描述並非用以限縮本發明。相反地,此發明涵蓋了熟習此技藝人士顯而易見的修改與相似設置。所以,申請權利要求範圍須以最寬廣的方式解釋來包含所有顯而易見的修改與相似設置。 Although the present invention is described using the above embodiments, it should be noted that these descriptions are not intended to limit the present invention. On the contrary, this invention covers modifications and similar arrangements that are obvious to those skilled in the art. Therefore, the scope of applied claims must be interpreted in the broadest way to include all obvious modifications and similar settings.
S510~S560:方法步驟 S510~S560: Method steps
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109111695A TWI740446B (en) | 2020-04-08 | 2020-04-08 | Computer program product and method and apparatus for managing garbage collection (gc) processes |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109111695A TWI740446B (en) | 2020-04-08 | 2020-04-08 | Computer program product and method and apparatus for managing garbage collection (gc) processes |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI740446B true TWI740446B (en) | 2021-09-21 |
TW202139013A TW202139013A (en) | 2021-10-16 |
Family
ID=78778218
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW109111695A TWI740446B (en) | 2020-04-08 | 2020-04-08 | Computer program product and method and apparatus for managing garbage collection (gc) processes |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI740446B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4280055B2 (en) * | 2001-11-28 | 2009-06-17 | 株式会社Access | Memory control method and apparatus |
US8521949B2 (en) * | 2011-09-06 | 2013-08-27 | Huawei Technologies Co., Ltd. | Data deleting method and apparatus |
US20140244912A1 (en) * | 2013-02-28 | 2014-08-28 | Technion Research And Development Foundation Ltd. | Retired Page Utilization (RPU) for Improved Write Capacity of Solid State Drives |
US9343153B2 (en) * | 2010-10-26 | 2016-05-17 | Hitachi, Ltd. | De-duplication in flash memory module |
TWI653538B (en) * | 2017-11-13 | 2019-03-11 | 慧榮科技股份有限公司 | Data storage device and data processing method of memory device |
-
2020
- 2020-04-08 TW TW109111695A patent/TWI740446B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4280055B2 (en) * | 2001-11-28 | 2009-06-17 | 株式会社Access | Memory control method and apparatus |
US9343153B2 (en) * | 2010-10-26 | 2016-05-17 | Hitachi, Ltd. | De-duplication in flash memory module |
US8521949B2 (en) * | 2011-09-06 | 2013-08-27 | Huawei Technologies Co., Ltd. | Data deleting method and apparatus |
US20140244912A1 (en) * | 2013-02-28 | 2014-08-28 | Technion Research And Development Foundation Ltd. | Retired Page Utilization (RPU) for Improved Write Capacity of Solid State Drives |
TWI653538B (en) * | 2017-11-13 | 2019-03-11 | 慧榮科技股份有限公司 | Data storage device and data processing method of memory device |
Also Published As
Publication number | Publication date |
---|---|
TW202139013A (en) | 2021-10-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102691851B1 (en) | Nonvolatile memory device, data storage apparatus including the same and operating method thereof | |
TWI719654B (en) | Apparatus and method and computer program product for handling flash physical-resource sets | |
TWI569139B (en) | Valid data merging method, memory controller and memory storage apparatus | |
KR20170053278A (en) | Data storage device and operating method thereof | |
KR102595233B1 (en) | Data processing system and operating method thereof | |
TWI489272B (en) | Data protecting method, and memory controller and memory storage device using the same | |
TWI737031B (en) | Method and computer program product for reading data fragments of a page on multiple planes | |
TWI454922B (en) | Memory storage device and memory controller and data writing method thereof | |
KR20200114212A (en) | Data storage device and operating method thereof | |
KR20210147696A (en) | Data storage device and operating method thereof | |
CN113448487B (en) | Computer readable storage medium, method and apparatus for writing flash memory management table | |
KR102434840B1 (en) | Data storage device | |
KR20200114086A (en) | Controller, memory system and operating method thereof | |
CN113495850B (en) | Method, apparatus and computer readable storage medium for managing garbage collection program | |
KR102634776B1 (en) | Data storage device and operating method thereof | |
KR102425470B1 (en) | Data storage device and operating method thereof | |
TWI740446B (en) | Computer program product and method and apparatus for managing garbage collection (gc) processes | |
TWI749490B (en) | Computer program product and method and apparatus for programming flash administration tables | |
TWI754396B (en) | Method and apparatus and computer program product for storing data in flash memory | |
US11157401B2 (en) | Data storage device and operating method thereof performing a block scan operation for checking for valid page counts | |
TWI835027B (en) | Method and computer program product and apparatus for updating host-to-flash address mapping table | |
CN114625307A (en) | Computer readable storage medium, and data reading method and device of flash memory chip | |
TWI810876B (en) | Method and computer program product and apparatus for data access in response to host discard commands | |
TWI758745B (en) | Computer program product and method and apparatus for scheduling executions of host commands | |
TWI822516B (en) | Method and computer program product and apparatus for executing host write commands |