Dynamically modifying a garbage collection rate of a memory subsystem in a closed loop system

By using negative loop feedback in the closed-loop system to adjust the garbage collection rate and predict the fill time of the write cursor, the problem of improper resource allocation caused by write cursor collisions in the memory subsystem is solved, thereby improving QoS and write performance.

CN112069087BActive Publication Date: 2026-06-23MICRON TECHNOLOGY INC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MICRON TECHNOLOGY INC
Filing Date
2020-06-09
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

The garbage collection process in the existing memory subsystem has a negative impact on the quality of service (QoS), especially when write cursor collisions occur, improper resource allocation leads to a decrease in write performance.

Method used

By using negative loop feedback in a closed-loop system to adjust the garbage collection rate, predicting the fill time of the write cursor, and dynamically adjusting the garbage collection process, the write cursor is ensured to continuously provide free superblocks, avoiding resource waste and premature allocation.

Benefits of technology

It improves the Quality of Service (QoS) of the memory subsystem, reduces the negative impact of write cursor collisions, and optimizes write performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112069087B_ABST
    Figure CN112069087B_ABST
Patent Text Reader

Abstract

This application relates to dynamically modifying a garbage collection rate of a memory subsystem in a closed loop system. In a closed loop garbage collection system, a comparator receives a first target time indicating when a first write rate based on a first write cursor is expected to fill a first superblock of a memory with data units. The comparator further receives negative loop feedback from the garbage collection process based on one or more elements. The comparator determines a first garbage collection rate based on the first target time and the negative loop feedback, where the first garbage collection rate is calculated to provide the first write cursor with a free empty superblock within a time range of the first target time. The comparator sends instructions to a garbage collection manager to perform a garbage collection process at the first garbage collection rate, where results of the garbage collection process are incorporated into the negative loop feedback sent to the comparator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to a memory subsystem, and more specifically, to dynamically modifying the garbage collection rate of a memory subsystem in a closed-loop system. Background Technology

[0002] The memory subsystem can be a storage system such as a solid-state drive (SSD) and can contain one or more memory components for storing data. Memory components can be, for example, non-volatile memory components and volatile memory components. Generally, the host system can utilize the memory subsystem to store data at the memory components and retrieve data from the memory components. Summary of the Invention

[0003] In one aspect, this application provides a method comprising: receiving a first target time at a comparator in a closed-loop garbage collection system, the first target time indicating when the first superblock is expected to be filled based on a first write rate of writing data units to a first superblock of memory using a first write cursor; receiving negative loop feedback at the comparator; determining a first garbage collection rate by the comparator based on the first target time and the negative loop feedback, the first garbage collection rate being calculated to provide free empty superblocks to the first write cursor within a time range of the first target time; and sending an instruction to a garbage collection manager to perform a garbage collection process at the first garbage collection rate, wherein the result of the garbage collection process is incorporated into the negative loop feedback sent to the comparator.

[0004] On the other hand, this application provides a non-transitory computer-readable medium storing instructions that, when executed by a processing device, cause the processing device to: receive a first target time at a comparator in a closed-loop garbage collection system, the first target time indicating when a first write rate is expected to fill a first superblock of memory based on a first write cursor; receive negative loop feedback at the comparator; determine a first garbage collection rate by the comparator based on the first target time and the negative loop feedback, the first garbage collection rate being calculated to provide an empty superblock to the first write cursor within the time range of the first target time; and send instructions to a garbage collection manager to perform a garbage collection process at the first garbage collection rate, wherein the result of the garbage collection process is incorporated into the negative loop feedback sent to the comparator.

[0005] In another aspect, this application provides a method comprising: receiving a first instruction from a first write cursor to write data units to a first superblock within an allocated portion of a memory comprising a plurality of superblocks at a first write rate; determining a first target time for filling the first superblock based on the first write rate; determining a first garbage collection rate for a set of superblocks designated for garbage collection within the allocated portion of the memory based on the first target time; receiving a second instruction from the first write cursor to write data units to the first superblock at a second write rate different from the first write rate; determining a second target time for filling the first superblock based on the second write rate; and modifying the first garbage collection rate of the set of superblocks designated for garbage collection within the allocated portion of the memory to the second garbage collection rate based on the second target time. Attached Figure Description

[0006] This disclosure will be more fully understood from the detailed descriptions given below and the accompanying drawings, which illustrate various embodiments of the invention. However, the drawings should not be construed as limiting this disclosure to the specific embodiments, but are for explanation and understanding only.

[0007] Figure 1 An example computing environment including a memory subsystem is shown according to some embodiments of the present disclosure.

[0008] Figure 2 This is a flowchart of an example method for modifying the garbage collection rate based on an estimated target time for filling a superblock, according to some embodiments of this disclosure.

[0009] Figure 3 A graph illustrating the performance of read and write cursors in a memory subsystem according to some embodiments of the present disclosure is provided.

[0010] Figure 4 This is a flowchart of an example method for performing a garbage collection prior process according to some embodiments of the present disclosure.

[0011] Figure 5 This is a block diagram of a closed-loop waste collection architecture according to some embodiments of the present disclosure.

[0012] Figure 6 This is a flowchart of an example method for performing a garbage collection process in a closed-loop system according to some embodiments of the present disclosure.

[0013] Figure 7 This is a block diagram of an example computer system in which embodiments of this disclosure may be operated. Detailed Implementation

[0014] This disclosure relates to a garbage collection manager in a memory subsystem. The memory subsystem is also referred to hereinafter as a "memory device." Examples of a memory subsystem include memory modules connected to a central processing unit (CPU) via a memory bus. Examples of memory modules include dual in-line memory modules (DIMMs), small outline DIMMs (SO-DIMMs), non-volatile dual in-line memory modules (NVDIMMs), etc. Another example of a memory subsystem is a storage device connected to the CPU via peripheral interconnects (e.g., input / output buses, storage area networks, etc.). Examples of storage devices include solid-state drives (SSDs), flash drives, universal serial bus (USB) flash drives, and hard disk drives (HDDs). In some embodiments, the memory subsystem is a hybrid memory / storage subsystem. Generally, a host system may utilize a memory subsystem comprising one or more memory components. The host system can provide data to be stored in the memory subsystem and can request data to be retrieved from the memory subsystem.

[0015] The memory subsystem receives data from the host system to write to memory, including writing to non-volatile memory (e.g., NAND flash memory). The flash memory is subdivided into superblocks. In one embodiment, a superblock consists of one or more blocks, each with multiple pages. In one embodiment, 4-8 MB of data can be written to a single block, and 8-16 KB of data can be written to each page within a block. The memory subsystem uses write cursors to write data to the superblocks. The write cursor receives data units from the host (e.g., host system 120) and writes the data units to the superblock in memory at the location pointed to by the write cursor. The write cursor continues writing to the location in the superblock until the write cursor fills the superblock. When the write cursor fills a superblock, the memory subsystem allocates a new superblock from a queue of free superblocks or other reserved sets, and the write cursor continues writing data to the new superblock. In a multi-write cursor environment, each write cursor writes to a separate superblock, and the memory subsystem reserves enough additional free superblocks to satisfy each write cursor. For example, in a five-write cursor environment, five superblocks are open, and each of the five write cursors can write to its corresponding superblock. A complexity in multi-write cursor environments lies in the occurrence of cursor collisions, which happen when two or more write cursors simultaneously need to access resources (e.g., new superblocks). For example, if collisions exist for all five write cursors in the aforementioned five-write cursor environment—for instance, if all five write cursors simultaneously or within a relatively short timeframe of each other, then the memory subsystem must prepare five new superblocks for the five colliding write cursors to allow the write cursors to continue writing data uninterruptedly. Superblocks in flash memory typically cannot be overwritten. Instead, to free a superblock, the memory subsystem performs a garbage collection process that includes erasing all data in the superblock. Before erasing the data in the superblock, the memory subsystem copies any valid data from the superblock to be erased and writes that valid data to a new superblock.

[0016] Garbage collection can negatively impact Quality of Service (QoS). QoS is measured based on the amount of time a storage device takes to execute commands. In a storage device with ideal QoS, the time taken to execute a command remains relatively constant across multiple executions of a particular command. When the time taken to execute the same command varies significantly, the storage device exhibits poor QoS. Garbage collection can affect QoS when resources are inefficiently allocated to garbage collection, which could otherwise be allocated to other processes. For example, when a cursor collision occurs, multiple write cursors require a new superblock to continue uninterrupted writing. The more write cursors involved in a cursor collision, the more system resources must be diverted from other operations to perform the garbage collection process that generates an empty superblock. Similarly, reserving empty superblocks by performing too many or too early garbage collection processes (e.g., over-provisioning) can also negatively impact write amplification, as system resources used for excessive or premature garbage collection can be dedicated to other operations.

[0017] Various aspects of this disclosure provide QoS efficiency and the effect of write amplification of the storage device during command execution by managing the garbage collection process in a closed-loop system. In one embodiment, the system uses host behavior (e.g., write rate or host write speed) to determine how to effectively perform garbage collection without causing interruption to the write cursor (e.g., during a cursor collision). Other aspects of the invention describe predicting and estimating when a cursor collision will occur and adjusting the garbage collection rate to minimize or eliminate the negative impact of cursor collisions.

[0018] The aspects of this disclosure also include a garbage collection process implemented in a closed-loop system in which the closed-loop controller uses negative loop feedback of a target (e.g., predicting the time when idle superblocks will be needed) to determine the garbage collection rate, said feedback being generated in part for the detected results of a garbage collection process performed based on previous outputs of the closed-loop controller. Using a closed-loop system that leverages feedback from the results of the garbage collection process allows the closed-loop controller to fine-tune the garbage collection rate of the garbage collection process to improve QoS by ensuring that empty superblocks are provided uninterruptedly by a write cursor when needed, while also preventing over-provisioning by ensuring that empty superblocks are not provided prematurely.

[0019] Figure 1An example computing environment 100 including a memory subsystem 110 is illustrated according to some embodiments of the present disclosure. The memory subsystem 110 may include media, such as memory components 112A to 112N. Memory components 112A to 112N may be volatile memory components, non-volatile memory components, or combinations thereof. In some embodiments, the memory subsystem is a storage system. An example of a storage system is an SSD. In some embodiments, the memory subsystem 110 is a hybrid memory / storage subsystem. Generally, the computing environment 100 may include a host system 120 that uses the memory subsystem 110. For example, the host system 120 may write data to and read data from the memory subsystem 110.

[0020] Host system 120 may be a computing device, such as a desktop computer, laptop computer, network server, mobile device, or such computing device containing memory and processing power. Host system 120 may include or be coupled to memory subsystem 110, such that host system 120 can read data from or write data to memory subsystem 110. Host system 120 may be coupled to memory subsystem 110 via a physical host interface. As used herein, “coupled to” generally refers to a connection between components, which may be an indirect or direct communication connection (e.g., without an intermediate component), whether wired or wireless, including connections such as electrical, optical, and magnetic connections. Examples of physical host interfaces include, but are not limited to, Serial Advanced Technology Attachment (SATA) interfaces, Peripheral Component Interconnect Fast (PCIe) interfaces, Universal Serial Bus (USB) interfaces, Fibre Channel, Serial Attached SCSI (SAS), etc. The physical host interface can be used to transfer data between host system 120 and memory subsystem 110. When the memory subsystem 110 is coupled to the host system 120 via a PCIe interface, the host system 120 can also access the memory components 112A to 112N using an NVM Express (NVMe) interface. The physical host interface provides an interface for passing control, address, data, and other signals between the memory subsystem 110 and the host system 120.

[0021] Memory components 112A to 112N may comprise any combination of different types of non-volatile memory components and / or volatile memory components. Examples of non-volatile memory components include NAND flash memory. Each of memory components 112A to 112N may comprise one or more arrays of memory cells, such as single-level cell (SLC) or multi-level cell (MLC) (e.g., triple-level cell (TLC) or quad-level cell (QLC)). In some embodiments, a particular memory component may comprise both an SLC portion and an MLC portion of a memory cell. Each memory cell may store one or more data bits (e.g., a data block) used by the host system 120. Although non-volatile memory components such as NAND flash memory have been described, memory components 112A to 112N may be based on any other type of memory, such as volatile memory. In some embodiments, memory components 112A to 112N may be, but are not limited to, random access memory (RAM), read-only memory (ROM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), phase-change memory (PCM), magnetic random access memory (MRAM), negative OR (NOR) flash memory, electrically erasable programmable read-only memory (EEPROM), and a cross-point array of non-volatile memory cells. The cross-point array of non-volatile memory may perform bit storage based on variations in bulk resistance combined with a stackable cross-grid data access array. Furthermore, unlike many flash-based memories, cross-point non-volatile memory can perform write-in-situ operations, where non-volatile memory cells can be programmed without prior erasing. Additionally, the memory cells of memory components 112A to 112N may be grouped into memory pages or data blocks, which may refer to cells of the memory component used for storing data.

[0022] Memory system controller 115 (hereinafter referred to as the "controller") can communicate with memory components 112A to 112N to perform operations such as reading data, writing data, or erasing data at memory components 112A to 112N, and other such operations. Controller 115 may include hardware (e.g., one or more integrated circuits and / or discrete components), buffer memory, or a combination thereof. Controller 115 may be a microcontroller, application-specific logic circuitry (e.g., a field-programmable gate array (FPGA), application-specific integrated circuit (ASIC), etc.), or another suitable processor. Controller 115 may include a processor (processing device) 117 configured to execute instructions stored in local memory 119. In the illustrated example, the local memory 119 of controller 115 includes embedded memory configured to store instructions for performing various processes, operations, logical flows, and routines that control the operation of memory subsystem 110, including handling communication between memory subsystem 110 and host system 120. In some embodiments, local memory 119 may include memory registers storing memory pointers, fetched data, etc. Local memory 119 may also include read-only memory (ROM) for storing microcode. Although Figure 1 The instance memory subsystem 110 has been shown to include a controller 115, but in another embodiment of this disclosure, the memory subsystem 110 may not include a controller 115 and may instead rely on external control (e.g., provided by an external host or by a processor or controller separate from the memory subsystem).

[0023] Generally, controller 115 can receive commands or operations from host system 120 and can translate these commands or operations into instructions or appropriate commands to enable the desired access to memory components 112A to 112N. Controller 115 may handle other operations such as wear leveling, garbage collection, error detection and correction (ECC) operations, encryption, caching, and address translation between logical block addresses and physical block addresses associated with memory components 112A to 112N. Controller 115 may further include host interface circuitry that communicates with host system 120 via a physical host interface. The host interface circuitry can translate commands received from the host system into command instructions to access memory components 112A to 112N and translate responses associated with memory components 112A to 112N into information for host system 120.

[0024] The memory subsystem 110 may also include additional circuitry or components not shown. In some embodiments, the memory subsystem 110 may include cache or buffer (e.g., DRAM) and address circuitry (e.g., row decoder and column decoder) that can receive addresses from the controller 115 and decode the addresses to access memory components 112A to 112N.

[0025] The memory subsystem 110 includes a garbage collection manager 113 that evaluates the rate at which write cursors write data (e.g., data units) into superblocks in memory components (e.g., memory components 112A-112N). In one embodiment, each data unit is 4 KB in size. In other embodiments, the size of the data unit varies based on configuration data. A data unit may be referred to as a translation unit (TU) or logical block address (LBA). The garbage collection manager 113 also determines when a write cursor will fill a superblock, requiring a new empty superblock to continue writing data. The garbage collection manager 113 also determines whether two or more write cursors will collide, for example, filling a superblock almost simultaneously and each requiring a new empty superblock. Based on these determinations, the garbage collection manager 113 can dynamically modify the garbage collection rate so that new empty superblocks can be generated by garbage collection, queued, and then allocated to write cursors in a manner that minimizes the impact on write performance. In some embodiments, the controller 115 includes at least a portion of the garbage collection manager 113. For example, controller 115 may include processor 117 (processing device) configured to execute instructions stored in local memory 119 for performing the operations described herein. In some embodiments, garbage collection manager 113 is part of host system 120, an application, or an operating system.

[0026] A. Modify garbage collection based on write cursor rate

[0027] Figure 2 This is a flowchart 200 of an example method for modifying the garbage collection rate based on an estimated target time for filling a superblock, according to some embodiments of this disclosure. Method 200 can be executed by processing logic, which may include hardware (e.g., processing device, circuitry, dedicated logic, programmable logic, microcode, device hardware, integrated circuits, etc.), software (e.g., instructions that run or execute on the processing device), or a combination thereof. In some embodiments, method 200 is performed by… Figure 1The garbage collection manager 113 or one or more sub-components of the garbage collection manager 113 execute the process. Although shown in a specific order or sequence, the order of the processes can be modified unless otherwise stated. Therefore, the illustrated embodiments should be understood as examples only, and the illustrated processes can be executed in different orders, and some processes can be executed in parallel. In addition, one or more processes may be omitted in various embodiments. Therefore, not all processes are required in each embodiment. Other process flows are also possible.

[0028] At operation 205, the processing device receives feedback indicating that the first write cursor is writing data units to a first superblock within an allocated portion of the memory at the current write rate. For example, garbage collection manager 113 receives feedback indicating the rate at which the write cursor is writing data units to its designated superblock. In embodiments with multiple write cursors, the processing device is configured to receive feedback from multiple write cursors indicating the write rates of the multiple write cursors.

[0029] In one embodiment, the write rate of the write cursor at a given time can be calculated using the following equation, where i equals the current time unit. In one embodiment, because some solid-state drives (SSDs) may have inaccurate clocks, reads using a time-based clock may fluctuate and generate inaccurate data, making accurate prediction difficult. In such embodiments, because the memory subsystem 110 can accurately track how many data units it receives, the embodiment uses a time unit. In one embodiment, the time unit is based on the number of data units received. In another embodiment, in a closed-loop system, the time unit is described as the loop update interval. In one embodiment, the memory subsystem 110 uses a time unit of 2. x , where x is a non-negative integer. For example, the time unit could appear each time 128 (2 7 After each data unit, and after each time unit, the rate is determined. Digital division can utilize more resources and time. The time unit of data units based on powers of 2 allows the memory subsystem 110 to perform division using logical shifts, resulting in faster computation using fewer resources. In other embodiments, the time unit may be based on time (e.g., microseconds) given a precise clock. Therefore, as used herein, "time unit" may refer to a non-traditional time unit (e.g., the number of data units received, the loop update interval, etc.) or a traditional time unit (e.g., microseconds).

[0030] Host iThis represents the number of remaining / not yet written to the superblock by the write cursor (or host write cursor). In one embodiment, this value may be expressed as the percentage of data units that have not yet been written by the host write cursor. For example, when the write cursor has not yet written any data units to the superblock, the value may be expressed as 100% or a normalized value of 1. When the write cursor has written all data units to the superblock, the value may be expressed as 0% or a normalized value of 0.

[0031]

[0032] The following equation uses the number of data units that have not yet been written to the superblock by the host-written cursor in a time unit and the number of data units that have not yet been written to the superblock by the host-written cursor in the previous time unit to calculate the change in the number of remaining data units that will be written to the superblock by the host-written cursor.

[0033]

[0034] The following equation calculates the change in the number of data units received by memory subsystem 110 between two time units in the previous equation, where the value of Host_Data_Unit_Count is the total number of data units received by all write cursors in the multi-cursor environment. For example, if every 128 data units received constitutes one time unit, and memory subsystem 110 performs the check over two consecutive time units, then the value of Delta_Interval is equal to 128. In one embodiment, memory subsystem 110 performs the check over two consecutive time units, and memory subsystem 110 determines the number of data units received between the two time units.

[0035]

[0036] In calculation and The memory subsystem 110 can then use the following equation to calculate the write rate of the write cursor that writes data units to the superblock.

[0037]

[0038] In one embodiment, the garbage collection manager 113 periodically receives feedback from the memory subsystem 110 indicating the value of Host_Rate. In other embodiments, the garbage collection manager 113 receives feedback when the memory subsystem 110 determines that the value of Host_Rate has changed.

[0039] At operation 210, the processing device determines the current target time for filling the first superblock based on the current write rate. After calculating the current write rate of the write cursor, the garbage collection manager 113 can calculate when the superblock will run out of free space (e.g., target time or target fill time), and accordingly, calculate the most recent estimated time when the write cursor will need a new superblock to continue writing data units uninterruptedly. In an embodiment where time is expressed in units of received data units, the value of Time_To_Fill is the predicted number of data units for the write cursor to fill the first superblock. In another embodiment, the value of Time_To_Fill is the predicted amount of time until the write cursor fills the first superblock.

[0040]

[0041] At operation 215, the processing device determines the current garbage collection rate of the set of superblocks designated for garbage collection within the allocated portion of memory based on the current target time of the first superblock.

[0042] In one embodiment, the garbage collection rate at a given time can be calculated using the following equation, where i equals the current time unit, and the time unit can be expressed as a unit of data received. Garbage_Collection i This represents the number of remaining valid data units that have been read from the first garbage-collected read superblock and copied to the second superblock. In one embodiment, the value can be expressed as the percentage of superblocks from which valid data units have been read by the garbage-collected read cursor. For example, when the garbage-collected read cursor has not yet read any valid data units from the first garbage-collected read superblock to the second garbage-collected read superblock, the value can be expressed as 100% or a normalized value of 1. When the garbage-collected read cursor has read all valid data units from the first garbage-collected read superblock to the second garbage-collected read superblock, the value can be expressed as 0% or a normalized value of 0.

[0043]

[0044] The following equation uses the number of data units that the garbage collection read cursor will read into the superblock in a time unit and the number of data units that the garbage collection read cursor will read into the superblock from a previous time unit to calculate the change in the number of remaining data units that will be read by the garbage collection read cursor.

[0045]

[0046] In calculation and Then, the memory subsystem 110 can use the following equation to calculate the read rate of the garbage collection read cursor (e.g., the rate at which valid data units are being copied to the second superblock). When calculating... At that time, the value of Delta_Interval is the same as the value calculated in operation 205 above.

[0047]

[0048] After calculating the read rate of the garbage collection read cursor, the memory subsystem 110 can calculate when (e.g., how many time units prior) all valid data units will be read from the first garbage collection read superblock. In an embodiment where time units are expressed in received data units, the value of Time_To_Empty is the predicted number of data units received before valid data units have been read from the garbage collection read superblock. In another embodiment, the value of Time_To_Empty is the predicted amount of time before valid data units have been read from the garbage collection read superblock.

[0049]

[0050] In one embodiment, to determine the current garbage collection write rate such that an empty superblock is available for the first write cursor before the current target time, the memory subsystem 110 uses the method determined in operation 210. The value as The value and Values ​​(e.g., remaining valid data units used for garbage collection), and calculate The processing device then calculates the current garbage collection write rate based on the current garbage collection read rate. The garbage collection write cursor writes valid data units from the garbage collection read superblock to the superblock at the garbage collection write rate. In one embodiment, the processing device selects a predetermined garbage collection write rate. If the garbage collection write rate is too low (e.g., the free block count is below a threshold), then the processing device selects a higher garbage collection rate.

[0051] In operation 220, the processing device determines, based on the received feedback, whether the first write cursor is writing data units to the first superblock at an updated write rate, which differs from the current write rate. In one embodiment, the processing device receives feedback on the write rate of the first write cursor at periodic intervals. In other embodiments, the processing device receives feedback on the write rate of the first write cursor when the write rate changes. When the write rate does not change, the processing device continues to monitor the feedback. When a change from the first write rate to a second write rate occurs, the process proceeds to operation 225.

[0052] At operation 225, in response to receiving feedback that the first write cursor is writing data units to the first superblock at an updated write rate, the processing device determines the update target time when the first superblock is expected to be filled based on the updated write rate. To calculate the update target time, the processing device utilizes the process described above in operations 205 and 210.

[0053] At operation 230, the processing device modifies the initial garbage collection rate of the set of superblocks designated for garbage collection within the allocated portion of memory to an updated garbage collection rate based on the updated target time of the first superblock. Additionally, the processing device modifies the initial garbage collection rate of the set of superblocks designated for garbage collection based on the number of valid data units in each superblock designated for garbage collection. To calculate the updated garbage collection rate, the processing device utilizes the above process in operation 215. After modifying the initial garbage collection rate to the updated garbage collection rate, the process then returns to operation 220 to continue monitoring feedback indicating changes in the write rate of the first cursor, where the updated write rate, updated garbage collection rate, and updated target time are used as the new current write rate, current garbage collection rate, and current target time, respectively.

[0054] B. Modifying garbage collection based on write cursor rate in a multi-write cursor environment

[0055] In a multi-write cursor environment, the memory subsystem 110 calculates the value of the above equation for each write cursor in the multi-write cursor environment. By periodically calculating the Delta_Host and Delta_Interval of the write cursor, the memory subsystem 110 can detect changes in the Host_Rate of the particular write cursor and further calculate any changes regarding when the superblock associated with the particular write cursor is calculated to be completely filled with write data.

[0056] In one embodiment, determining Data_Units_To_Fill for each write cursor in a multi-cursor environment allows the memory subsystem 110 to effectively maintain QoS. For example, determining Data_Units_To_Fill for each cursor in a multi-cursor environment allows the memory subsystem 110 to determine which of a plurality of write cursors will fill the superblock first, thus requiring a new empty superblock to continue writing. To maintain QoS, the memory subsystem 110 provides a new empty superblock to the write cursor that fills its corresponding superblock first. By determining when a write cursor will need a new empty superblock, the memory subsystem 110 can adjust garbage collection to generate new empty superblocks in an efficient manner. Furthermore, determining when each write cursor will fill its corresponding superblock allows the memory subsystem 110 to determine the order or scheduling in which write cursors will fill the superblock and when they will need a new empty superblock.

[0057] Determining Data_Units_To_Fill for each write cursor in a multi-cursor environment also allows the memory subsystem 110 to identify when a write cursor collision is predicted. A write cursor collision occurs when two or more write cursors will require resources within the collision range (e.g., when two or more write cursors fill their respective superblocks simultaneously or within a predetermined number of time units of each other).

[0058] Figure 3 Graph 300 illustrates the performance of read and write cursors in a memory subsystem according to some embodiments of the present disclosure. Figure 3 As depicted, the x-axis represents time units, where each time unit equals the number of data units received by the memory subsystem 110. In one embodiment, one time unit occurs for every 128 data units received by the memory subsystem 110. Although Figure 3 The instance depicted contains two write cursors, but other instances may contain fewer or more additional write cursors.

[0059] Chart 300 includes a first write cursor 301, a second write cursor 302, and a garbage collection write cursor 303, each representing a superblock percentage up to full, expressed as a normalized percentage value. Each superblock designated for the first write cursor 301, the second write cursor 302, and the garbage collection write cursor 303 initially has 100% space available for writing new data units or for storing valid data units from garbage collection. For example, at point 310, the first write cursor 301 has 70% space in the relevant superblock used for writing data units. Chart 300 also includes a garbage collection read superblock 304, which represents the number of valid data units in the superblock designated for garbage collection, expressed as a normalized percentage value. When the line representing the garbage collection read superblock 304 reaches the x-axis, all valid data units from the specific superblock designated for garbage collection have been written to the new superblock, and the garbage collection manager 113 begins garbage collection on the next superblock designated for garbage collection.

[0060] The first write cursor 301 writes to the first superblock at a first write rate from approximately time 0 to approximately time 19.6 (indicated by reference point 311). As the first write cursor 301 fills the first superblock, the first write cursor 301 continues writing to the second superblock forward from approximately time 19.6 at the first write rate until the first write cursor 301 fills the second superblock.

[0061] The second write cursor 302 writes to the third superblock at a second write rate from approximately time 0 to approximately time 10 (indicated by reference point 312), and while the second write cursor 302 is filling the third superblock, it writes to the fourth superblock from approximately time 10 to approximately time 20 (indicated by reference point 311). While the second write cursor 302 is filling the fourth superblock, the second write cursor 302 continues to write to the fifth superblock at a second write rate from approximately time 20 to approximately time 30 (indicated by reference point 315), and so on.

[0062] like Figure 3As depicted, each superblock designated for garbage collection has an initial valid data unit count of 50%. In other embodiments, the superblocks designated for garbage collection have higher, lower, or varying valid data unit counts. To generate an empty superblock through garbage collection, where the superblocks designated for garbage collection have a 50% valid data unit count, the garbage collection manager 113 must garbage collect two superblocks, since an empty superblock will be used to store valid data units from the two superblocks designated for garbage collection. As another example, to generate two empty superblocks through garbage collection, where the superblocks designated for garbage collection have a 50% valid data unit count, the garbage collection manager 113 must garbage collect four superblocks.

[0063] In one embodiment, the garbage collection manager 113 receives feedback indicating a first write rate for the first write cursor 301 and a second write rate for the second write cursor 302. Based on the first write rate of the first write cursor 301 and the second write rate of the second write cursor 302, the garbage collection manager 113 calculates a first target time 311 for the first write cursor 301 and a second target time 312 for the second write cursor 302 to fill their respective superblocks. In one embodiment, the garbage collection manager 113 uses a reference... Figure 2 The described process determines the first target time 311 and the second target time 312. For example... Figure 3As depicted, the first target time 311 is estimated to occur at approximately time 19.6, while the second target time 312 is estimated to occur at approximately time 10. Garbage collector 113 determines that the second write cursor 302 will fill the third superblock before the first write cursor 301 fills the first superblock. Because garbage collector 113 does not detect any cursor collisions within the collision range of the second target time 312 (e.g., between the first and second write cursors), garbage collector 113 determines a first garbage collection rate based on the second target time 312, such that an empty superblock is ready for use by the second write cursor 302 before the second target time 312. As described above, in order to generate an empty superblock at the second target time 312, garbage collector 113 performs garbage collection on the two superblocks by reading valid data units from both superblocks (e.g., as shown by garbage collection reading superblock 304) and writing valid data units to a new superblock (e.g., as shown by garbage collection write cursor 303). Garbage collection write cursor 303 from approximately time 0 to approximately time 9.6 depicts the garbage collection write rate from time 0 to time 4.8 and from time 4.8 to time 9.6, using valid data units from two garbage collection read superblocks 304 to fill the superblock. This garbage collection results in a net gain from one of the two emptied superblocks being an empty superblock minus the superblock where garbage collection manager 113 writes valid data units.

[0064] After allocating an empty superblock to the second write cursor 302 at approximately time 10, the garbage collection manager 113 resets its calculations and recalculates the first target time 311 for the first write cursor 301 and the second target time 312 for the second write cursor 302. In one embodiment, the garbage collection manager 113 again uses the reference... Figure 2 The described process determines the updated first target time 311 and the updated second target time 312. Figure 3 In this example, garbage collector 113 again determines the first target time for the first write cursor 301 to be approximately at time 19.6. Garbage collector 113 determines the updated second target time 313 for the second write cursor 302 to be approximately at time 20. In one embodiment, garbage collector 113 determines, or indicates, that a cursor collision is expected to occur based on the updated first target time 311 and the updated second target time 313 being within each other's collision range. This indicates that both the first write cursor 301 and the second write cursor 302 are expected to require new resources (e.g., an empty superblock) at approximately the same time.

[0065] In some embodiments, the collision range may be a predetermined range or it may be dynamic. Instances of factors that can affect the dynamic collision range may include one or more of the following: overconfiguration or write amplification, the number of write cursors, the number of garbage collection cursors, NAND bandwidth, NAND erase time, Open NAND Flash Interface (ONFI) bus bandwidth, firmware processing overhead time, error tolerance, host bus write rate behavior, and control loop tolerances and limits.

[0066] Before calculating the first target time 311 for the update of the first write cursor 301 and the second target time 313 for the update of the second write cursor 302, the garbage collection manager 113 continues garbage collection at a previously determined garbage collection rate. The garbage collection manager 113 continues at the previously determined garbage collection rate until it calculates the new target time and determines whether a cursor collision has occurred. In response to detecting the anticipated occurrence of a cursor collision between the first write cursor 301 and the second write cursor 302, at point 314, the garbage collection manager 113 determines a second garbage collection rate and begins garbage collection at the second garbage collection rate. Figure 3 In the example, the garbage collection manager modifies the garbage collection rate from a first garbage collection rate to a second garbage collection rate that is faster than the first garbage collection rate, so that the garbage collection manager can provide an empty superblock to each of the first write cursor 301 and the second write cursor 302 before both the first target time 311 of the update of the first write cursor 301 and the second target time 313 of the update of the second write cursor 302.

[0067] As described above, in order to generate two empty superblocks from a superblock containing 50% valid data units, the garbage collection manager 113 performs garbage collection on the four superblocks by reading valid data units from the four superblocks (e.g., as shown by garbage collection read superblock 304) and writing the valid data units to two new superblocks (e.g., as shown by garbage collection write cursor 303). Garbage collection write cursor 303 from approximately time 9.6 to approximately time 14.4 depicts the garbage collection write rates from time 9.6 to time 12 and from time 12 to time 14.4, which use valid data units from the two garbage collection read superblocks 304 to fill one superblock, thereby freeing up two superblocks (one for valid data moved during garbage collection, and the other for the first or second write cursor). Similarly, garbage collection write cursor 303 from approximately time 14.4 to approximately time 19.2 depicts the garbage collection write rates from time 14.4 to time 16.8 and from time 16.8 to time 19.2, which use valid data units from two garbage collection read superblocks 304 to fill one superblock, thereby freeing up two additional superblocks. This garbage collection results in a net gain from the two empty superblocks out of the four superblocks cleared, minus the two superblocks for which garbage collection manager 113 wrote valid data units.

[0068] After allocating an empty superblock to each of the first write cursor 301 and the second write cursor 302, the garbage collection manager 113 resets its calculations and recalculates the updated first target time for the first write cursor 301 and the updated second target time for the second write cursor 302. Figure 3 In this instance, when the first target time of the update of the first write cursor 301 occurs outside the graph, the garbage collection manager 113 determines the second target time of the update of the second write cursor 302 to be approximately at time 30, indicated by reference point 315. Because no cursor collision is detected or indicated within the collision range of the second target time 315 of the update of the second write cursor 302, the garbage collection manager 113 determines a third garbage collection rate based on the updated second target time 315, such that an empty superblock is ready for use by the second write cursor 302 before the second target time 315.

[0069] As described above, garbage collection manager 113 continues garbage collection at a previously determined second garbage collection rate until it calculates a new target time and determines whether a cursor collision has occurred. In this example, before performing a new calculation after time 20, garbage collection manager 113 performs garbage collection at the second garbage collection rate (e.g., assuming writing to the cursor would result in a collision and an empty superblock is required). After performing a new calculation and determining that a cursor collision is unlikely, garbage collection manager 113 determines a third garbage collection rate and begins garbage collection at the third garbage collection rate at approximately point 316. Figure 3 In the example shown, the third garbage collection rate is slower than the second garbage collection rate because the garbage collection manager 113 determines that the second write cursor 302 only needs an empty superblock.

[0070] C. Prioritize waste collection

[0071] Garbage collection manager 113 performs a garbage collection advance process to partially estimate the workload of performing garbage collection. In one embodiment, garbage collection manager 113 performs the garbage collection advance process when garbage collection clears a superblock, allocates a new empty superblock to a write cursor, or detects a cursor collision.

[0072] Figure 4 This is a flowchart 400 illustrating an example method for performing a garbage collection prior process according to some embodiments of the present disclosure. The method in flowchart 400 can be executed by processing logic, which may include hardware (e.g., processing device, circuitry, dedicated logic, programmable logic, microcode, device hardware, integrated circuits, etc.), software (e.g., instructions that run or execute on the processing device), or a combination thereof. In some embodiments, the method in flowchart 400 is performed by… Figure 1 The garbage collection manager 113 or one or more sub-components of the garbage collection manager 113 execute the process. Although shown in a specific order or sequence, the order of the processes can be modified unless otherwise stated. Therefore, the illustrated embodiments should be understood as examples only, and the illustrated processes can be executed in different orders, and some processes can be executed in parallel. In addition, one or more processes may be omitted in various embodiments. Therefore, not all processes are required in each embodiment. Other process flows are also possible.

[0073] At operation 405, the processing device determines the average effective data unit count of the set of superblocks designated for garbage collection. In one embodiment, the processing device performs a garbage collection prioritization process by selecting one or more garbage collection read superblocks (e.g., moving a garbage collection write superblock to a designated superblock with effective data units). The processing device selects one or more superblocks from the set of garbage collection read superblocks and determines their characteristics (including their respective effective data unit counts), and calculates the average effective data unit count of the selected one or more garbage collection read superblocks. In one embodiment, the processing device randomly selects one or more superblocks from a set of garbage collection read superblocks to perform the calculation. In another embodiment, the processing device determines all garbage collection read superblocks in the selection queue to perform the calculation.

[0074] At operation 410, the processing device calculates the average garbage collection rate requirement for the set of superblocks based on the average valid data unit count. The processing device calculates the average garbage collection rate requirement for each superblock. In one embodiment, the processing device determines the number of superblocks required to store valid data units from the superblocks designated for garbage collection, and provides at least one empty superblock to each write cursor that writes new data units (which requires a new empty superblock). For example, if the average valid data unit count of the selected superblock is 50%, then the average garbage collection rate requirement is 2, for example, requiring the average of two garbage collection read superblocks to generate an empty superblock that can be used to write new data units by the write cursor. The processing device copies 50% of the valid data units from the first garbage collection read superblock and 50% of the valid units from the second garbage collection read superblock to an empty superblock (filled superblock) and erases both garbage collection read superblocks, thereby generating a net empty superblock.

[0075] At operation 415, the processing device selects multiple superblocks from the set of superblocks based on the average garbage collection rate requirement. In this example, given the average of two garbage collection reads of superblocks in the previous example to generate an empty superblock, the processing device selects the first two superblocks from the set of superblocks designated for garbage collection.

[0076] At operation 420, the processing device determines the average effective data unit count for a selected number of superblocks from the superblock set to calculate the instantaneous garbage collection rate requirement for the selected number of superblocks. The instantaneous garbage collection rate requirement is the actual garbage collection requirement for the selected number of garbage-collected read superblocks based on their average effective data unit counts. Continuing the example, the processing device analyzes the characteristics of the first two garbage-collected read superblocks in the queue to determine the average effective data unit counts of the first two garbage-collected read superblocks. Assuming the first two garbage-collected read superblocks have an average data unit count of 50%, the instantaneous garbage collection rate requirement is 2 (e.g., two garbage-collected read superblocks are needed to generate an empty superblock), thus matching the calculated average garbage collection rate.

[0077] In another example, assuming the average data unit count of the first two garbage-collected read superblocks is 75%, the processing device determines four instantaneous garbage collection rate requirements (e.g., four garbage-collected read superblocks are needed to generate one empty superblock for the write cursor, and three superblocks from the four garbage-collected read superblocks for valid data units). The processing device copies 75% of the valid data units from the four garbage-collected read superblocks to the three empty superblocks (filling the three superblocks) and erases the four garbage-collected read superblocks, thereby generating a net empty superblock. In this case, the instantaneous garbage collection rate requirement differs from the average garbage collection rate requirement determined above in operation 415.

[0078] D. Waste collection in a closed-loop system

[0079] Using a closed-loop system to perform waste collection allows the results of the waste collection process to be fed back to the closed-loop controller as feedback. This allows the closed-loop controller to adjust the waste collection process based on the actual results.

[0080] Figure 5 This is a block diagram of a closed-loop garbage collection architecture 500 according to some embodiments of the present disclosure. In one embodiment, the closed-loop garbage collection architecture 500 is... Figure 1 The garbage collection manager 113. (For example) Figure 5 As described, the closed-loop waste collection architecture 500 includes a write cursor 510, a write cursor sensor 520, a target selector 530, a loop feedback calculation 540, a waste collection status manager 550, a closed-loop controller 560, and a waste collection unit 570.

[0081] The closed-loop controller 560 includes a comparator 562 and a loop filter 564. The closed-loop controller 560 determines the garbage collection rate for the garbage collection process and adjusts the determined garbage collection rate after each loop update interval. For example, the closed-loop controller 560 may determine a garbage collection rate of ten data units per loop update interval (e.g., writing ten valid data units from data read from a garbage collection superblock to another superblock within the loop update interval).

[0082] Comparator 562 receives two inputs, a target, and feedback, and generates an output based on the two inputs. Comparator 562 generates a raw garbage collection rate as its output. After each loop update interval, comparator 562 generates a raw garbage collection rate based on the target from target selector 530 and negative loop feedback 547 (e.g., the time required when an empty superblock is needed). Negative loop feedback 547 is based on the garbage collection process and the result of loop feedback calculation 540 (described below).

[0083] Loop filter 564 limits bandwidth or otherwise slows down the rate of change of the output of comparator 562 by passing the raw garbage collection rate through a filter. For example, after each loop update interval, loop filter 564 filters the raw garbage collection rate to prevent spikes or large changes in the garbage collection rate. In one embodiment, loop filter 564 is a finite impulse response (FIR) filter or a low-pass filter.

[0084] The garbage collection unit 570 includes a random error component 572 and a speed-controlled garbage collection operation component 574. The random error component 572 is an input to the garbage collection process and includes delays caused by instructions from a controller (e.g., controller 115) to perform other operations.

[0085] The accelerometer garbage collection operation component 574 is a garbage collection controller that manages the garbage collection process by sending instructions to the garbage collection read and write cursors to execute the garbage collection process at a rate specified by the closed-loop controller 560. For example, the accelerometer garbage collection operation component 574 sends instructions to the garbage collection read superblock 582 and the garbage collection write cursor 584 to execute the garbage collection process at a garbage collection rate determined by the closed-loop controller 560 and optionally modified by the random error component 572.

[0086] Write cursor 510 includes host write superblock monitor 512 and host stream superblock monitors 514A-N. In one embodiment, host write superblock monitor 512 is associated with a default host write cursor. Host write superblock monitor 512 may be included within host stream superblock monitors 514A-N. Each of host write superblock monitor 512 and host stream superblock monitors 514A-N monitors the corresponding write cursor and maintains the number of remaining data units to be written by the corresponding write cursor. Each write cursor sensor 520 detects the number of remaining data units to be written by the corresponding write cursor from its host write superblock monitor. For example, write cursor sensor 522 detects the number of remaining data units to be written for the write cursor associated with host write superblock monitor 512, write cursor sensor A 524A detects the number of remaining data units to be written for the write cursor associated with host stream A superblock monitor 514A, and so on. Write cursor sensor 520 also determines or accesses information indicating the write rate at which each write cursor 510 is writing data units. The write cursor sensor 520 can read the corresponding write cursor after each loop update interval and calculate the change in the number of remaining data units to be written and the rate of change of the number of remaining data units to be written between the previous read and the current read. In one embodiment, the write cursor sensor 520 is used in... Figure 2 The procedure described in operation 205 determines the write rate of the write cursor.

[0087] In one embodiment, each write vernier sensor 522 and 524A-N includes a discontinuity filter (not shown). In such embodiments, the discontinuity filter compensates for the results from write vernier sensor 520. For example, when the write vernier associated with write vernier sensor A 524A fills a first superblock and acquires an empty second superblock, the value detected by write vernier sensor A 524A jumps from 0% to 100%. To compensate for the discontinuity, when write vernier sensor A 524A detects a new free empty superblock, write vernier sensor A 524A sends the previous value to target selector 530, instead of the actual current value updated by one or more loops.

[0088] Target selector 530 is configured to determine the target of the waste collection process sent to comparator 562 of closed-loop controller 560. Target selector 530 includes a cut-off calculation and filtering component 532. The cut-off calculation and filtering component 532 is configured to perform calculations using information received by target selector 530 from write cursor sensor 520 (e.g., write rate, number of data units to be written, etc.) to determine when each write cursor will fill its current superblock and require a new empty superblock to continue writing data units without interruption. In one embodiment, the cut-off calculation and filtering component 532 uses... Figure 2 The process described in Operation 210 determines the target time for each write cursor.

[0089] Loop feedback calculation 540 may include an effective counting and rate calculation component 541, an idle superblock count integrator 542, an erase time and tolerance compensator 543, a vernier collision detector (or write vernier collision detector) 544, and a garbage collection read-ahead compensator 545, which feeds all information to a closed-loop error calculation component 546, which generates negative loop feedback 547 sent to comparator 562. In one embodiment, each of the inputs to the closed-loop error calculation component 546 is a loop error term for an individual aspect of addressing the closed loop. In one embodiment, one or both of the effective counting and rate calculation component 541 and the vernier collision detector 544 may be components of a target selector 530. In such an embodiment, the target selector 530 uses information from the effective counting and rate calculation component 541 and / or the vernier collision detector 544 to modify the target sent to comparator 562 of the closed-loop controller 560.

[0090] In one embodiment, the components of the loop feedback calculation 540 receive input from the components of the waste collection status manager 550. For example, the effective counting and rate calculation component 541 may receive input from the waste collection superblock pipeline 554, the idle superblock count integrator 542 may receive input from the idle superblock count 551, and the erase time and tolerance compensator 543 may receive input from the erase time plus adjustable tolerance 552.

[0091] The effective count and rate calculation component 541 determines the average pipeline garbage collection rate based on the garbage collection superblock pipeline 554. The average pipeline garbage collection rate is the average effective data unit count (based on the number of data units or a percentage of the total data units) of all garbage collection superblocks or subsets of all garbage collection superblocks in the garbage collection superblock pipeline 554. In one embodiment, the effective count and rate calculation component 541 determines the average effective count of garbage collection read superblocks. In one embodiment, the effective count and rate calculation component 541 determines the average pipeline garbage collection rate based on the average effective count when performing a garbage collection process, and further adjusts the average pipeline garbage collection rate based on the actual effective count of the actual garbage collection read superblocks. For example, if the average count of all garbage collection read superblocks or subsets of them in the garbage collection superblock pipeline 554 is 50%, and the actual or instantaneous effective count of the first garbage collection read superblock in the garbage collection superblock pipeline 554 is 25%, then the effective count and rate calculation component 541 adjusts the average pipeline garbage collection rate to a lower rate. Conversely, if the average effective count is lower than the instantaneous effective count, then the effective count and rate calculation component 541 adjusts the average pipeline waste collection rate to a higher rate.

[0092] The idle superblock counter integrator 542 calculates the error rate of closed-loop garbage collection (e.g., the difference between the number of idle superblocks generated based on the garbage collection rate and the required number of idle superblocks). The idle superblock counter integrator 542 calculates an integral value of the difference between the number of idle superblocks generated based on the garbage collection rate determined by the closed-loop controller 560 in the previous loop update interval and the required number of idle superblocks. In one embodiment, the idle superblock counter integrator 542 calculates a new integral value after each loop update interval. For example, assuming the target selector 530 determines that three idle superblocks are needed to satisfy the target time for writing to the cursor, after a loop update, the idle superblock counter integrator 542 determines the error (e.g., whether the current count of idle superblocks is below or above the requirement). If the instantaneous error after a loop update is 0.2, then using gain and bandwidth factors, the idle superblock counter integrator 542 converts the instantaneous error into a mathematical integrator value. If the instantaneous error is 0.3 after the next loop update, then the idle superblock counter integrator 542 integrates the previous mathematical integrator value with the new instantaneous error value and stores the new mathematical integrator value. In one embodiment, the idle superblock counter integrator 542 receives input from the idle superblock counter 551 indicating the current count of idle superblocks.

[0093] The erase time and tolerance compensator 543 can be configured to establish an amount of time prior to a target time when the write cursor will require more resources (e.g., an idle empty superblock) to transfer the next idle empty superblock. This amount of time may also be referred to as the adjustable empty superblock transfer time. The value generated by the erase time and tolerance compensator 543 can increase or decrease the amount of time between when the write cursor requires an idle empty superblock and when the idle empty superblock is actually ready and transferred. In one embodiment, the erase time and tolerance compensator 543 determines the amount of time based on an external input from the erase time + adjustable tolerance 552. The erase time value is the amount of time (e.g., one millisecond) to erase all data units from the superblock after the garbage collection process of the superblock is completed. Therefore, the minimum value of the erase time and tolerance compensator 543 is equal to the erase time (in order to provide an idle empty superblock for the write cursor without interrupting the write operation of the write cursor). However, the amount of time can be increased based on the adjustable tolerance portion from the erase time + adjustable tolerance 552. In one embodiment, the erase time and tolerance compensator 543 feeds external input (e.g., numerical values) to the closed-loop error calculation component 546 without modification. In other embodiments, the erase time and tolerance compensator 543 converts the value received from the erase time plus adjustable tolerance 552 into the number of host TUs written. Depending on system complexity and current conditions, the erase time can be a static or dynamic number. For example, the erase time can represent how long it takes to erase the worst-case die, the average erase time for all dies, or it can be customized for each die in the system.

[0094] The cursor collision detector 544 can detect whether two or more write cursors will be within each other's collision range (e.g., when two or more write cursors are simultaneously or as described above). Figure 3 Resources are required when filling their respective superblocks within pre-established adjacent time intervals. In one embodiment, the intercept calculation and filtering component 532 determines the target time for each write cursor and sends the target time to the cursor collision detector 544. In such embodiments, the cursor collision detector 544 identifies the write cursor with the earliest target time and determines whether any other write cursor is predicted to follow the write cursor with the earliest target time with a corresponding target time within the collision range. The cursor collision detector 544 provides information about any predicted collisions to the closed-loop error calculation component 546. The closed-loop error calculation component 546 incorporates the information about any predicted collisions into the negative loop feedback 547 of the comparator 562.

[0095] The garbage collection read-ahead compensator 545 can be configured to compensate for changes to the garbage collection read superblock and garbage collection write superblock during the garbage collection process. The garbage collection read-ahead compensator 545 receives data from the garbage collection read sensor 586 and the garbage collection write vernier sensor 588.

[0096] Garbage collection read sensor 586 collects data on garbage collection read superblock 582 (e.g., the current garbage collection read superblock on which garbage collection is being performed, as instructed by rate-controlled garbage collection operation 574). For example, garbage collection read sensor 586 collects data indicating the count (e.g., the number of valid data units or the percentage of total remaining data units) of valid data units to be read from garbage collection read superblock 582 and written to another superblock by garbage collection write cursor 584. Garbage collection read sensor 586 is also configured to detect when changes to the memory are made that could affect garbage collection. For example, if a user deletes or rewrites a file that has data units in the current garbage collection read superblock 582, the deleted or rewritten data units are invalidated and should not be copied to another superblock by garbage collection write cursor 584. As a result, the garbage collection process for that superblock takes less time than estimated when the garbage collection rate was set. In another instance, the garbage collection read sensor 586 can detect a fine-tuning operation in which the operating system indicates that certain stored files or data are no longer needed and are no longer valid data, and that such files or data can be ignored during the garbage collection process.

[0097] Garbage collection write cursor sensor 588 monitors the performance of garbage collection write cursor 584, including the write rate of garbage collection write cursor 584, and when garbage collection write cursor 584 will consume its current resources (e.g., the current garbage collection write superblock) and require a new garbage collection write superblock.

[0098] In one embodiment, the garbage collection read sensor 586 and the garbage collection write vernier sensor 588 each include a discontinuity filter. In such embodiments, the discontinuity filter compensates for the results from the sensors. For example, when the garbage collection write vernier 584 fills a superblock and acquires a new empty superblock, the value detected by the garbage collection write vernier sensor 588 jumps from 0% to 100%. To compensate for the discontinuity, when the garbage collection write vernier sensor 588 detects that a new free empty superblock has been allocated to the garbage collection write vernier 584, the garbage collection write vernier sensor 588 sends the previous value to the garbage collection read advance compensator 545 instead of the actual current value.

[0099] The loop feedback calculation component 540 provides its respective information to the closed-loop error calculation component 546. The closed-loop error calculation component 546 processes inputs from the effective count and rate calculation component 541, the idle superblock count integrator 542, the erase time and tolerance compensator 543, the vernier collision detector 544, and the waste collection read-ahead compensator 545 to generate negative loop feedback 547. In one embodiment, the closed-loop error calculation component 546 adds the terms generated by the effective count and rate calculation component 541, the idle superblock count integrator 542, the erase time and tolerance compensator 543, the vernier collision detector 544, and the waste collection read-ahead compensator 545 to generate negative loop feedback 547. The closed-loop error calculation component 546 sends the negative loop feedback 547 as feedback to adjust the waste collection rate to the comparator 562 in the closed-loop controller 560.

[0100] In one embodiment, negative loop feedback is used to provide a smoother transition when there is a change or adjustment to the garbage collection rate. For example, in Figure 3 In the diagram, at point 314, the closed-loop garbage collection architecture 500 implements a smooth transition from the first garbage collection rate to the second garbage collection rate. Similarly, at point 316, the closed-loop garbage collection architecture 500 implements a smooth transition from the second garbage collection rate to the third garbage collection rate. Sudden changes in garbage collection rates and garbage collection rates that result in poor overhead (e.g., prematurely generated empty superblocks) waste system resources, leading to poor QoS. Conversely, smooth transitions between garbage collection rates enable the memory subsystem 110 to provide stable QoS.

[0101] The garbage collection status manager 550 includes the aforementioned idle superblock count 551, erase time + adjustable tolerance 552, and garbage collection superblock pipeline 554. The garbage collection status manager 550 optionally includes an emergency assistant control 553. The emergency assistant control 553 is a management control for handling initialization errors and optimizing the closed-loop garbage collection system. In one embodiment, the emergency assistant control 553 provides a way for an advanced system controller (e.g., controller 115) to evaluate other system components to provide an operating environment for the closed-loop system. In some embodiments, optimization includes: performing a "reset" at system startup or in response to the garbage collection system erratically or unexpectedly, "stopping" during system error handling operations or power outages, and "maintaining the current rate" during system error handling operations.

[0102] Figure 6This is a flowchart illustrating an example method for performing a garbage collection process in a closed-loop system according to some embodiments of the present disclosure. Method 600 can be executed by processing logic, which may include hardware (e.g., processing device, circuitry, dedicated logic, programmable logic, microcode, device hardware, integrated circuits, etc.), software (e.g., instructions that run or execute on the processing device), or a combination thereof. In some embodiments, method 600 is performed by… Figure 5 The closed-loop controller 560 or one or more sub-components of the closed-loop controller 560 execute the process. Although shown in a specific order or sequence, the order of the processes can be modified unless otherwise stated. Therefore, the illustrated embodiments should be understood as examples only, and the illustrated processes can be executed in different orders, and some processes can be executed in parallel. In addition, one or more processes may be omitted in various embodiments. Therefore, not all processes are required in each embodiment. Other process flows are also possible.

[0103] At operation 605, the processing device receives a first target time. For example, a comparator in a closed-loop waste collection system receives the first target time from a target selector (e.g., target selector 530). The first target time indicates when a first superblock of memory is expected to be filled based on a first write rate that writes data units to the first superblock using a first write cursor. By the first target time, the first write cursor will require an empty superblock to continue writing data units without interruption. In one embodiment, the comparator receives the first target time at a first input. As described above, the target selector determines the first target time based on information received from one or more write cursor sensors (e.g., write cursor sensors 522 and 524A-N).

[0104] use Figure 3 In one instance, after the first loop update interval, the target selector can select target time 312 as the first target time because the target time is associated with the earliest write cursor (write cursor 302) that needs resources (idle empty superblock).

[0105] At operation 610, the processing device receives negative loop feedback. This negative loop feedback may be generated based on one or more of the following: a count of the number of valid data units in the first garbage collection superblock selected for the garbage collection process (e.g., from the valid count and rate calculation component 541); an integral value of the difference between the number of free empty superblocks generated based on the garbage collection rate and the required number of free empty superblocks (e.g., from the free superblock calculation integrator 542); an adjustable free superblock transfer time (e.g., from the erase time and tolerance compensator 543); data indicating whether two or more write cursors are predicted or indicated to require new resources within each other's collision range (e.g., from the cursor collision detector 544); and data indicating data fine-tuning and / or user failure (e.g., from the garbage collection read ahead compensator 545). In one embodiment, the comparator receives negative loop feedback at a second input different from the first input (e.g., from the garbage collection read ahead compensator 545).

[0106] At operation 615, the processing device determines a first garbage collection rate based on a first target time and negative loop feedback. Continuing the example, the comparator calculates the first garbage collection rate to provide free empty superblocks to the first write cursor within the time range of the first target time. In one embodiment, the garbage collection rate indicates the number of valid data units read from the garbage collection read superblock and written to the garbage collection write superblock within a single loop update interval. Continuing Figure 3 In this instance, the comparator determines the garbage collection rate so that free empty superblocks can be made available to write cursor 302 before the target time 312.

[0107] At operation 620, the processing device sends an instruction to the garbage collection manager to perform a garbage collection process at a first garbage collection rate. Continuing the example, in one embodiment, the comparator sends the instruction via a filter that generates a modified first garbage collection rate that is sent to the garbage collection manager. As described above, after a loop update interval, the results of the garbage collection process are incorporated back into the negative loop feedback sent to the comparator.

[0108] Figure 7 An example machine is shown as a computer system 700, within which a set of instructions is executable to cause the machine to perform any or more of the methods discussed herein. In some embodiments, computer system 700 may correspond to a host system (e.g., Figure 1 The host system 120 includes, is coupled to, or utilizes a memory subsystem (e.g., Figure 1 The memory subsystem 110), or may be used to perform controller operations (e.g., to execute an operating system thereby executing commands corresponding to...). Figure 1(Operation of the garbage collection manager 113). In alternative embodiments, the machine may be connected (e.g., via a network connection) to other machines in a LAN, intranet, extranet, and / or the Internet. The machine may operate as a server or client in a client-server network environment, as a peer-to-peer machine in a peer-to-peer (or distributed) network environment (e.g., the peer-to-peer network described herein), or as a server or client in a cloud computing infrastructure or environment.

[0109] The machine may be a personal computer (PC), tablet PC, set-top box (STB), personal digital assistant (PDA), cellular phone, web application, server, network router, switch, or bridge, or any machine capable of executing a set of instructions (sequentially or otherwise) specifying the actions the machine will take. Furthermore, although a single machine is shown, the term "machine" should also be understood to include any set of machines that individually or jointly execute a set (or sets) of instructions to perform any or more of the methods discussed herein.

[0110] The example computer system 700 includes a processing device 702, a main memory 704 (e.g., read-only memory (ROM), flash memory, dynamic random access memory (DRAM) such as synchronous DRAM (SDRAM) or Rambus DRAM (RDRAM), static memory 706 (flash memory, static random access memory (SRAM), etc.), and a data storage system 718, all of which communicate with each other via a bus 730.

[0111] Processing device 702 represents one or more general-purpose processing devices, such as microprocessors, central processing units, etc. More specifically, the processing device may be a Complex Instruction Set Computing (CISC) microprocessor, a Reduced Instruction Set Computing (RISC) microprocessor, a Very Long Instruction Word (VLIW) microprocessor, or a processor implementing other instruction sets, or a processor implementing combinations of instruction sets. Processing device 702 may also be one or more special-purpose processing devices, such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), network processors, etc. Processing device 702 is configured to execute instructions 726 for performing the operations and steps discussed herein. Computer system 700 may also include a network interface device 708 that communicates via network 720.

[0112] Data storage system 718 may include machine-readable storage medium 724 (also referred to as computer-readable medium) on which one or more sets of instructions 726 or software embodying any one or more of the methods or functions described herein are stored. During execution by computer system 700, main memory 704, and processing device 702, which also constitute machine-readable storage media, the instructions 726 may also reside wholly or at least partially in main memory 704 and / or in processing device 702. Machine-readable storage medium 724, data storage system 718, and / or main memory 704 may correspond to… Figure 1 The memory subsystem 110.

[0113] In one embodiment, instruction 726 includes implementing a garbage collection manager (e.g., Figure 1 The machine-readable storage medium 724 is shown as a single medium in the exemplary embodiment, but the term "machine-readable storage medium" should be considered to include a single medium or multiple media storing one or more sets of instructions. The term "machine-readable storage medium" should also be considered to include any medium capable of storing or encoding a set of instructions for execution by a machine and causing the machine to perform any or more of the methods of this disclosure. Therefore, the term "machine-readable storage medium" should be considered to include, but is not limited to, solid-state memory, optical media, and magnetic media.

[0114] Regarding the algorithms and symbolic representations of operations on data bits within computer memory, some parts have already been described in detail above. These algorithmic descriptions and representations are the most effective way for those skilled in the art of data processing to communicate the essence of their work to others skilled in the art. Algorithms here are generally considered to be self-consistent sequences of operations that lead to desired results. These operations are those that require physical manipulation of physical quantities. Typically, although not always necessary, these quantities take the form of electrical or magnetic signals that can be stored, combined, compared, and otherwise manipulated. It has proven convenient, sometimes primarily for general reasons, to refer to these signals as bits, values, elements, symbols, characters, items, numbers, etc.

[0115] However, it should be remembered that all these and similar terms are to be associated with appropriate physical quantities and are merely convenient notations applied to those quantities. This disclosure may relate to the operation and processes of a computer system or similar electronic computing device that manipulates data represented as physical (electronic) quantities in the registers and memories of the computer system and converts said data into other data similarly represented as physical quantities in the computer system's memory or registers or other such information storage systems.

[0116] This disclosure also relates to an apparatus for performing the operations described herein. This apparatus may be specifically constructed for its intended purpose, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in a computer. For example, a computer system or other data processing system, such as controller 115, may perform computer-implemented methods 200, 400, and 600 in response to its processor executing a computer program (e.g., a sequence of instructions) contained in memory or other non-transitory machine-readable storage medium. Such a computer program may be stored in a computer-readable storage medium, such as, but not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, and magneto-optical disks, read-only memory (ROM), random access memory (RAM), EPROM, EEPROM, magnetic or optical cards, or any type of medium suitable for storing electronic instructions, each of which is coupled to a computer system bus.

[0117] The algorithms and displays presented herein are not inherently related to any particular computer or other device. Various general-purpose systems can be used with the programs taught herein, or it can be demonstrated that it is convenient to construct more specialized devices to perform the methods. The structures of various such systems will appear in the description below. Furthermore, this disclosure is described without reference to any particular programming language. It should be understood that the teachings of this disclosure as described herein can be implemented using various programming languages.

[0118] This disclosure may be provided as a computer program product or software, which may include a machine-readable medium having instructions stored thereon, the instructions being usable to program a computer system (or other electronic device) to perform processes according to this disclosure. A machine-readable medium includes any mechanism for storing information in a machine-readable (e.g., computer-readable) form. In some embodiments, a machine-readable (e.g., computer-readable) medium includes a machine-readable (e.g., computer-readable) storage medium, such as a read-only memory (“ROM”), random access memory (“RAM”), disk storage medium, optical storage medium, flash memory components, etc.

[0119] In the foregoing description, embodiments of the present disclosure have been described with reference to specific exemplary embodiments. It will be apparent that various modifications can be made to the embodiments of the present disclosure without departing from the broader spirit and scope set forth in the appended claims. Therefore, the description and drawings are to be considered illustrative rather than restrictive.

Claims

1. A method for waste collection, comprising: A first target time is received at the comparator in the closed-loop waste collection system. The first target time indicates when the first write rate, which writes data units to a first superblock of memory based on a first write cursor, is expected to fill the first superblock. Negative loop feedback is received at the comparator; The comparator determines a first garbage collection rate based on the first target time and the negative loop feedback. The first garbage collection rate is calculated to provide free empty superblocks to the first write cursor within the time range of the first target time. Send an instruction to the garbage collection manager to perform a garbage collection process at the first garbage collection rate, wherein the result of the garbage collection process is incorporated into the negative loop feedback sent to the comparator; The comparator receives from the write cursor collision detector an indication that the second target time is within the collision range of the first target time, the second target time indicating when the second superblock is expected to be filled based on the second write rate of writing data units to the second superblock using the second write cursor; as well as The first garbage collection rate is modified to a second garbage collection rate based on the first target time and the second target time, so as to provide a first empty superblock to the first write cursor before the first target time and a second empty superblock to the second write cursor before the second target time.

2. The method of claim 1, wherein the negative loop feedback comprises an integral value of the difference between the number of free empty superblocks generated based on the first garbage collection rate and the number of required free empty superblocks.

3. The method of claim 1, wherein the negative loop feedback includes an adjustable empty superblock transfer time, the adjustable empty superblock transfer time indicating a first amount of time prior to the first target time of transferring the first empty superblock to the first write cursor, and wherein the adjustable empty superblock transfer time includes a second amount of time for erasing the data unit from the first garbage collection superblock to generate the first empty superblock.

4. The method of claim 1, wherein determining the first waste collection rate based on the first target time and the negative loop feedback further comprises: Calculate the initial waste collection rate; as well as The original garbage collection rate is sent through a loop filter to generate the first garbage collection rate.

5. The method of claim 1, wherein the negative loop feedback comprises a count of the number of valid data units in a first garbage collection superblock selected for the garbage collection process.

6. The method of claim 5, wherein the first waste collection superblock is selected from the pipeline of the waste collection superblock for the waste collection process.

7. A non-transitory computer-readable medium storing instructions, which, when executed by a processing means, cause the processing means to: A first target time is received at the comparator in the closed-loop waste collection system. The first target time indicates when the first write rate, which writes data units to a first superblock of memory based on a first write cursor, is expected to fill the first superblock. Negative loop feedback is received at the comparator; The comparator determines a first garbage collection rate based on the first target time and the negative loop feedback. The first garbage collection rate is calculated to provide free empty superblocks to the first write cursor within the time range of the first target time. Send an instruction to the garbage collection manager to perform a garbage collection process at the first garbage collection rate, wherein the result of the garbage collection process is incorporated into the negative loop feedback sent to the comparator; The comparator receives from the write cursor collision detector an indication that the second target time is within the collision range of the first target time, the second target time indicating when the second superblock is expected to be filled based on the second write rate of writing data units to the second superblock using the second write cursor; as well as The first garbage collection rate is modified to a second garbage collection rate based on the first target time and the second target time, so as to provide a first empty superblock to the first write cursor before the first target time and a second empty superblock to the second write cursor before the second target time.

8. The non-transitory computer-readable medium of claim 7, wherein the negative loop feedback comprises an integral value of the difference between the number of free empty superblocks generated based on the first garbage collection rate and the number of required free empty superblocks.

9. The non-transitory computer-readable medium of claim 7, wherein the negative loop feedback includes an adjustable empty superblock transfer time, the adjustable empty superblock transfer time indicating a first amount of time prior to the first target time of transferring the first empty superblock to the first write cursor, and wherein the adjustable empty superblock transfer time includes a second amount of time for erasing the data unit from the first garbage collection superblock to generate the first empty superblock.

10. The non-transitory computer-readable medium of claim 7, wherein determining the first garbage collection rate based on the first target time and the negative loop feedback further comprises: Calculate the initial waste collection rate; as well as The original garbage collection rate is sent through a loop filter to generate the first garbage collection rate.

11. The non-transitory computer-readable medium of claim 7, wherein the negative loop feedback comprises a count of the number of valid data units in a first garbage collection superblock selected for the garbage collection process.

12. The non-transitory computer-readable medium of claim 11, wherein the first garbage collection superblock is selected from the pipeline of the garbage collection superblock for the garbage collection process.

13. A system for waste collection, comprising: Multiple memory devices; as well as A processing device, operatively coupled to the plurality of memory devices, to: A first target time is received at the comparator in the closed-loop waste collection system. The first target time indicates when the first write rate, which writes data units to a first superblock of memory based on a first write cursor, is expected to fill the first superblock. Negative loop feedback is received at the comparator; The comparator determines a first garbage collection rate based on the first target time and the negative loop feedback. The first garbage collection rate is calculated to provide free empty superblocks to the first write cursor within the time range of the first target time. Send an instruction to the garbage collection manager to perform a garbage collection process at the first garbage collection rate, wherein the result of the garbage collection process is incorporated into the negative loop feedback sent to the comparator; The comparator receives from the write cursor collision detector an indication that the second target time is within the collision range of the first target time, the second target time indicating when the second superblock is expected to be filled based on the second write rate of writing data units to the second superblock using the second write cursor; as well as The first garbage collection rate is modified to a second garbage collection rate based on the first target time and the second target time, so as to provide a first empty superblock to the first write cursor before the first target time and a second empty superblock to the second write cursor before the second target time.

14. The system of claim 13, wherein determining the first waste collection rate based on the first target time and the negative loop feedback further comprises: Calculate the initial waste collection rate; as well as The original garbage collection rate is sent through a loop filter to generate the first garbage collection rate.

15. The system of claim 13, wherein the negative loop feedback further comprises counting the number of valid data units in the first garbage collection superblock selected for the garbage collection process.

16. The system of claim 15, wherein the first waste collection superblock is selected from the pipeline of the waste collection superblock for the waste collection process.