TWI773371B - Solid state drive - Google Patents
Solid state drive Download PDFInfo
- Publication number
- TWI773371B TWI773371B TW110120935A TW110120935A TWI773371B TW I773371 B TWI773371 B TW I773371B TW 110120935 A TW110120935 A TW 110120935A TW 110120935 A TW110120935 A TW 110120935A TW I773371 B TWI773371 B TW I773371B
- Authority
- TW
- Taiwan
- Prior art keywords
- volatile memory
- solid
- disk
- logical
- controller
- Prior art date
Links
Images
Landscapes
- Signal Processing For Digital Recording And Reproducing (AREA)
- Valve-Gear Or Valve Arrangements (AREA)
- Lubrication Of Internal Combustion Engines (AREA)
- Control Of Stepping Motors (AREA)
Abstract
Description
本發明係有關於一種固態硬碟,尤其是有關於一種可主動地進行修剪(TRIM)操作的固態硬碟。The present invention relates to a solid state hard disk, in particular, to a solid state hard disk that can actively perform trimming (TRIM) operations.
近年來固態硬碟(Solid State Drive;SSD)已經逐漸取代傳統的硬碟,因此各種作業系統為了提升固態硬碟的效能,而提出各種專屬固態硬碟的指令,而其中TRIM指令就是這些指令當中對於固態硬碟的效能及穩定度有很大幫助的指令。In recent years, Solid State Drive (SSD) has gradually replaced traditional hard drives. Therefore, in order to improve the performance of solid-state drives, various operating systems have proposed various commands for solid-state drives, among which the TRIM command is one of these commands. Instructions that are very helpful for the performance and stability of solid-state drives.
TRIM指令主要是由作業系統發起,讓作業系統通知固態硬碟哪些LBA位置上的資料已經是無效的資料,以使固態硬碟先進行內部的垃圾回收(Garbage Collection ;簡稱GC)操作,釋放出記憶體區塊供以後使用。這樣的方式雖然可以有效地釋放記憶體區塊,但是早期的作業系統並不支援TRIM這個指令。對於使用不支援TRIM作業系統的使用者來說,其長期使用下來,固態硬碟的效能會因頻繁的垃圾回收(GC)操作,而導致使用體驗上會有頓挫感。另外,TRIM指令必須由作業系統下達給固態硬碟,而作業系統下達TRIM指令的時間點對於固態硬碟來說是否為最佳的時機點則是有待商榷。The TRIM command is mainly initiated by the operating system to let the operating system inform the solid-state drive which LBA data is invalid data, so that the solid-state hard drive will first perform an internal Garbage Collection (GC) operation to release the data. A block of memory for later use. Although this method can effectively release memory blocks, the early operating system does not support the TRIM command. For users who use an operating system that does not support TRIM, after long-term use, the performance of solid-state drives will be frustrated due to frequent garbage collection (GC) operations. In addition, the TRIM command must be issued by the operating system to the solid-state hard disk, and whether the time point at which the operating system issues the TRIM command is the best time point for the solid-state hard disk is debatable.
本發明一實施例提供一種固態硬碟(Solid State Drive;SSD),其包含電路板、非揮發性記憶體模組以及控制器。非揮發性記憶體模組設置於電路板上,並包含多個用以儲存資料的非揮發性記憶體區塊。作業系統安裝於由至少部分的非揮發性記憶體區塊所形成的一邏輯磁碟(logic disk)中。控制器設置於電路板上,且耦接於非揮發性記憶體模組,並用以執行韌體,以對非揮發性記憶體區塊進行主動式修剪操作。主動式修剪操作包含:依據固態硬碟的一邏輯實體對照表(Logical-to-Physical table;L2P table),取得固態硬碟的一磁碟分割表;依據邏輯實體對照表及磁碟分割表,從非揮發性記憶體區塊讀取作業系統的一檔案系統的資訊;依據檔案系統的資訊,判斷邏輯磁碟中的哪些非揮發性記憶體區塊可被回收使用;以及將被判斷為可被回收使用的非揮發性記憶體區塊回收使用。An embodiment of the present invention provides a solid state drive (Solid State Drive; SSD), which includes a circuit board, a non-volatile memory module, and a controller. The non-volatile memory module is arranged on the circuit board and includes a plurality of non-volatile memory blocks for storing data. The operating system is installed on a logic disk formed by at least a portion of the non-volatile memory blocks. The controller is disposed on the circuit board and coupled to the non-volatile memory module, and is used for executing firmware to perform active trimming operation on the non-volatile memory block. The active pruning operation includes: obtaining a disk partition table of the solid-state hard disk according to a logical-to-Physical table (L2P table) of the solid-state hard disk; according to the logical entity comparison table and the disk partition table, Read information of a file system of the operating system from the non-volatile memory block; according to the information of the file system, determine which non-volatile memory blocks in the logical disk can be recycled; Reclaimed non-volatile memory blocks are reclaimed for use.
第1圖是安裝有本發明一實施例之固態硬碟100的電腦系統1的功能方塊圖,第2圖繪示了第1圖中的非揮發性記憶體模組120所儲存的相關資料。固態硬碟100包含電路板110、非揮發性記憶體模組120以及控制器130。非揮發性記憶體模組120設置於電路板110上,並包含多個用以儲存資料的非揮發性記憶體區塊122。每一非揮發性記憶體區塊122可以是快閃記憶體。非揮發性記憶體模組120可被分割成一個或多個邏輯磁碟(logic disk),而每一邏輯磁碟可包含全部或部分的非揮發性記憶體區塊122。其中的一個邏輯磁碟之中安裝有一作業系統。控制器130設置於電路板110上,且耦接於非揮發性記憶體模組120,並用以執行韌體132以對非揮發性記憶體區塊122進行程式化、抹除、讀取、主動式修剪操作等相關的操作。FIG. 1 is a functional block diagram of a computer system 1 installed with a solid-state
固態硬碟100另包含一傳輸介面140,耦接於電腦系統1的處理器10。處理器10可執行儲存在非揮發性記憶體模組120中的作業系統的程式碼170,以控制電腦系統1的操作,並對固態硬碟100進行資料存取。在本發明一實施例中,當控制器130在超過一預定時間(例如:5分鐘或其他預設時間長度)沒有從傳輸介面140接收到處理器10的任何指令時,控制器130即可主動地執行主動式修剪操作,而無須等待處理器10所執行的作業系統下達修剪(TRIM)指令。The
第3圖是第1圖之固態硬碟執行主動式修剪操作300時的流程圖。主動式修剪操作300可包含下述步驟:FIG. 3 is a flow chart of the solid state drive of FIG. 1 when the
步驟S310:控制器130讀取邏輯磁碟的邏輯區塊位址(Logical Block Address;簡稱LBA)資訊;其中,所被讀取的邏輯磁碟安裝有處理器10所執行的作業系統的程式碼170,而控制器130在此步驟中可先讀取儲存在非揮發性記憶體模組120中邏輯實體對照表(Logical-to-Physical table;L2P table)152,並依據邏輯實體對照表152讀取固態硬碟100的磁碟分割表154,進而依據磁碟分割表154,得知邏輯磁碟的起始位置156,並得知作業系統是哪一種作業系統以及其檔案系統資訊160,而上述的磁碟分割表154例如是主開機記錄〈Master Boot Record;簡稱MBR〉或是GUID磁碟分割表(GUID Partition Table;簡稱GPT);Step S310 : the
步驟S320:控制器130判斷韌體132是否可辨識出檔案系統資訊160的格式,以執行主動式的修剪;若韌體132可辨識所述檔案系統資訊160的格式,則進行主動式的修剪,即執行步驟S340至S360;若韌體132無法辨識所述檔案系統資訊160的格式,則執行步驟S330;Step S320: The
進一步的說明,在步驟S320中,韌體132預設會被設定成可辨識出常用或特定檔案系統資訊的格式,例如NTFS、FAT 32等,當此檔案系統資訊160的格式為NTFS或FAT 32其中之一時,則將會執行步驟S340,反之,若是此檔案系統資訊160的格式不在韌體132所預設的涵蓋內容時,以FAT 16為例,則此時將會執行步驟S330。Further description, in step S320, the
步驟S330:進行被動式修剪操作;即以傳統的方式由作業系統對固態硬碟100下達修剪(TRIM)指令,以對固態硬碟100進行修剪操作;其中,若作業系統並不支援TRIM指令,則此步驟S330可省略;Step S330 : perform a passive trimming operation; that is, the operating system issues a trimming (TRIM) command to the solid-state
步驟S340:控制器130分析邏輯磁區的系統架構;在此步驟中,控制器130可取得作業系統的檔案系統資訊160,亦即控制器130可得知作業系統是使用哪一種檔案系統(File system)來管理上述的邏輯磁碟;Step S340 : the
步驟S350:控制器130取得邏輯磁碟的非揮發性記憶體區塊122的空間分佈;以所安裝的作業系統為Windows 7為例,控制器130在此步驟中可取得作業系統的主要檔案表(Master File Table;MFT)162及點陣圖(Bitmap)164;其中點陣圖164用以記錄邏輯磁碟的各個非揮發性記憶體區塊122的被使用情況,而控制器130可依據點陣圖164得知邏輯磁碟中的哪些非揮發性記憶體區塊122可被回收使用;以及Step S350: The
步驟S360:控制器130將被判斷為可被回收使用的非揮發性記憶體區塊122回收使用。Step S360: The
在步驟S350中,當邏輯磁碟的某非揮發性記憶體區塊122所對應的點陣圖164中的位元的值為第一位元值(例如:0)時,控制器130則判斷此非揮發性記憶體區塊122為可被回收使用的非揮發性記憶體區塊122,並將非揮發性記憶體區塊122回收使用;當邏輯磁碟的某非揮發性記憶體區塊122所對應的點陣圖164中的位元的值為第二位元值(例如:1)時,控制器130則判斷此非揮發性記憶體區塊122為不可被回收使用的非揮發性記憶體區塊122。此外,當控制器130將被判斷為可被回收使用的非揮發性記憶體區塊122回收使用時,控制器130可以對可被回收使用的非揮發性記憶體區塊122進行資料抹除。In step S350, when the bit value in the
第4圖是當作業系統為WINDOWS 7且檔案系統為NTFS時,本發明之主動式修剪操作400的流程圖。主動式修剪操作400包含下列步驟:FIG. 4 is a flowchart of the
步驟S410:控制器130依據固態硬碟100的邏輯實體對照表(L2P table)152讀取固態硬碟100的磁碟分割表154,而磁碟分割表154一般儲存在邏輯磁碟的第一個非揮發性記憶體區塊122(即LBA 0);Step S410 : the
步驟S420:控制器130依據磁碟分割表154,得知邏輯磁碟的起始位置156(即開機(Boot)磁區的位置);Step S420: The
步驟S430:控制器130依據邏輯磁碟的起始位置156,得知作業系統的主要檔案表(MFT)162的位址;Step S430 : the
步驟S440:控制器130依據主要檔案表(MFT)162的位址,取得點陣圖(Bitmap)164,以依據點陣圖164判斷邏輯磁碟中的哪些非揮發性記憶體區塊122可被回收使用;以及Step S440 : The
步驟S450:控制器130將被判斷為可被回收使用的非揮發性記憶體區塊122回收使用。Step S450: The
對於檔案系統為FAT的邏輯磁區來說,步驟S440中所取得的點陣圖164可被FAT檔案系統的檔案配置表(FATTable1)所取代;對於檔案系統為EXT的邏輯磁區來說,步驟S440中所取得的點陣圖164可被EXT檔案系統的區塊圖(blockmap)所取代;對於檔案系統為HFS+的邏輯磁區來說,步驟S440中所取得的點陣圖164可被HFS+檔案系統的配置檔案(Allocation File)所取代。For the logical sector whose file system is FAT, the
上述主動式修剪操作300和400的觸發時機可以是當控制器130在超過一預定時間(例如:5分鐘或其他預設時間長度)沒有從傳輸介面140接收到處理器10的任何指令時,由控制器130主動地執行。然而,本發明並不以此為限,例如在本發明另一實施例中,則允許使用者透過電腦系統1所執行的程式,主動地命令固態硬碟100的控制器130執行上述主動式修剪操作300或400。The triggering timing of the above-mentioned
在上述實施例中,固態硬碟100可透過控制器130所執行的韌體132,對非揮發性記憶體模組120進行分析,而得知各非揮發性記憶體區塊122的被使用狀況,進而可對非揮發性記憶體區塊122進行主動式修剪操作,而無須等待作業系統對固態硬碟100下達TRIM指令。再者,對於不支援TRIM指令的作業系統(如WINDOWS 95),透過本發明,在韌體132有支援該作業系統的檔案系統的情況下,仍可享有TRIM指令所帶來的好處。另外,對於有支援TRIM指令的作業系統來說,控制器130可在固態硬碟100閒置一預設時間後主動進行上述的主動式修剪操作,而提升垃圾回收(GC)操作的效率。
以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。
In the above-mentioned embodiment, the
1:電腦系統
10:處理器
100:固態硬碟
110:電路板
120:非揮發性記憶體模組
122:非揮發性記憶體區塊
130:控制器
132:韌體
140:傳輸介面
152:邏輯實體對照表
154:磁碟分割表
156:邏輯磁碟的起始位置
160:檔案系統資訊
162:主要檔案表(MFT)
164:點陣圖(Bitmap)
170:作業系統的程式碼
300、400:主動式修剪操作
S310至S360、S410至S450:步驟1: Computer system
10: Processor
100: Solid State Drive
110: circuit board
120: Non-volatile memory module
122: Non-volatile memory block
130: Controller
132:Firmware
140: Transmission interface
152: Logical entity comparison table
154: Disk partition table
156: The starting position of the logical disk
160: File System Information
162: Master File Table (MFT)
164: Bitmap
170:
第1圖是安裝有本發明一實施例之固態硬碟的電腦系統的功能方塊圖。 第2圖繪示了第1圖中的非揮發性記憶體模組所儲存的相關資料。 第3圖是第1圖之固態硬碟執行主動式修剪操作時的流程圖。 第4圖是當作業系統為WINDOWS 7且檔案系統為NTFS時,本發明之主動式修剪操作的流程圖。 FIG. 1 is a functional block diagram of a computer system installed with a solid-state hard disk according to an embodiment of the present invention. FIG. 2 shows related data stored in the non-volatile memory module in FIG. 1 . FIG. 3 is a flow chart when the solid-state hard disk of FIG. 1 performs an active trimming operation. FIG. 4 is a flow chart of the active trimming operation of the present invention when the operating system is WINDOWS 7 and the file system is NTFS.
300:主動式修剪操作 300: Active trimming operation
S310至S360:步驟 S310 to S360: Steps
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW110120935A TWI773371B (en) | 2021-06-09 | 2021-06-09 | Solid state drive |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW110120935A TWI773371B (en) | 2021-06-09 | 2021-06-09 | Solid state drive |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI773371B true TWI773371B (en) | 2022-08-01 |
TW202248859A TW202248859A (en) | 2022-12-16 |
Family
ID=83806978
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW110120935A TWI773371B (en) | 2021-06-09 | 2021-06-09 | Solid state drive |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI773371B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8463802B2 (en) * | 2010-08-19 | 2013-06-11 | Sandisk Il Ltd. | Card-based management of discardable files |
TWI579692B (en) * | 2010-10-29 | 2017-04-21 | 三星電子股份有限公司 | Memory system, data storage device, user device and data management method thereof |
TW201915740A (en) * | 2017-09-20 | 2019-04-16 | 廣明光電股份有限公司 | Solid state disk and method for implementing trim command of the same |
US20200257620A1 (en) * | 2017-11-07 | 2020-08-13 | Huawei Technologies Co., Ltd. | Memory Block Reclamation Method and Apparatus |
US20200409840A1 (en) * | 2018-09-12 | 2020-12-31 | Huawei Technologies Co., Ltd. | System Garbage Collection Method and Method for Garbage Collection in Solid State Disk |
-
2021
- 2021-06-09 TW TW110120935A patent/TWI773371B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8463802B2 (en) * | 2010-08-19 | 2013-06-11 | Sandisk Il Ltd. | Card-based management of discardable files |
TWI579692B (en) * | 2010-10-29 | 2017-04-21 | 三星電子股份有限公司 | Memory system, data storage device, user device and data management method thereof |
TW201915740A (en) * | 2017-09-20 | 2019-04-16 | 廣明光電股份有限公司 | Solid state disk and method for implementing trim command of the same |
US20200257620A1 (en) * | 2017-11-07 | 2020-08-13 | Huawei Technologies Co., Ltd. | Memory Block Reclamation Method and Apparatus |
US20200409840A1 (en) * | 2018-09-12 | 2020-12-31 | Huawei Technologies Co., Ltd. | System Garbage Collection Method and Method for Garbage Collection in Solid State Disk |
Also Published As
Publication number | Publication date |
---|---|
TW202248859A (en) | 2022-12-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4238514B2 (en) | Data storage device | |
JP4206688B2 (en) | Data processing apparatus and data processing method | |
KR101447188B1 (en) | Method and apparatus for controlling I/O to optimize flash memory | |
US7529971B2 (en) | Composite memory device, data wiring method and program | |
JP4415356B2 (en) | Double journaling storage method and storage medium thereof | |
WO2011095516A1 (en) | Method and system for mass storage on flash memory | |
US7702845B2 (en) | Method and apparatus for managing blocks according to update type of data in block-type memory | |
JP2007310637A (en) | Data storage device and data storage method | |
JP2009116873A (en) | Solid state memory (ssm), computer system having ssm, and ssm driving method | |
JP2013513163A (en) | Storage device virtualization | |
CN110362499B (en) | Electronic machine and control method thereof, computer system and control method thereof, and control method of host | |
KR100854032B1 (en) | Memory system and data storaging method thereof | |
US8433847B2 (en) | Memory drive that can be operated like optical disk drive and method for virtualizing memory drive as optical disk drive | |
JP2015507798A (en) | Method for erasing data entities in a memory module | |
US20090172269A1 (en) | Nonvolatile memory device and associated data merge method | |
WO2006122474A1 (en) | A circuit and method of enhancing the storage lifetime | |
US20120089765A1 (en) | Method for performing automatic boundary alignment and related non-volatile memory device | |
US20120137063A1 (en) | Auxiliary storage device and processing method thereof | |
CN110674056A (en) | Garbage recovery method and device | |
CN101582084A (en) | Method and device for data storage | |
JP5985529B2 (en) | Apparatus, method and device for rapid resumption from hibernation | |
US20170017406A1 (en) | Systems and methods for improving flash-oriented file system garbage collection | |
TWI773371B (en) | Solid state drive | |
JP2015014963A (en) | Storage control apparatus, control program, and control method | |
JP4663577B2 (en) | Data storage device and initialization method thereof |