TW202011186A - Memory storage device and operation method thereof - Google Patents

Memory storage device and operation method thereof Download PDF

Info

Publication number
TW202011186A
TW202011186A TW107131159A TW107131159A TW202011186A TW 202011186 A TW202011186 A TW 202011186A TW 107131159 A TW107131159 A TW 107131159A TW 107131159 A TW107131159 A TW 107131159A TW 202011186 A TW202011186 A TW 202011186A
Authority
TW
Taiwan
Prior art keywords
garbage collection
program
quota
controller
request
Prior art date
Application number
TW107131159A
Other languages
Chinese (zh)
Other versions
TWI696115B (en
Inventor
林秉賢
李祥邦
王綸
楊佳玲
Original Assignee
旺宏電子股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 旺宏電子股份有限公司 filed Critical 旺宏電子股份有限公司
Priority to TW107131159A priority Critical patent/TWI696115B/en
Publication of TW202011186A publication Critical patent/TW202011186A/en
Application granted granted Critical
Publication of TWI696115B publication Critical patent/TWI696115B/en

Links

Images

Landscapes

  • Memory System (AREA)

Abstract

An operation method for a memory storage device is provided. The memory storage device is coupled to a host running a plurality of processes. The memory storage device is includes a memory array and a controller. The operation method includes receiving, by the controller, a first request and a first process ID of a first process among the processes from the host; and based on a first GC (garbage collection) quota parameter corresponding to the first process ID of the first process, sorting, by the controller, the first request and a GC operation, wherein the first GC quota parameter indicating a first GC waiting time of the first process. When the first GC quota parameter corresponding to the first process ID reaches a threshold value, the first request has a sorting priority higher than the GC operation. When the first GC quota parameter corresponding to the first process ID does not reach the threshold value yet, the GC operation has a sorting priority higher than the first request.

Description

記憶體儲存裝置及其操作方法Memory storage device and operation method thereof

本發明是有關於一種記憶體儲存裝置及其操作方法,且特別是有關於一種非揮發性記憶體儲存裝置及其操作方法。The present invention relates to a memory storage device and an operation method thereof, and particularly relates to a non-volatile memory storage device and an operation method thereof.

主機(耦接至記憶體儲存裝置)可能執行一個到多個程式(process),該些程式有可能想要同時存取記憶體儲存裝置內的相同或不同晶片。所以,在排序該些程式的存取先後順序時,原則上應該考量每個程式在存取時的公平性(fairness)。亦即,儘量不要讓某一個程式佔去太多存取時間,或者是出現某一程式一直沒有機會存取的情況,這將使得公平性不足,降低系統性能。The host (coupled to the memory storage device) may execute one or more processes. These programs may want to access the same or different chips in the memory storage device at the same time. Therefore, when arranging the access sequence of these programs, in principle, the fairness of each program during access should be considered. That is, try not to let a certain program take up too much access time, or a situation where a program has never had a chance to access, which will make the fairness insufficient and reduce system performance.

故而,為考量到公平性與性能的問題,在以前,可利用排序器(scheduler),如果有某一程式佔太多資源,則該排序器可以先暫停(block)該程式的存取,並讓其他程式來存取記憶體。Therefore, in order to consider the issues of fairness and performance, in the past, a sequencer (scheduler) can be used. If a program occupies too many resources, the sequencer can first block access to the program, and Let other programs access memory.

然而,現有方法並未考量垃圾回收(Garbage Collection,縮寫為GC)。垃圾回收在電腦科學中是一種自動的記憶體管理機制。當一個電腦上的動態記憶體不再需要時,就應該予以釋放,以釋放出記憶體,這種記憶體資源管理,稱為垃圾回收。However, the existing methods do not consider Garbage Collection (abbreviated as GC). Garbage collection is an automatic memory management mechanism in computer science. When the dynamic memory on a computer is no longer needed, it should be released to release the memory. This memory resource management is called garbage collection.

例如,當有2個程式在存取記憶體時,如果有其中一個程式觸發了GC,則另一個程式需要等待GC完成才能繼續存取記憶體,這將使得系統效能降低。For example, when two programs are accessing memory, if one of the programs triggers the GC, the other program needs to wait for the GC to complete before continuing to access the memory, which will reduce the system performance.

故而,如何兼顧程式在存取記憶體時的公平性乃是目前業界努力方向之一。Therefore, how to take into account the fairness of the program when accessing memory is one of the current industry efforts.

根據本案一實施例,提出一種記憶體儲存裝置的操作方法,該記憶體儲存裝置耦接至執行複數個程式的一主機,該記憶體儲存裝置包括一記憶體陣列以及一控制器,該操作方法包括:由該控制器接收由該主機所傳來的該些程式中的一第一程式的一第一請求與一第一程式辨別碼;以及該控制器根據該第一程式的該第一程式辨別碼所對應的一第一垃圾收集額度參數,以對該第一請求與一垃圾收集操作進行排序,該第一垃圾收集額度參數代表該第一程式的一第一垃圾收集等待時間。當該第一程式辨別碼所對應的該第一垃圾收集額度參數到達一臨界值時,該第一請求的排序優於該垃圾收集操作。當該第一程式辨別碼所對應的該第一垃圾收集額度參數未到達該臨界值時,該垃圾收集操作的排序優於該第一請求。According to an embodiment of the present case, an operation method of a memory storage device is proposed. The memory storage device is coupled to a host executing a plurality of programs. The memory storage device includes a memory array and a controller. The method includes: a first request and a first program identification code of a first program among the programs transmitted from the host are received by the controller; and the first program of the controller according to the first program A first garbage collection quota parameter corresponding to the identification code is used to sort the first request and a garbage collection operation. The first garbage collection quota parameter represents a first garbage collection waiting time of the first program. When the first garbage collection quota parameter corresponding to the first program identification code reaches a critical value, the ordering of the first request is superior to the garbage collection operation. When the first garbage collection quota parameter corresponding to the first program identification code does not reach the critical value, the garbage collection operation is ranked better than the first request.

根據本案另一實施例,提出一種記憶體儲存裝置,耦接至一主機,該主機執行複數個程式,該記憶體儲存裝置包括:一記憶體陣列;以及一控制器,耦接至該記憶體陣列與該主機,該控制器接收由該主機所傳來的該些程式中的一第一程式的一第一請求與一第一程式辨別碼,該控制器根據該第一程式的該第一程式辨別碼所對應的一第一垃圾收集額度參數,以對該第一請求與一垃圾收集操作進行排序,該第一垃圾收集額度參數代表該第一程式的一第一垃圾收集等待時間。當該第一程式辨別碼所對應的該第一垃圾收集額度參數到達一臨界值時,該第一請求的排序優於該垃圾收集操作。當該第一程式辨別碼所對應的該第一垃圾收集額度參數未到達該臨界值時,該垃圾收集操作的排序優於該第一請求。According to another embodiment of the present invention, a memory storage device is provided, which is coupled to a host, and the host executes a plurality of programs. The memory storage device includes: a memory array; and a controller, coupled to the memory The array and the host, the controller receives a first request and a first program identification code of a first program among the programs transmitted from the host, the controller according to the first of the first program A first garbage collection quota parameter corresponding to the program identification code is used to sort the first request and a garbage collection operation. The first garbage collection quota parameter represents a first garbage collection waiting time of the first program. When the first garbage collection quota parameter corresponding to the first program identification code reaches a critical value, the ordering of the first request is superior to the garbage collection operation. When the first garbage collection quota parameter corresponding to the first program identification code does not reach the critical value, the garbage collection operation is ranked better than the first request.

為了對本發明之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下:In order to have a better understanding of the above and other aspects of the present invention, the following examples are specifically described in conjunction with the accompanying drawings as follows:

本說明書的技術用語係參照本技術領域之習慣用語,如本說明書對部分用語有加以說明或定義,該部分用語之解釋係以本說明書之說明或定義為準。本揭露之各個實施例分別具有一或多個技術特徵。在可能實施的前提下,本技術領域具有通常知識者可選擇性地實施任一實施例中部分或全部的技術特徵,或者選擇性地將這些實施例中部分或全部的技術特徵加以組合。The technical terms of this specification refer to the idioms in the technical field. If this specification describes or defines some terms, the interpretation of these terms shall be based on the description or definition of this specification. Each embodiment of the present disclosure has one or more technical features. Under the premise of possible implementation, those skilled in the art can selectively implement some or all of the technical features in any of the embodiments, or selectively combine some or all of the technical features in these embodiments.

第1圖顯示根據本案一實施例的記憶體儲存裝置200的架構示意圖。如第1圖所示,記憶體儲存裝置200包括控制器210與記憶體陣列220。記憶體儲存裝置200耦接至主機100。FIG. 1 shows a schematic structural diagram of a memory storage device 200 according to an embodiment of the present case. As shown in FIG. 1, the memory storage device 200 includes a controller 210 and a memory array 220. The memory storage device 200 is coupled to the host 100.

控制器210包括:主機介面邏輯(host interface logic,HIL)230與快閃轉譯層(flash translation layer,FTL)240。在一實例中,主機介面邏輯230與快閃轉譯層240乃是以韌體方式實施,但本案並不受限於此。The controller 210 includes a host interface logic (HIL) 230 and a flash translation layer (FTL) 240. In one example, the host interface logic 230 and the flash translation layer 240 are implemented in firmware, but the case is not limited to this.

快閃轉譯層240包括:映射器(mapping unit)242、GC管理器(GC manager)244、公平GC排序器(fair GC scheduler)246與佇列(queue)248。The flash translation layer 240 includes: a mapping unit 242, a GC manager 244, a fair GC scheduler 246 and a queue 248.

映射器242用以將主機100所傳來的邏輯位址(logical address)轉譯為實體位址(physical address)。The mapper 242 is used to translate the logical address transmitted from the host 100 into a physical address.

GC管理器244用以進行GC管理。至於在本案實施例中,GC管理器244進行GC操作的時間點則由公平GC排序器246來排序。The GC manager 244 is used for GC management. As for the embodiment of the present case, the time point at which the GC manager 244 performs the GC operation is sorted by the fair GC sorter 246.

公平GC排序器246用於將程式請求與GC的操作順序進行排序,其細節將於底下說明之。The fair GC sorter 246 is used to sort the program request and the operation order of the GC, the details of which will be explained below.

佇列248用以儲存公平GC排序器246所排序的請求與GC的操作順序,以讓記憶體陣列220依照所排定的操作順序來執行請求或GC。The queue 248 is used to store the requests sorted by the fair GC sorter 246 and the operation order of the GC, so that the memory array 220 executes the requests or GC according to the scheduled operation order.

記憶體陣列220包括排列成陣列形式的複數個記憶體晶胞、複數個字元線與複數個位元線。該些記憶體晶胞舉例但不受限於,是快閃記憶體晶胞或其他的非揮發性記憶體晶胞,如相變化記憶體(Phase Change Random Access Memory, PCRAM),可變電阻式記憶體(Resistive random-access memory,縮寫為RRAM 或ReRAM),嵌入式多媒體卡(Embedded Multi-Media Card,eMMC),固態硬碟(Solid-state drive或Solid-state disk,簡稱SSD)等。The memory array 220 includes a plurality of memory cells, a plurality of word lines, and a plurality of bit lines arranged in an array. The memory cells are exemplified but not limited to flash memory cells or other non-volatile memory cells, such as phase change memory (Phase Change Random Access Memory, PCRAM), variable resistance Memory (Resistive random-access memory, abbreviated as RRAM or ReRAM), Embedded Multi-Media Card (eMMC), solid-state drive (Solid-state drive or Solid-state disk, SSD for short), etc.

在主機100的作業系統上有一或多個程式P1-PN(N為正整數)在執行。另外,主機100更包括輸出入排序器(I/O scheduler)110,其根據所接收到的該些程式P1-PN的請求,將請求(Req)與程式辨別碼(PID)送至記憶體儲存裝置200,該程式辨別碼(PID)可用於辨別該請求是由哪一個程式所發出,亦即不同的程式分配到不同的程式辨別碼。輸出入排序器110可偵測該些程式P1-PN的資源消耗,並重新分配資源給該些程式P1-PN。輸出入排序器110的細節在此可不特別限定之。One or more programs P1-PN (N is a positive integer) are running on the operating system of the host 100. In addition, the host 100 further includes an I/O scheduler 110, which sends the request (Req) and the program identification code (PID) to the memory storage according to the received requests of the programs P1-PN In the device 200, the program identification code (PID) can be used to identify which program is issuing the request, that is, different programs are assigned to different program identification codes. The I/O sorter 110 can detect the resource consumption of the programs P1-PN and reallocate resources to the programs P1-PN. The details of the input-output sorter 110 may not be specifically limited here.

現請參考第2圖,其顯示根據本案一實施例的公平GC排序器246的操作示意圖。如第2圖所示,假設由輸出入排序器110所排定的執行順序由高至低分別是:GC、PID=1的請求(亦即,來自程式P1的請求)、PID=2的請求(亦即,來自程式P2的請求)、PID=3的第1個請求(亦即,來自程式P3的請求)與PID=3的第2個請求(亦即,來自程式P3的請求),其中,1代表優先執行,5代表最後執行。不過,經過檢查各程式所對應的GC額度(GC quota)後(程式P1與程式P2的GC額度未到達臨界值(例如GC額度不為0),而程式P3的GC額度到達臨界值(例如GC額度為0)),公平GC排序器246將執行順序重新排序為:PID=3的第1個請求(亦即,來自程式P3的請求)、PID=3的第2個請求(亦即,來自程式P3的請求)、GC、PID=1的請求(亦即,來自程式P1的請求)、PID=2的請求(亦即,來自程式P2的請求)。其中,以GC額度而言,如果某一程式的GC額度到達臨界值(例如但不受限於,GC額度=0)代表該程式所發出的請求有高優先執行順序(比GC的執行順序高);反之,如果某一程式的GC額度未到達臨界值(例如但不受限於,GC額度不等0),代表該程式所發出的請求不具有高優先執行順序(比GC的執行順序低)。GC額度的細節將於後面說明之。經由公平GC排序器246所排定後的執行順序會暫存至佇列248中,之後,便依公平GC排序器246所排定後的執行順序來對記憶體陣列220進行存取或GC。Now please refer to FIG. 2, which shows a schematic diagram of the operation of the fair GC sorter 246 according to an embodiment of the present case. As shown in FIG. 2, assume that the execution order scheduled by the I/O sorter 110 from high to low is: GC, PID=1 request (that is, request from program P1), PID=2 request (That is, the request from program P2), the first request with PID=3 (that is, the request from program P3) and the second request with PID=3 (that is, the request from program P3), where , 1 represents priority execution, and 5 represents final execution. However, after checking the GC quota corresponding to each program (the GC quota of programs P1 and P2 has not reached the critical value (eg, the GC quota is not 0), and the GC quota of the program P3 has reached the critical value (eg GC The quota is 0)), the fair GC sorter 246 reorders the execution order as: the first request with PID=3 (that is, the request from program P3), and the second request with PID=3 (that is, from Program P3 request), GC, PID=1 request (ie, request from program P1), PID=2 request (ie, request from program P2). In terms of GC quota, if the GC quota of a program reaches a critical value (such as but not limited to, GC quota = 0), it means that the request issued by the program has a high priority execution order (higher than the GC execution order) ); Conversely, if the GC quota of a program does not reach the critical value (such as but not limited to, the GC quota is not equal to 0), it means that the request issued by the program does not have a high priority execution order (lower than the GC execution order) ). The details of the GC quota will be explained later. The execution order sorted by the fair GC sorter 246 is temporarily stored in the queue 248, and then the memory array 220 is accessed or GCed according to the execution order sorted by the fair GC sorter 246.

現將進一步說明本案一實施例中,如何決定GC與請求的執行順序。請參照第3圖,其顯示根據本案一實施例的操作示意圖。橫軸是時間軸,最左方代表T=0。假設在時間點TGC-start 時,公平GC排序器246排定開始執行GC。之後,於時間點TR-arrival 時,有一程式的請求1到達,而該程式所對應的GC額度尚未到達該臨界值(假設GC額度目前為5),故而,GC可以繼續執行。由於目前正在執行GC,故而,程式的請求1必須等待。程式的請求1每等待1個時間單位,其GC額度便減少1個固定值(例如1)(亦即GC額度被公平GC排序器246更新)。所以,當程式的請求1等待了5個時間單位後(GC等待時間為5個時間單位),其GC額度從5減少為0,所以,在此時,公平GC排序器246將GC的執行暫停(如時間點TGC-suspend 所示),因為公平GC排序器246必須讓該程式的請求1執行。等到該程式的請求1執行完畢後,公平GC排序器246將GC的執行恢復(如時間點TGC-resume 所示),直到GC執行結束為止(如時間點TGC-complete 所示)。Now, in an embodiment of the present case, how to determine the execution order of the GC and the request will be further described. Please refer to FIG. 3, which shows an operation schematic diagram according to an embodiment of the present case. The horizontal axis is the time axis, and the leftmost side represents T=0. Assume that at the time point T GC-start , the fair GC sorter 246 is scheduled to start performing GC. After that, at the time point T R-arrival , a program request 1 arrives, and the GC credit corresponding to the program has not yet reached the critical value (assuming that the GC credit is currently 5), so the GC can continue to execute. Since the GC is currently being executed, the program's request 1 must wait. Each time the request 1 of the program waits for a time unit, its GC quota decreases by a fixed value (for example, 1) (that is, the GC quota is updated by the fair GC sorter 246). Therefore, when the program's request 1 waits for 5 time units (the GC wait time is 5 time units), its GC quota is reduced from 5 to 0, so at this time, the fair GC sorter 246 suspends the execution of the GC (As shown by time point T GC-suspend ), because the fair GC sorter 246 must let the program request 1 execute. After the execution of request 1 of the program is completed, the fair GC sorter 246 resumes the execution of the GC (as shown by the time point T GC-resume ) until the GC execution ends (as shown by the time point T GC-complete ).

也就是說,在本案實施例中,程式的GC額度代表該程式的GC等待時間。每等待一個時間單位,程式的GC額度便減少1(或減少1個固定值),直到該程式的GC額度到達臨界值為止(亦即,在此例中,程式的GC額度逐漸減少)。一旦當該程式的GC額度到達臨界值,則公平GC排序器246會對GC額度到達臨界值的該程式給予高優先執行順序,且將目前正在執行GC暫停(即便目前正在執行GC尚未執行完畢),如果一來,GC額度到達臨界值的該程式就可以被允許存取記憶體。That is to say, in the embodiment of this case, the GC quota of the program represents the GC waiting time of the program. Each time a unit of time waits, the program's GC quota decreases by 1 (or a fixed value) until the program's GC quota reaches a critical value (that is, in this example, the program's GC quota gradually decreases). Once the GC quota of the program reaches the critical value, the fair GC sorter 246 will give high priority to the program whose GC quota reaches the critical value, and pause the currently executing GC (even if the currently executing GC has not been completed) If the GC quota reaches the threshold, the program can be allowed to access the memory.

當然,在本案其他可能實施例中,也可以每等待一個時間單位,程式的GC額度便增加1(或增加1個固定值),直到該程式的GC額度到達臨界值為止(亦即,在此例中,程式的GC額度逐漸增加)。一旦當該程式的GC額度達到臨界值,則公平GC排序器246會對GC額度到達臨界值的該程式給予高優先執行順序,且將目前正在執行GC暫停(即便目前正在執行GC尚未執行完畢),如果一來,GC額度到達臨界值的該程式就可以被允許存取記憶體。Of course, in other possible embodiments of this case, the GC quota of the program may increase by 1 (or by a fixed value) for each time unit waited until the GC quota of the program reaches a critical value (that is, here In the example, the GC quota of the program gradually increases). Once the GC quota of the program reaches a critical value, the fair GC sorter 246 will give high priority to the program whose GC quota reaches the critical value, and pause the currently executing GC (even if the currently executing GC has not been completed) If the GC quota reaches the threshold, the program can be allowed to access the memory.

請參照第4圖,其顯示根據本案一實施例的另一種操作示意圖,橫軸是時間軸,最左方代表T=0。假設在時間點T1時,公平GC排序器246接收到2個請求(請求1與請求2)與GC執行請求,請求1與請求2分別對應到程式1與程式2,其中,在T1時,程式1的GC額度GC-Q1=0(到達臨界值),而程式2的GC額度GC-Q2=X(X不等於0)。Please refer to FIG. 4, which shows another schematic diagram of operation according to an embodiment of the present case. The horizontal axis is the time axis, and the leftmost side represents T=0. Suppose that at time T1, the fair GC sorter 246 receives 2 requests (request 1 and request 2) and the GC executes the request. Request 1 and request 2 correspond to program 1 and program 2, respectively, where at T1, the program The GC limit of 1 is GC-Q1=0 (reaching the critical value), and the GC limit of program 2 is GC-Q2=X (X is not equal to 0).

由於程式1的GC額度GC-Q1=0,故而,公平GC排序器246讓程式1的請求1優先執行。於時間T2時,程式1的請求1執行完畢,故而,接著換GC執行。Since the GC quota of the program 1 GC-Q1=0, the fair GC sorter 246 gives priority to the request 1 of the program 1. At time T2, the execution of the request 1 of the program 1 is completed. Therefore, the GC is then executed.

於時間T3時,GC已執行X個時間單位,而此時的程式2的GC額度GC-Q2已從X更新為0(GC-Q2=0)。故而,在時間T3時,公平GC排序器246暫停GC的執行,並優先執行請求2。於時間T4時,請求2執行完畢,此時,公平GC排序器246恢復GC的執行,直到時間T5時,GC執行完畢。At time T3, the GC has executed X time units, and the GC quota GC-Q2 of the program 2 at this time has been updated from X to 0 (GC-Q2=0). Therefore, at time T3, the fair GC sorter 246 suspends the execution of the GC and executes request 2 with priority. At time T4, the execution of request 2 is completed. At this time, the fair GC sorter 246 resumes the execution of the GC. At time T5, the execution of the GC is completed.

也就是說,在本案實施例中,公平GC排序器246會定期檢查各程式所對應的GC額度,如果有某一程式的GC額度到達臨界值,則公平GC排序器246優先排定該程式可以存取記憶體(亦即該程式的請求可以被執行)。如此一來,可以避免某一程式等待GC的時間太久進而影響效能。That is to say, in the embodiment of this case, the fair GC sorter 246 periodically checks the GC quota corresponding to each program. If the GC quota of a certain program reaches a critical value, the fair GC sorter 246 prioritizes that the program can Access memory (that is, the program request can be executed). In this way, you can avoid a program waiting for GC too long and affecting performance.

現將說明公平GC排序器246如何更新與重置GC額度。如上述般,每當GC執行1個時間單位,則所有的程式的GC額度皆被更新1次,直到到達臨界值為止。Now, how the fair GC sorter 246 updates and resets the GC quota will be explained. As described above, every time the GC executes a time unit, the GC quotas of all programs are updated once until the threshold is reached.

在本案一實施例中,設置一GC額度時期(GC quota epoch),其有關於GC額度的重置。當GC額度時期結束時,所有程式的GC額度都會被重置(例如,重置為10)。至於如何決定GC額度時期的結束則有2個原則。第1個原則是,如果所有程式的GC額度都到達臨界值,則可視為是GC額度時期的結束。第2個原則是,額外設定一預期時期(anticipation period)。於重置所有程式的所有GC額度之後,當有最早到達臨界值的GC額度出現時,設定該預期時期(例如但不受限於,為20秒),並開始計時。如果在其餘的GC額度當中,有任一GC額度到達臨界值,則重置該預期時期(亦即讓預期時期重新回到初始值,例如20秒);反之,則讓該預期時期繼續計時。如果該預期時期能計時直到結束,則將所有的GC額度重置。也就是,在某一個程式的GC額度到達臨界值之後,如果在預期時期的計時時間內(亦即20秒),都沒有任何一個其他程式的GC額度到達臨界值,則在預期時期結束後,將所有的GC額度重置。第2個原則是為了避免,如果有某一(或某些)程式的GC額度一直沒有到達臨界值的話,代表在這段時間內,該(或該些)程式並未被GC執行而延誤其記憶體存取。所以,可以將所有的GC額度重置。In an embodiment of this case, a GC quota epoch is set, which is related to the reset of the GC quota. When the GC credit period ends, the GC credit of all programs will be reset (for example, reset to 10). As for how to determine the end of the GC quota period, there are two principles. The first principle is that if the GC quota of all programs reaches a critical value, it can be regarded as the end of the GC quota period. The second principle is to set an additional anticipation period. After resetting all GC credits of all programs, when the earliest GC credit that reaches the threshold appears, set the expected period (for example, but not limited to, 20 seconds), and start timing. If any of the remaining GC quotas reaches a critical value, the expected period is reset (that is, the expected period is returned to the initial value, for example, 20 seconds); otherwise, the expected period is continued to be timed. If the expected period can be timed until the end, then all GC credits are reset. That is, after the GC quota of a certain program reaches the critical value, if no GC quota of any other program reaches the critical value within the timing time of the expected period (that is, 20 seconds), after the end of the expected period, Reset all GC credits. The second principle is to avoid that if the GC quota of a program (or some) has not reached the critical value, it means that the program (or programs) has not been executed by the GC during this period of time and delayed its execution. Memory access. Therefore, all GC credits can be reset.

也就是說,在本案一實施例中,GC被觸發時,當有任一程式的GC額度到達臨界值時,公平GC排序器246對GC額度到達臨界值的該(或該些)程式的請求優先執行。相反地,如果GC被觸發時,所有程式的GC額度都沒有到達臨界值的話,公平GC排序器246將優先執行GC。That is to say, in one embodiment of this case, when GC is triggered, when the GC quota of any program reaches a critical value, the fair GC sorter 246 requests the program (or programs) whose GC quota reaches the critical value. Priority. Conversely, if the GC quota of all programs does not reach the critical value when the GC is triggered, the fair GC sorter 246 will give priority to the GC.

第5圖顯示根據本案一實施例的記憶體儲存裝置的操作方法。如第5圖所示,在步驟510中,控制器接收由主機所傳來的第一程式的第一請求與第一程式辨別碼。在步驟520中,控制器根據第一程式辨別碼所對應的第一垃圾收集額度參數,以對第一請求與垃圾收集操作進行排序。FIG. 5 shows the operation method of the memory storage device according to an embodiment of the present case. As shown in FIG. 5, in step 510, the controller receives the first request of the first program and the first program identification code transmitted from the host. In step 520, the controller sorts the first request and the garbage collection operation according to the first garbage collection quota parameter corresponding to the first program identification code.

綜上所述,在本案實施例中,透過透入GC額度,可以避免原本分配給程式的資源因為執行GC而浪費。如此,可以避免程式一直被GC的執行延誤了程式對記憶體的存取,所以,可以藉由本案實施例來避免性能下降,又能兼顧到公平性。In summary, in the embodiment of the present invention, by penetrating into the GC quota, the resources originally allocated to the program can be avoided to be wasted due to the execution of GC. In this way, it can be avoided that the execution of the program has been delayed by the GC's execution of the program's access to the memory. Therefore, the performance of the embodiment can be avoided by this embodiment, and fairness can also be considered.

綜上所述,雖然本發明已以實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。In summary, although the present invention has been disclosed as above with examples, it is not intended to limit the present invention. Those with ordinary knowledge in the technical field to which the present invention belongs can make various modifications and retouching without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be deemed as defined by the scope of the attached patent application.

200:記憶體儲存裝置210:控制器220:記憶體陣列230:主機介面邏輯240:快閃轉譯層242:映射器244:GC管理器246:公平GC排序器248:佇列100:主機P1-PN:程式110:輸出入排序器Req:請求PID:程式辨別碼TGC-start、TR-arrival、TGC-suspend、TGC-resume、TGC-complete:時間點T1-T5:時間點510、520:步驟200: memory storage device 210: controller 220: memory array 230: host interface logic 240: flash translation layer 242: mapper 244: GC manager 246: fair GC sequencer 248: queue 100: host P1- PN: program 110: I/O sequencer Req: request PID: program identification code T GC-start , T R-arrival , T GC-suspend , T GC-resume , T GC-complete : time point T1-T5: time point 510, 520: steps

第1圖顯示根據本案一實施例的記憶體儲存裝置的架構示意圖。 第2圖顯示根據本案一實施例的公平GC排序器的操作示意圖。 第3圖顯示根據本案一實施例的操作示意圖。 第4圖,其顯示根據本案一實施例的另一種操作示意圖。 第5圖顯示根據本案一實施例的記憶體儲存裝置的操作方法。FIG. 1 shows a schematic structural diagram of a memory storage device according to an embodiment of the present case. Figure 2 shows a schematic diagram of the operation of a fair GC sorter according to an embodiment of the present case. Figure 3 shows a schematic diagram of operation according to an embodiment of the present case. Figure 4 shows another schematic diagram of operation according to an embodiment of the present case. FIG. 5 shows the operation method of the memory storage device according to an embodiment of the present case.

510-520:步驟 510-520: steps

Claims (10)

一種記憶體儲存裝置的操作方法,該記憶體儲存裝置耦接至執行複數個程式的一主機,該記憶體儲存裝置包括一記憶體陣列以及一控制器,該操作方法包括: 由該控制器接收由該主機所傳來的該些程式中的一第一程式的一第一請求與一第一程式辨別碼;以及 該控制器根據該第一程式的該第一程式辨別碼所對應的一第一垃圾收集額度參數,以對該第一請求與一垃圾收集操作進行排序,該第一垃圾收集額度參數代表該第一程式的一第一垃圾收集等待時間, 其中,當該第一程式辨別碼所對應的該第一垃圾收集額度參數到達一臨界值時,該第一請求的排序優於該垃圾收集操作;以及 當該第一程式辨別碼所對應的該第一垃圾收集額度參數未到達該臨界值時,該垃圾收集操作的排序優於該第一請求。An operation method of a memory storage device is coupled to a host that executes a plurality of programs. The memory storage device includes a memory array and a controller. The operation method includes: receiving by the controller A first request and a first program identification code of a first program among the programs transmitted from the host; and a first program identification code corresponding to the first program identification code of the first program A garbage collection quota parameter to sort the first request and a garbage collection operation, the first garbage collection quota parameter represents a first garbage collection waiting time of the first program, wherein, when the first program identification code When the corresponding first garbage collection quota parameter reaches a critical value, the first request is sorted better than the garbage collection operation; and when the first garbage collection quota parameter corresponding to the first program identification code does not reach the threshold At a critical value, the order of the garbage collection operation is better than the first request. 如申請專利範圍第1項所述之記憶體儲存裝置的操作方法,其中, 如果於該垃圾收集操作執行期間,該第一程式的該第一請求到達該控制器,而該第一程式辨別碼所對應的該第一垃圾收集額度參數尚未到達該臨界值,該控制器讓該垃圾收集操作繼續執行且讓該第一程式的該第一請求處於等待; 於該第一程式的該第一請求等待時,該控制器更新該第一垃圾收集額度參數; 如果該第一垃圾收集額度參數到達該臨界值時,該垃圾收集操作尚未執行完畢,則該控制器暫停該垃圾收集操作並執行該第一程式的該第一請求;以及 當該第一程式的該第一請求執行完畢後,該控制器恢復執行該垃圾收集操作。The operation method of the memory storage device as described in item 1 of the patent application scope, wherein, if during the execution of the garbage collection operation, the first request of the first program reaches the controller, and the first program identification code The corresponding first garbage collection quota parameter has not yet reached the critical value, the controller allows the garbage collection operation to continue to execute and the first request of the first program is waiting; the first request of the first program While waiting, the controller updates the first garbage collection quota parameter; if the first garbage collection quota parameter reaches the critical value and the garbage collection operation has not been completed, the controller suspends the garbage collection operation and executes the first The first request of a program; and when the execution of the first request of the first program is completed, the controller resumes the garbage collection operation. 如申請專利範圍第1項所述之記憶體儲存裝置的操作方法,其中,如果於一第一時間點,該控制器接收到該些程式的一第二程式的一第二請求、一第三程式的一第三請求與該垃圾收集操作,該第二程式的一第二程式辨別碼所對應的一第二垃圾收集額度參數已到達該臨界值,且該第三程式的一第三程式辨別碼所對應的一第三垃圾收集額度參數尚未到達該臨界值,則該控制器排序為:該第二請求、該垃圾收集操作與該第三請求。The operation method of the memory storage device as described in item 1 of the patent application scope, wherein, if at a first time point, the controller receives a second request, a third request of a second program of the programs A third request of the program and the garbage collection operation, a second garbage collection quota parameter corresponding to a second program identification code of the second program has reached the critical value, and a third program of the third program is identified A third garbage collection quota parameter corresponding to the code has not yet reached the critical value, then the controller sorts: the second request, the garbage collection operation, and the third request. 如申請專利範圍第1項所述之記憶體儲存裝置的操作方法,其中, 每當該垃圾收集操作執行一個時間單位,該控制器更新該些程式所對應的複數個垃圾收集額度參數,直到到達該臨界值為止;以及 如果該些程式之一程式的一垃圾收集額度參數已到達該臨界值,則該控制器讓該些程式之該程式的該垃圾收集額度參數繼續保持為該臨界值,直到該些程式之該程式的該垃圾收集額度參數被重置為止。The operation method of the memory storage device as described in item 1 of the patent application scope, wherein each time the garbage collection operation is executed for a time unit, the controller updates the plurality of garbage collection quota parameters corresponding to the programs until it reaches The threshold value; and if a garbage collection quota parameter of one of the programs has reached the threshold value, the controller keeps the garbage collection quota parameter of the programs of the programs to remain at the threshold value until Until the garbage collection quota parameter of the program of the programs is reset. 如申請專利範圍第1項所述之記憶體儲存裝置的操作方法,其中, 該控制器設置一垃圾收集額度參數時期; 當該垃圾收集額度參數時期結束時,該控制器重置該些程式所對應的複數個垃圾收集額度參數; 如果該些程式所對應的該些垃圾收集額度參數都到達該臨界值,則該控制器讓該垃圾收集額度參數時期結束且該控制器重置該些程式所對應的該些垃圾收集額度參數; 於該控制器重置該些程式所對應的該些垃圾收集額度參數之後,當該些垃圾收集額度參數之一最早到達該臨界值時,該控制器更設定一預期時期,並開始計時; 如果在其餘的該些垃圾收集額度參數之中,有任一垃圾收集額度參數到達該臨界值,則該控制器重置該預期時期,反之,則該控制器讓該預期時期繼續計時;以及 如果該預期時期計時直到結束,則該控制器將所有的該些垃圾收集額度參數重置。The operation method of the memory storage device as described in item 1 of the patent application scope, wherein the controller sets a period of the garbage collection quota parameter; when the period of the garbage collection quota parameter ends, the controller resets the programs Corresponding plural garbage collection quota parameters; if the garbage collection quota parameters corresponding to the programs all reach the critical value, the controller allows the garbage collection quota parameter period to end and the controller resets the programs The corresponding garbage collection quota parameters; after the controller resets the garbage collection quota parameters corresponding to the programs, when one of the garbage collection quota parameters reaches the threshold at the earliest, the controller further sets An expected period and start timing; if any of the remaining garbage collection quota parameters reaches the critical value, the controller resets the expected period, otherwise, the controller lets The expected period continues to be timed; and if the expected period is timed out until the end, the controller resets all the garbage collection quota parameters. 一種記憶體儲存裝置,耦接至一主機,該主機執行複數個程式,該記憶體儲存裝置包括: 一記憶體陣列;以及 一控制器,耦接至該記憶體陣列與該主機,該控制器接收由該主機所傳來的該些程式中的一第一程式的一第一請求與一第一程式辨別碼,該控制器根據該第一程式的該第一程式辨別碼所對應的一第一垃圾收集額度參數,以對該第一請求與一垃圾收集操作進行排序,該第一垃圾收集額度參數代表該第一程式的一第一垃圾收集等待時間, 其中,當該第一程式辨別碼所對應的該第一垃圾收集額度參數到達一臨界值時,該第一請求的排序優於該垃圾收集操作;以及 當該第一程式辨別碼所對應的該第一垃圾收集額度參數未到達該臨界值時,該垃圾收集操作的排序優於該第一請求。A memory storage device is coupled to a host, the host executes a plurality of programs, the memory storage device includes: a memory array; and a controller, coupled to the memory array and the host, the controller Receiving a first request and a first program identification code of a first program among the programs transmitted from the host, the controller according to a first program identification code corresponding to the first program identification code of the first program A garbage collection quota parameter to sort the first request and a garbage collection operation, the first garbage collection quota parameter represents a first garbage collection waiting time of the first program, wherein, when the first program identification code When the corresponding first garbage collection quota parameter reaches a critical value, the first request is sorted better than the garbage collection operation; and when the first garbage collection quota parameter corresponding to the first program identification code does not reach the threshold At a critical value, the order of the garbage collection operation is better than the first request. 如申請專利範圍第6項所述之記憶體儲存裝置,其中, 如果於該垃圾收集操作執行期間,該第一程式的該第一請求到達該控制器,而該第一程式辨別碼所對應的該第一垃圾收集額度參數尚未到達該臨界值,該垃圾收集操作繼續執行且該第一程式的該第一請求處於等待; 於該第一程式的該第一請求等待時,該控制器更新該第一垃圾收集額度參數; 如果該第一垃圾收集額度參數到達該臨界值時,該垃圾收集操作尚未執行完畢,則該控制器暫停該垃圾收集操作並執行該第一程式的該第一請求;以及 當該第一程式的該第一請求執行完畢後,該控制器恢復執行該垃圾收集操作。The memory storage device as described in item 6 of the patent application scope, wherein, during the execution of the garbage collection operation, if the first request of the first program reaches the controller, and the first program identification code corresponds to The first garbage collection quota parameter has not yet reached the threshold, the garbage collection operation continues to execute and the first request of the first program is waiting; while the first request of the first program is waiting, the controller updates the The first garbage collection quota parameter; if the first garbage collection quota parameter reaches the critical value and the garbage collection operation has not yet been completed, the controller suspends the garbage collection operation and executes the first request of the first program; And when the execution of the first request of the first program is completed, the controller resumes the garbage collection operation. 如申請專利範圍第6項所述之記憶體儲存裝置,其中,如果於一第一時間點,該控制器接收到該些程式的一第二程式的一第二請求、一第三程式的一第三請求與該垃圾收集操作,該第二程式的一第二程式辨別碼所對應的一第二垃圾收集額度參數已到達該臨界值,且該第三程式的一第三程式辨別碼所對應的一第三垃圾收集額度參數尚未到達該臨界值,則該控制器排序為:該第二請求、該垃圾收集操作與該第三請求。The memory storage device as described in item 6 of the patent application scope, wherein, if at a first time point, the controller receives a second request of a second program of the programs and a third program of a third program The third request and the garbage collection operation, a second garbage collection quota parameter corresponding to a second program identification code of the second program has reached the critical value, and a third program identification code corresponding to the third program A third garbage collection quota parameter has not yet reached the critical value, then the controller sorts: the second request, the garbage collection operation and the third request. 如申請專利範圍第6項所述之記憶體儲存裝置,其中, 每當該垃圾收集操作執行一個時間單位,該控制器更新該些程式所對應的複數個垃圾收集額度參數,直到到達該臨界值為止;以及 如果該些程式之一程式的一垃圾收集額度參數已到達該臨界值,則該些程式之該程式的該垃圾收集額度參數繼續保持為該臨界值,直到該些程式之該程式的該垃圾收集額度參數被重置為止。The memory storage device as described in item 6 of the patent application scope, wherein each time the garbage collection operation is performed for a time unit, the controller updates the plurality of garbage collection quota parameters corresponding to the programs until the threshold is reached So far; and if a garbage collection quota parameter of one of the programs has reached the threshold, the garbage collection quota parameter of the program of the programs continues to remain at the threshold until the program’s The garbage collection quota parameter is reset. 如申請專利範圍第6項所述之記憶體儲存裝置,其中, 該控制器設置一垃圾收集額度參數時期; 當該垃圾收集額度參數時期結束時,該控制器重置該些程式所對應的複數個垃圾收集額度參數; 如果該些程式所對應的該些垃圾收集額度參數都到達該臨界值,則該垃圾收集額度參數時期結束且該控制器重置該些程式所對應的該些垃圾收集額度參數; 於該控制器重置該些程式所對應的該些垃圾收集額度參數之後,當該些垃圾收集額度參數之一最早到達該臨界值時,該控制器更設定一預期時期,並開始計時; 如果在其餘的該些垃圾收集額度參數之中,有任一垃圾收集額度參數到達該臨界值,則該控制器重置該預期時期,反之,則該控制器讓該預期時期繼續計時;以及 如果該預期時期計時直到結束,則該控制器將所有的該些垃圾收集額度參數重置。The memory storage device as described in item 6 of the patent application scope, wherein the controller sets a garbage collection quota parameter period; when the garbage collection quota parameter period ends, the controller resets the plurals corresponding to the programs Garbage collection quota parameters; if the garbage collection quota parameters corresponding to the programs all reach the critical value, the garbage collection quota parameter period ends and the controller resets the garbage collection quotas corresponding to the programs Parameters; after the controller resets the garbage collection quota parameters corresponding to the programs, when one of the garbage collection quota parameters reaches the threshold at the earliest, the controller sets an expected period and starts timing ; If any of the remaining garbage collection quota parameters reaches the critical value, the controller resets the expected period; otherwise, the controller allows the expected period to continue timing; and If the expected period is counted until the end, the controller resets all the garbage collection quota parameters.
TW107131159A 2018-09-05 2018-09-05 Memory storage device and operation method thereof TWI696115B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107131159A TWI696115B (en) 2018-09-05 2018-09-05 Memory storage device and operation method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107131159A TWI696115B (en) 2018-09-05 2018-09-05 Memory storage device and operation method thereof

Publications (2)

Publication Number Publication Date
TW202011186A true TW202011186A (en) 2020-03-16
TWI696115B TWI696115B (en) 2020-06-11

Family

ID=70766774

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107131159A TWI696115B (en) 2018-09-05 2018-09-05 Memory storage device and operation method thereof

Country Status (1)

Country Link
TW (1) TWI696115B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11494299B2 (en) 2021-02-18 2022-11-08 Silicon Motion, Inc. Garbage collection operation management with early garbage collection starting point

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073103A1 (en) * 2000-08-25 2002-06-13 Bottomley Thomas Mark Walter Memory garbage collection method and apparatus
US20090006720A1 (en) * 2007-06-27 2009-01-01 Shai Traister Scheduling phased garbage collection and house keeping operations in a flash memory system
US8205203B2 (en) * 2008-10-16 2012-06-19 International Business Machines Corporation Scheduling for real-time garbage collection
US20100287217A1 (en) * 2009-04-08 2010-11-11 Google Inc. Host control of background garbage collection in a data storage device
US10430332B2 (en) * 2013-03-25 2019-10-01 Salesforce.Com, Inc. System and method for performance tuning of garbage collection algorithms
US9032410B1 (en) * 2014-08-19 2015-05-12 Xamarin Inc. Non-precise garbage collection in non-cooperative systems

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11494299B2 (en) 2021-02-18 2022-11-08 Silicon Motion, Inc. Garbage collection operation management with early garbage collection starting point
TWI784514B (en) * 2021-02-18 2022-11-21 慧榮科技股份有限公司 Garbage collection operation management
US11681615B2 (en) 2021-02-18 2023-06-20 Silicon Motion, Inc. Garbage collection operation management based on overall valid page percentage of source block and candidate source block
US11704241B2 (en) 2021-02-18 2023-07-18 Silicon Motion, Inc. Garbage collection operation management with early garbage collection starting point
US11809312B2 (en) 2021-02-18 2023-11-07 Silicon Motion, Inc. Garbage collection operation management based on overall spare area

Also Published As

Publication number Publication date
TWI696115B (en) 2020-06-11

Similar Documents

Publication Publication Date Title
WO2018103685A1 (en) Operation instruction scheduling method and apparatus for nand flash memory device
US10635485B2 (en) Devices, systems, and methods for lockless distributed object input/output
US9009397B1 (en) Storage processor managing solid state disk array
CN107885456B (en) Reducing conflicts for IO command access to NVM
TWI354930B (en) Method and system for speculatively sending proces
CN111580749B (en) Storage node, hybrid memory controller and method for controlling hybrid memory group
US20130173843A1 (en) Write bandwidth management for flash devices
CN111324427B (en) Task scheduling method and device based on DSP
US10019283B2 (en) Predicting a context portion to move between a context buffer and registers based on context portions previously used by at least one other thread
US11740812B2 (en) Data storage device idle time processing
US11429314B2 (en) Storage device, storage system and operating method thereof
US10896131B2 (en) System and method for configuring a storage device based on prediction of host source
CN115658277B (en) Task scheduling method and device, electronic equipment and storage medium
CN107870866B (en) IO command scheduling method and NVM interface controller
US20190286582A1 (en) Method for processing client requests in a cluster system, a method and an apparatus for processing i/o according to the client requests
TW202030614A (en) System-level cache
CN109213423B (en) Address barrier-based lock-free processing of concurrent IO commands
US10042773B2 (en) Advance cache allocator
TWI696115B (en) Memory storage device and operation method thereof
CN107870779B (en) Scheduling method and device
US10846265B2 (en) Method and apparatus for accessing file, and storage system
CN110908790B (en) Memory storage device and operation method thereof
US20170192720A1 (en) Prioritization of order ids in dram scheduling
EP3696674A1 (en) Triggered operations for collective communication
CN109213424B (en) Lock-free processing method for concurrent IO command