CN117850873A - Method for managing memory and control part - Google Patents

Method for managing memory and control part Download PDF

Info

Publication number
CN117850873A
CN117850873A CN202211217892.1A CN202211217892A CN117850873A CN 117850873 A CN117850873 A CN 117850873A CN 202211217892 A CN202211217892 A CN 202211217892A CN 117850873 A CN117850873 A CN 117850873A
Authority
CN
China
Prior art keywords
command
storage
media interface
processing
media
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211217892.1A
Other languages
Chinese (zh)
Inventor
孙明浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Starblaze Technology Co ltd
Original Assignee
Beijing Starblaze Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Starblaze Technology Co ltd filed Critical Beijing Starblaze Technology Co ltd
Priority to CN202211217892.1A priority Critical patent/CN117850873A/en
Publication of CN117850873A publication Critical patent/CN117850873A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a method for managing a memory and a control component, wherein the method comprises the following steps: before processing the media interface command, querying the memory allocator for the current available storage resource status; directly processing the medium interface command according to the query result to generate an access storage medium; or suspending processing of media interface commands; in response to direct processing of the media interface command, not allocating storage resources prior to sending the storage media access command to the storage media, and applying for allocation of storage resources after the storage media processes the storage media access command for a preset period of time; the preset time length is smaller than the time length of the storage medium for processing the storage medium access command to acquire response data; the memory allocator is not queried for the current available memory resource status prior to allocating the memory resource.

Description

Method for managing memory and control part
Technical Field
The present application relates to storage technology, and in particular, to a method of managing memory and a control unit.
Background
FIG. 1A illustrates a block diagram of a solid state storage device. The solid state storage device 102 is coupled to a host for providing storage capability for the host. The host and solid state storage device 102 may be coupled by a variety of means including, but not limited to, connecting the host to the solid state storage device 102 via, for example, SATA (Serial Advanced Technology Attachment ), SCSI (Small Computer System Interface, small computer system interface), SAS (Serial Attached SCSI ), IDE (Integrated Drive Electronics, integrated drive electronics), USB (Universal Serial Bus ), PCIE (Peripheral Component Interconnect Express, PCIE, peripheral component interconnect Express), NVMe (NVM Express), ethernet, fibre channel, wireless communications network, and the like. The host may be an information processing device capable of communicating with the storage device in the manner described above, such as a personal computer, tablet, server, portable computer, network switch, router, cellular telephone, personal digital assistant, or the like. The memory device 102 includes an interface 103, a control unit 104, one or more NVM chips 105, and a DRAM (Dynamic Random Access Memory ) 110.
NAND flash memory, phase change memory, feRAM (Ferroelectric RAM, ferroelectric memory), MRAM (Magnetic Random Access Memory, magnetoresistive memory), RRAM (Resistive Random Access Memory, resistive memory), XPoint memory, etc. are common NVM.
The interface 103 may be adapted to exchange data with a host by way of, for example, SATA, IDE, USB, PCIE, NVMe, SAS, ethernet, fibre channel, etc.
The control unit 104 is used to control data transfer among the interface 103, NVM chip 105, and DRAM 110, and also for memory management, host logical address to flash physical address mapping, erase balancing, bad block management, etc. The control component 104 can be implemented in a variety of ways, such as software, hardware, firmware, or a combination thereof, for example, the control component 104 can be in the form of an FPGA (Field-programmable gate array, field programmable gate array), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), or a combination thereof. The control component 104 may also include a processor or controller in which software is executed to manipulate the hardware of the control component 104 to process IO (Input/Output) commands. Control unit 104 may also be coupled to DRAM 110 and may access data of DRAM 110. FTL tables and/or cached data of IO commands may be stored in the DRAM.
Fig. 1B shows a detailed block diagram of the control components of the storage device.
The host accesses the storage device in IO commands that follow the storage protocol. The control component generates one or more storage commands based on the IO commands from the host and provides the storage commands to the media interface controller. The media interface controller generates storage media access commands (e.g., program commands, read commands, erase commands) that follow the interface protocol of the NVM chip from the storage commands. The control unit also keeps track of all storage commands generated from one IO command being executed and indicates to the host the result of processing the IO command.
Referring to fig. 1B, the control means includes, for example, a host interface, a host command processing unit, a storage command processing unit, a media interface controller (or flash interface controller flash channel controller), and a storage media management unit. The host interface acquires an IO command provided by the host and generates a storage command to be provided to the storage command processing unit. The storage commands, for example, access the same size of storage space, e.g., 4KB. The data unit of the data accessed by the corresponding one of the storage commands recorded in the NVM chip is referred to as a data frame. The physical page records one or more frames of data. For example, a physical page is 17664 bytes in size and a data frame is 4KB in size, and one physical page can store 4 data frames.
The storage medium management unit maintains a logical address to physical address translation for each storage command. For example, the storage medium management unit includes FTL tables. For a read command, the storage medium management unit outputs a physical address corresponding to a logical address accessed by the storage command, for a write command, the storage medium management unit allocates an available physical address to the storage medium management unit, and records a mapping relationship between the logical address accessed by the storage medium management unit and the allocated physical address. The storage medium management unit also maintains functions required to manage the NVM chip, such as garbage collection, wear leveling, etc.
The storage command processing unit operates the medium interface controller to issue a storage medium access command to the NVM chip according to the physical address provided by the storage medium management unit. For the sake of clarity, the commands sent by the storage command processing unit to the media interface controller are referred to as media interface commands, while the commands sent by the media interface controller to the NVM chip are referred to as storage media access commands. The storage medium access command follows the interface protocol of the NVM chip.
In writing or reading data, a memory device needs to apply for a memory resource to cache the data, and the memory resource is provided by a memory such as a DRAM or an SRAM. The memory resources are used to buffer data to be written to or read from the NVM chip.
Disclosure of Invention
As NVM chip capacity increases, so does the required memory resource capacity. However, the storage resources in the actual products have limited capacity, which brings challenges to improving the utilization efficiency of the storage resources. A memory allocator for allocating and freeing memory resources is provided, for example, in chinese patent CN109840150 a.
For example, in order to enable a read command (such as an NVMe read command) sent by a host to be successfully executed, the control unit needs to apply for a storage resource corresponding to the read command in advance before reading data to the NVM chip. While for the operation of reading data, the control section needs to wait a certain time (the NVM chip needs to find data) from sending the storage medium access command to the NVM chip to reading out the data from the NVM chip. Since the applied storage resources are not available for other commands from the time of application to release, this portion of the storage resources is free for this period of time but is not available for other commands. If the NVM chip needs to find data for distributed storage or the data is relatively large, it may take a longer time to find the data, which results in that the storage resources cannot be released for a long time, and the utilization rate of the storage resources is reduced.
For example, if the programming command fails, the programming command is reprogrammed in a specific error handling manner, so that the memory resources corresponding to the programming command are not released. If the operation of a large number of programming commands fails, a large amount of memory resources cannot be released in time, even the pending commands (such as read commands) cannot apply for the memory resources, which results in command blocking, and further affects the performance of the memory device.
According to the embodiment of the application, when the resource is applied for the read command, the medium interface controller is combined with the data searching time of the NVM chip to select a proper time to allocate the memory resource, so that the read command can be successfully processed, the utilization rate of the memory resource can be improved, and the processing performance of the memory device can be improved.
According to a first aspect of the present application, there is provided a method of managing memory according to the first aspect of the present application, the method comprising: in response to receiving a first media interface command and prior to processing the first media interface command, querying a memory allocator for a current available storage resource condition; directly processing the first medium interface command according to the query result to generate at least one storage medium access command, and sending the at least one storage medium access command to a storage medium; or suspending processing of the first media interface command; in response to directly processing the first media interface command, not allocating a storage resource before sending the at least one storage media access command to the storage medium, and applying for allocating the storage resource after a preset duration of processing the at least one storage media access command by the storage medium, wherein the storage resource is used for storing response data of the first media interface command, and the preset duration is less than a duration of processing the at least one storage media access command by the storage medium to acquire the response data; the memory allocator is not queried for the current available memory resource status prior to allocating the memory resource.
According to a first method of managing memory according to a first aspect of the present application, there is provided a second method of managing memory according to the first aspect of the present application, for generating at least one storage medium access command directly for processing the first medium interface command according to a query result, including: and if the query result indicates that the current storage resources are sufficient or the current storage resources are sufficient according to the query result, processing the first medium interface command to obtain at least one storage medium command, and sending the at least one storage medium command to the storage medium.
According to a second method of managing memory according to the first aspect of the present application, there is provided a third method of managing memory according to the first aspect of the present application, wherein if the current storage resources are insufficient, the processing of the first media interface command is suspended.
According to any one of the first to third methods of managing memory of the first aspect of the present application, there is provided a fourth method of managing memory according to the first aspect of the present application, wherein, in response to suspending processing of the first media interface command, execution of a yield microinstruction by a processor core controls coroutine yield corresponding to the first media interface command; in response to the coroutine yield, executing a coroutine schedule by the processor core to wake the yielded coroutine; and re-applying, by the processor core, allocation of the storage resource in response to the yielded coroutine being awakened; if the storage resource is allocated to the storage resource, continuing to process the first media interface command; and if the storage resources are not allocated to the storage resources, the coroutine corresponding to the first media interface command is yielded again.
A method of managing memory according to any one of the first to fourth aspects of the present application provides a fifth method of managing memory according to the first aspect of the present application, comprising: if the processing of the first medium interface command is suspended, applying for the storage resource to the memory distributor, responding to the application of the storage resource, restoring the processing of the first medium interface command, and storing the response data to the storage resource.
According to a fifth method of managing memory of the first aspect of the present application, there is provided a method of managing memory according to the sixth aspect of the present application, wherein in response to not applying for the storage resource, processing of the first media interface command is continued to be suspended.
The method for managing memory according to any one of the first to sixth aspects of the present application provides the seventh method for managing memory according to the first aspect of the present application, wherein the method further includes: and in response to suspending processing of the first media interface command, continuing processing of a second media interface command, wherein the second media interface command is a different media interface command than the first media interface command.
According to a seventh method of managing memory of the first aspect of the present application, there is provided a method of eighth managing memory of the first aspect of the present application, wherein the second media interface command and the first media interface command are media interface commands accessing different or the same logical unit on the same storage medium; or the second medium interface command and the first medium interface command are medium interface commands for accessing logic units on different storage media.
According to a method of managing memory according to a ninth aspect of the present application, there is provided a method of managing memory according to the ninth aspect of the present application, wherein processing of at least one read command sent by a received host is continued to obtain at least one media interface command in response to suspending processing of the first media interface command.
A method of managing memory according to any one of the first to ninth aspects of the present application provides the method of managing memory according to the tenth aspect of the present application, wherein media interface command information for suspending processing is recorded.
According to any one of the first to tenth methods for managing memory in the first aspect of the present application, there is provided the eleventh method for managing memory in the first aspect of the present application, wherein if a media interface command processing is completed, a storage resource corresponding to the media interface command is released.
According to a second aspect of the present application, there is provided a first control component according to the second aspect of the present application, comprising: a memory allocator and at least one media interface controller; each media interface controller obtains a media interface command and inquires the current available storage resource condition from the memory distributor; directly processing the first medium interface command according to the query result to generate at least one storage medium access command, and sending the at least one storage medium access command to a storage medium; or suspending processing of the first media interface command; in response to directly processing the first media interface command, not allocating a storage resource before sending the at least one storage media access command to the storage medium, and applying for allocating the storage resource after a preset duration of processing the at least one storage media access command by the storage medium, wherein the storage resource is used for storing response data of the first media interface command, and the preset duration is less than a duration of processing the at least one storage media access command by the storage medium to acquire the response data; the memory allocator is not queried for the current available memory resource status prior to allocating the memory resource.
According to a first control part of a second aspect of the present application, a second control part according to the second aspect of the present application is provided, wherein the media interface controller determines whether the current storage resource is sufficient according to the query result; if so, processing the medium interface command to obtain at least one storage medium command, and sending the at least one storage medium command to the storage medium.
According to a second control unit of the second aspect of the present application, a third control unit according to the second aspect of the present application is provided, wherein the media interface controller suspends the processing of the media interface command if the current storage resources are insufficient.
According to any one of the first to third control means of the second aspect of the present application, there is provided a fourth control means according to the second aspect of the present application, the media interface controller comprising a media interface, wherein, in response to the current storage resources being sufficient, the storage resources are applied for allocation by the media interface after the storage medium has processed the at least one storage medium access command for a preset period of time.
According to any one of the first to fourth control means of the second aspect of the present application, there is provided a fifth control means according to the second aspect of the present application, wherein if the media interface command processing is suspended, the media interface controller applies for allocation of the storage resource to the memory allocator, resumes the media interface command processing, and stores the response data to the storage resource.
According to any one of the first to fifth control means of the second aspect of the present application, there is provided a sixth control means according to the second aspect of the present application, the media interface controller further comprising a processor core; wherein the allocation of the storage resources is applied for by the processor core in response to suspending processing of the media interface command.
According to a sixth control element of the second aspect of the present application, there is provided a seventh control element of the second aspect of the present application, wherein, in response to suspending processing of the first media interface command, execution of a yield microinstruction by a processor core controls coroutine yield corresponding to the first media interface command; in response to the coroutine yield, executing a coroutine schedule by the processor core to wake the yielded coroutine; and re-applying, by the processor core, allocation of the storage resource in response to the yielded coroutine being awakened; if the storage resource is allocated to the storage resource, continuing to process the first media interface command by the media interface; and if the storage resource is not allocated to the processor core, the processor core re-gives way the coroutine corresponding to the first medium interface command.
According to a first to seventh control means of a second aspect of the present application, there is provided an eighth control means according to the second aspect of the present application, wherein the media interface controller continues processing a second media interface command in response to suspending processing of a first media interface command, wherein the second media interface command is a different media interface command than the first media interface command.
According to an eighth control unit of the second aspect of the present application, there is provided a ninth control unit according to the second aspect of the present application, the second media interface command and the first media interface command being media interface commands accessing different or the same logical unit on the same storage medium; or the second medium interface command and the first medium interface command are medium interface commands for accessing logic units on different storage media.
According to any one of the first to ninth control means of the second aspect of the present application, there is provided a tenth control means according to the second aspect of the present application, the media interface controller including a context, wherein the context records status information of media interface commands being processed by the media interface controller.
According to a tenth control unit of the second aspect of the present application, there is provided an eleventh control unit according to the second aspect of the present application, querying the context to determine a media interface command to suspend processing in response to a storage resource being sufficient, and applying for allocation of the storage resource to the memory allocator to process the media interface command to suspend processing.
According to any one of the first to tenth control means of the second aspect of the present application, there is provided a twelfth control means according to the second aspect of the present application, further comprising: a host command processing unit and a storage command processing unit; in response to suspending processing of the media interface command, the host command processing unit continues processing at least one storage command on a received read command sent by the host; and/or the storage command processing unit continues processing the storage command.
According to a twelfth control unit of the second aspect of the present application, there is provided the thirteenth control unit of the second aspect of the present application, wherein the host command processing unit instructs to release the second storage resource corresponding to the media interface command in response to sending the data to be accessed by the media interface command to the host.
According to a third aspect of the present application, there is provided a media interface controller according to the third aspect of the present application, comprising:
in response to receiving a first media interface command and prior to processing the first media interface command, querying a memory allocator for a current available storage resource condition;
directly processing the first medium interface command according to the query result to generate at least one storage medium access command, and sending the at least one storage medium access command to a storage medium; or suspending processing of the first media interface command;
in response to directly processing the first media interface command, not allocating a storage resource before sending the at least one storage media access command to the storage medium, and applying for allocating the storage resource after a preset duration of processing the at least one storage media access command by the storage medium, wherein the storage resource is used for storing response data of the first media interface command, and the preset duration is less than a duration of processing the at least one storage media access command by the storage medium to acquire the response data; the memory allocator is not queried for the current available memory resource status prior to allocating the memory resource.
According to a fourth aspect of the present application there is provided a memory according to the fourth aspect of the present application comprising: the control section and the storage medium according to the second aspect.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may also be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1A is a block diagram of a prior art memory device;
FIG. 1B illustrates a detailed block diagram of the control components of the storage device;
FIG. 2A illustrates a schematic diagram of a control component provided by an embodiment of the present application;
FIG. 2B is a schematic diagram of a signal set of a read command according to an embodiment of the present application;
FIG. 2C illustrates a schematic diagram of another control component provided by an embodiment of the present application;
FIG. 3A is a schematic view showing a structure of a control unit according to an embodiment of the present application
FIG. 3B illustrates a schematic structure of an NVM chip provided in an embodiment of the present application;
FIG. 3C illustrates a schematic structural diagram of yet another control component provided by an embodiment of the present application;
FIG. 3D illustrates a schematic structural diagram of yet another control component provided by an embodiment of the present application;
FIG. 3E shows a schematic structural view of a further control component according to an embodiment of the present application
Fig. 4 shows a flowchart of a method for managing memory according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application, taken in conjunction with the accompanying drawings, clearly and completely describes the technical solutions of the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Fig. 2A shows a schematic diagram of a control component according to an embodiment of the present application.
By way of example, in FIG. 2A, the control component includes a memory allocator and a media interface controller. In addition, the control section in fig. 2A further includes a host interface, a host command processing unit, a storage command processing unit, and the like (not labeled in fig. 2A) as shown in fig. 1B. The control part receives an NVMe read command sent by a host through a host interface; then, processing the NVMe read command by a host command processing unit to generate a storage command; then, the storage command processing unit processes the storage command to generate a media interface command, and sends the media interface command to the media interface controller. The media interface controller obtains the media interface command, inquires the current available storage resource condition from the memory distributor, and selects a processing mode of the media interface command according to the inquired result. The processing is, for example, to process the media interface command directly to obtain data from the NVM chip or to suspend processing the media interface command.
Also by way of example, the processing of a read command by a media interface controller includes the following stages: the media interface controller queries the memory allocator for the current available storage resource instance, denoted as procedure (2.1). For example, the media interface controller may query the memory allocator as to whether the current storage resources are sufficient; or the medium interface controller inquires the current available storage resource condition from the memory distributor, and judges whether the current storage resource is sufficient according to the inquired result. If so, processing the medium interface command to obtain at least one storage medium command, and sending the at least one storage medium command to the storage medium. Where sufficient means that the current storage resources can meet the storage resources required by the media interface command. If the current storage resources are sufficient, the media interface controller immediately processes the received media interface command to generate at least one storage media access command and sends the at least one storage media access command to the storage media, denoted as procedure (2.2). The stage where the media interface control director processes the media interface command to generate a storage media access command and sends the storage media access command to the storage media is referred to as a command stage hereinafter, and the stage where the media interface controller obtains response data of the media interface command from the NVM chip is referred to as a data stage.
FIG. 2B is a schematic diagram of a signal set of a read command according to an embodiment of the present application.
By way of example, the media interface controller reads data from the NVM chip by issuing storage media access commands (e.g., following ONFI protocols) to the NVM chip. The flash memory channel transmits signals in units of cycles. The signals transmitted by the respective periods have different meanings, and the meaning of the signals transmitted by the respective periods is indicated by a period Type (Cycle Type). The cycle types include, for example, a command cycle (CMD Type), an address cycle (ADDR Type), a Data input cycle (Data In Type), a Data output cycle (Data Out Type), and the like. In some examples, the periods are distinguished by a clock signal transmitted by a clock signal line (CLK), and in other examples, the periods are distinguished by other signal lines without a clock signal line. One or more signal lines of the flash channel each cycle carry a set of signals, some or all of which are significant and others can be ignored. One or more sets of signals for one or more cycles form a set of signals. In fig. 2B, a schematic diagram of a signal group of a read command defined in ONFI protocol is shown, where Cycle Type "CMD-ADDR-CMD" represents a read command (the process will be simply referred to as "command phase"), and DQ values of the first Cycle of DQ signals are used to inform the NVM chip of the initiation of a read command, DQ values of the subsequent 5 cycles are used to indicate address data for informing the NVM chip where to acquire data from, and DQ values of the last Cycle of DQ signals are used to indicate that the transmission of the read command has been completed, and the transmission Cycle of the read command ends. After a predetermined period of time (e.g., about tR time) has elapsed after the media interface controller issues the read command, the media interface controller may obtain the response to the read command provided by the NVM chip from the NVM chip, cycle Type "DOUT-DOUT" (this process is simply referred to as the "data phase").
By way of further example, in order to reduce the length of time that storage resources are not occupied by invalidating the storage resources, the media interface controller does not apply for storage resources for the media interface commands it processes during the command phase, only generates storage media access commands for the media interface command processing and sends the storage media access commands to the storage media.
Continuing back to fig. 2A, the media interface controller receives at least one storage media access command on the storage media and processes the at least one storage media access command for a preset period of time before applying for allocation of storage resources to the memory allocator, represented as process (2.3). The preset duration is slightly smaller than the duration of the storage medium for processing and acquiring data for at least one storage medium access command. For example, the preset time period may be configured according to actual conditions, history data, or experience. By way of example, the media interface controller no longer queries the memory allocator for the current available storage resource status when applying for allocation of storage resources. That is, in the present application, the media interface controller queries the memory allocator for the current available memory resource situation before the command phase, and if the memory resource is sufficient, it will not immediately apply for allocating the memory resource, but rather enters the command phase. Before the storage medium processes the received storage medium access command for a preset time period and does not enter a data stage, the storage resource is applied for allocation, and the situation of the currently available storage resource is not required to be queried again when the allocation of the storage resource is applied for, so that the storage resource is directly allocated.
Further, if the storage medium prepares response data corresponding to the media interface command, a data stage is entered, and the media interface controller acquires response data corresponding to the media interface command from the storage medium and stores the response data in the memory (e.g., DRAM shown in fig. 1A), which is denoted as a process (2.4).
Fig. 2C illustrates a schematic diagram of another control component provided in an embodiment of the present application.
By way of example, the media interface controller receives a media interface command and queries the memory allocator for the status of the currently available storage resources, denoted as procedure (3.1). If the current available storage resources are insufficient according to the query result, the processing of the media interface command is suspended. Suspending processing of media interface commands, for example, does not send storage media access commands to the storage media during the command phase.
Also by way of example, after suspending processing of the media interface command, the media interface controller applies for allocation of the storage resources to the memory allocator and resumes processing of the media interface command and stores the response data to the applied storage resources. For example, after suspending processing of the media interface command, the media interface controller may query the memory allocator in real time for available storage resource conditions, denoted as process (3.2). If the available storage resources are found to be sufficient, the storage resources are applied, then the media interface command processing is continued again, and response data are stored in the application storage resources, which are represented as processes (3.3) - (3.4).
Fig. 3A shows a schematic structural diagram of a control component according to an embodiment of the present application.
By way of example, in FIG. 3A, the media interface controller in the control unit includes a microinstruction execution unit (or microcontroller, processor core), such as a CPU, and a media interface. The micro instruction sequence corresponds to the medium interface command, and the medium interface controller acquires the corresponding micro instruction sequence according to the received medium interface command and provides the micro instruction sequence to the micro instruction execution unit. The micro instruction execution unit executes the micro instruction sequence to generate a signal sequence conforming to the NVM chip interface protocol. In response to receiving the media interface command, the microinstruction execution unit performs a query to the memory allocator for the status of the currently available memory resources, represented as process (1). If the storage resources are sufficient, the microinstruction execution unit executes the microinstruction sequence, and the control medium interface sends a storage medium access command to the NVM, denoted as processes (2) - (3). The media interface receives the storage media access command on the storage media and processes the storage media access command for a preset duration and then applies for allocation of storage resources to the memory allocator, indicated as process (4). The media interface reads data from the NVM chip and stores it in memory, denoted as processes (5) - (6).
As another example, if the available storage resource is sufficient, the storage resource is allocated by the media interface after the storage media access command is processed for a preset period of time. If the condition of the available storage resources is insufficient storage resources, suspending the processing of the media interface command. After suspending processing of the media interface command, a subsequent application is made by the processor core (e.g., CPU) to allocate memory resources.
Also by way of example, a processor core in the media interface controller, upon executing a sequence of micro instructions, for example, includes a yield micro instruction, controls the media interface to generate a storage media access command to the NVM chip. When the processor core executes the yield microinstruction, controlling the coroutine yield corresponding to the medium interface command; in response to the coroutine yield, executing a coroutine schedule by the processor core to wake the yielded coroutine; and re-applying, by the processor core, allocation of the storage resource in response to the yielded coroutine being awakened; if the storage resource is allocated to the storage resource, the medium interface continues to process the medium interface command; and if the storage resources are not allocated to the storage resources, the processor core re-gives way the coroutines corresponding to the medium interface commands.
Each media interface controller in a control unit in a storage device may be coupled to at least one NVM chip, and each NVM chip may include one or more Logical Units (LUNs). The storage medium access commands issued by the media interface controller to the NVM chip may be, for example, read commands, write commands, erase commands, program commands, or other commands conforming to the ONFI protocol, etc. In addition, the media interface controller may issue more than one storage media access command to the NVM chip, and different storage media access commands may be to access the same logic unit in the same NVM chip, or may be to access different logic units in the same NVM chip or different logic units in different NVM chips. By way of example, if the media interface controller receives multiple media interface commands, the media interface controller may continue to process media interface command 2 in response to suspending processing of media interface command 1. For example, media interface command 2 is a read command that accesses a different logical unit of the same NVM chip or accesses a different logical unit of a different NVM chip than media interface command 1. Or the medium interface command 2 and the medium interface command 1 access different types of medium interface commands of the same logic unit of the same NVM chip, for example, the medium interface command 1 is a read command, and the medium interface command 2 is a command irrelevant to data reading and writing operation. The present application provides a mechanism for suspending processing of media interface commands, in which, due to insufficient storage resources, processing of one media interface command is suspended, the media interface controller does not stop working, and processing of other media interface commands can be continued during suspension processing of the media interface command, so as to improve efficiency of processing of media interface commands, and further improve performance of the storage device.
Fig. 3B illustrates a schematic structure of an NVM chip according to an embodiment of the present application.
By way of example, in FIG. 3B, the media interface controller may be coupled with NVM chip 0 and NVM chip 1, NVM chip 0 including logic unit 0 and logic unit 1, and NVM chip 1 including logic unit 2 and logic unit 4. The media interface controller may access logical units 0-3. For example, the media interface controller receives media interface command 1 and media interface command 2, where media interface command 1 is a read command to access logical unit 0 and media interface command 2 is a read command to access logical unit 1. If the current storage resource is insufficient (the requirement of the medium interface command 1 cannot be met), the medium interface controller pauses the processing of the medium interface command 1 and continues to process the medium interface command 2. For another example, the media interface controller receives a media interface command 3 and a media interface command 4, wherein the media interface command 3 is a read command to access the logical unit 1 and the media interface command 4 is a read command to access the logical unit 3. The media interface controller continues processing media interface command 4 in response to suspending processing of media interface command 3. As another example, the media interface controller receives a media interface command 5 and a media interface command 6, where the media interface command 5 is a read command for accessing the logic unit 2, and the media interface command 6 is a command for accessing the logic unit 2 that is independent of reading and writing data. The media interface controller continues processing the media interface command 6 in response to suspending processing of the media interface command 5.
Also by way of example, the media interface controller also includes a context (or context register). The context is used to record the status information of the media interface command being processed by the media interface controller. For example, the media interface commands processing completion, suspension, or processing status information. Also by way of example, if the media interface controller commands a suspension of processing for one or more media interface commands. In response to the storage resources being sufficient, the media interface controller may determine a media interface command to suspend processing by querying the status information of each media interface command recorded in the context, and apply for allocation of the storage resources to the memory allocator to reprocess the media interface command to suspend processing.
Fig. 3C illustrates a schematic structural diagram of a control component according to an embodiment of the present application.
By way of example, in FIG. 3C, the media interface controller may access four logical units, LUN0 through LUN3, respectively. The media interface controller includes four contexts, LUN0 context, LUN1 context, LUN2 context, and LUN3 context, respectively. Wherein, the LUN0 context is used for recording the state information of the medium interface command accessing the LUN0, the LUN1 context is used for recording the state information of the medium interface command accessing the LUN1, the LUN2 context is used for recording the state information of the medium interface command accessing the LUN2, and the LUN3 context is used for recording the state information of the medium interface command accessing the LUN3. For example, if the media interface controller commands a suspension of processing for one or more media interfaces accessing LUN 0. In response to the storage resources being sufficient, the media interface controller may determine a media interface command to suspend processing by querying the status information of each media interface command recorded in the LUN0 context, and apply for allocation of the storage resources to the memory allocator to reprocess the media interface command to suspend processing.
Fig. 3D illustrates a schematic structural diagram of yet another control component provided in an embodiment of the present application.
As an example, as the storage capacity of the storage device increases, the control unit may connect multiple NVM chips (e.g., 8 or 16). In fig. 3D, the control unit may be connected to a plurality of NVM chips by providing a plurality of media interface controllers, each media interface controller being in one-to-one correspondence with a flash memory channel, each flash memory channel including at least one NVM chip (e.g., one flash memory channel including two NVM chips in fig. 3D). Each media interface controller processes media interface commands and manages memory resources in accordance with the schemes described above.
Fig. 3E shows a schematic structural diagram of yet another control component provided in an embodiment of the present application.
By way of example, in fig. 3E, the control section further includes a host command processing unit and a storage command processing unit as shown in fig. 1B. As can be seen from the above description of the part of fig. 1B, the command processing sent by the control unit to the host includes the following stages: the host command processing unit analyzes the IO command sent by the host and generates a storage command; the storage command processing unit processes the storage command to generate a medium interface command; the media interface controller processes the media interface command to generate a storage media access command.
If the media interface controller pauses the processing of a media interface command, the media interface controller only processes the media interface command, but does not affect the processing of each stage before the media interface controller, i.e. the media interface controller pauses the processing of the media interface command, and does not affect the work of the host command processing unit and the storage command processing unit. In addition, the control unit may receive more than one IO command sent by the host, and the control unit may process multiple IO commands in parallel, for example, the storage command processing unit may process a storage command corresponding to the IO command 2 and the host command processing unit may process the IO command 3 while the media interface controller processes a media interface command corresponding to the IO command 1. I.e. the control unit may process IO command 1, IO command 2 and IO command 3 simultaneously in parallel.
By way of further example, the host command processing unit, in response to sending data to be accessed by the media interface command to the host, instructs to release the storage resource corresponding to the media interface command. In this application, allocated storage resources are allocated by the media interface controller (denoted as process (4.1)), while freed storage resources are freed by the host command processing unit (denoted as process (4.2)).
Fig. 4 shows a method for managing memory according to an embodiment of the present application, which includes the following steps:
in response to receiving the media interface command, and prior to processing the media interface command, the memory allocator is queried for a current available storage resource condition, step 401.
Step 402, directly processing the media interface command according to the query result to generate at least one storage media access command, and sending the at least one storage media access command to a storage medium; or to suspend processing of the media interface command.
Step 403, in response to directly processing the media interface command, not allocating a storage resource before sending the at least one storage media access command to the storage medium, and applying for allocating a storage resource after a preset duration of processing the at least one storage media access command by the storage medium, where the storage resource is used to store response data of the media interface command, and the preset duration is less than a duration of processing the at least one storage media access command by the storage medium to obtain the response data; the memory allocator is not queried for the current available memory resource status prior to allocating the memory resource.
Specifically, the method process of managing the memory is referred to above, and will not be described herein.
According to the scheme provided by the embodiment of the application, the storage resource is not applied in advance in the processing process of the IO command, and the storage resource condition is inquired from the memory distributor through the medium interface controller when the medium interface command corresponding to the IO command is processed. If the storage resources are sufficient, the storage media (NVM chip) applies for resource allocation when the storage media (NVM chip) is expected to receive data from the NVM chip, so that the occupied time of the storage resources is reduced, the utilization rate of the storage resources and the processing efficiency of IO commands are improved, and the performance of the storage equipment is further improved.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application. It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (10)

1. A method of managing memory, comprising:
in response to receiving a first media interface command and prior to processing the first media interface command, querying a memory allocator for a current available storage resource condition;
directly processing the first medium interface command according to the query result to generate at least one storage medium access command, and sending the at least one storage medium access command to a storage medium; or suspending processing of the first media interface command;
in response to directly processing the first media interface command, not allocating a storage resource before sending the at least one storage media access command to the storage medium, and applying for allocating the storage resource after a preset duration of processing the at least one storage media access command by the storage medium, wherein the storage resource is used for storing response data of the first media interface command, and the preset duration is less than a duration of processing the at least one storage media access command by the storage medium to acquire the response data; the memory allocator is not queried for the current available memory resource status prior to allocating the memory resource.
2. The method of claim 1, wherein generating at least one storage medium access command directly to the first medium interface command processing based on the query result comprises:
and if the query result indicates that the current storage resources are sufficient or the current storage resources are sufficient according to the query result, processing the first medium interface command to obtain at least one storage medium command, and sending the at least one storage medium command to the storage medium.
3. The method of claim 2, wherein,
if the current storage resources are insufficient, suspending the processing of the first media interface command.
4. A method according to any one of claims 1-3, wherein the method further comprises:
if the processing of the first medium interface command is suspended, applying for the storage resource to the memory distributor, responding to the application of the storage resource, restoring the processing of the first medium interface command, and storing the response data to the storage resource.
5. The method of any one of claims 1-4, further comprising:
and in response to suspending processing of the first media interface command, continuing processing of a second media interface command, wherein the second media interface command is a different media interface command than the first media interface command.
6. The method of claim 5, wherein the second media interface command and the first media interface command are media interface commands that access different or the same logical unit on the same storage medium; or alternatively
The second media interface command and the first media interface command are media interface commands that access logical units on different storage media.
7. A control unit, characterized by comprising: a memory allocator and at least one media interface controller; each media interface controller obtains a media interface command and inquires the current available storage resource condition from the memory distributor; directly processing the first medium interface command according to the query result to generate at least one storage medium access command, and sending the at least one storage medium access command to a storage medium; or suspending processing of the first media interface command; in response to directly processing the first media interface command, not allocating a storage resource before sending the at least one storage media access command to the storage medium, and applying for allocating the storage resource after a preset duration of processing the at least one storage media access command by the storage medium, wherein the storage resource is used for storing response data of the first media interface command, and the preset duration is less than a duration of processing the at least one storage media access command by the storage medium to acquire the response data; the memory allocator is not queried for the current available memory resource status prior to allocating the memory resource.
8. The control component of claim 7, wherein the media interface controller comprises a media interface, wherein,
and in response to the sufficiency of the current storage resources, applying for allocation of the storage resources by the medium interface after the storage medium processes the at least one storage medium access command for a preset period of time.
9. The control component of claim 8, wherein the media interface controller further comprises a processor core; wherein,
responsive to suspending processing of the media interface command, applying, by the processor core, allocation of the storage resource.
10. The control member of claim 9, wherein,
responsive to suspending processing of the first media interface command, executing a yield microinstruction by a processor core to control coroutine yield corresponding to the first media interface command;
in response to the coroutine yield, executing a coroutine schedule by the processor core to wake the yielded coroutine; and re-applying, by the processor core, allocation of the storage resource in response to the yielded coroutine being awakened;
if the storage resource is allocated to the storage resource, continuing to process the first media interface command by the media interface;
And if the storage resource is not allocated to the processor core, the processor core re-gives way the coroutine corresponding to the first medium interface command.
CN202211217892.1A 2022-09-30 2022-09-30 Method for managing memory and control part Pending CN117850873A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211217892.1A CN117850873A (en) 2022-09-30 2022-09-30 Method for managing memory and control part

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211217892.1A CN117850873A (en) 2022-09-30 2022-09-30 Method for managing memory and control part

Publications (1)

Publication Number Publication Date
CN117850873A true CN117850873A (en) 2024-04-09

Family

ID=90537147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211217892.1A Pending CN117850873A (en) 2022-09-30 2022-09-30 Method for managing memory and control part

Country Status (1)

Country Link
CN (1) CN117850873A (en)

Similar Documents

Publication Publication Date Title
EP3493067B1 (en) Extended utilization area for a memory device
US8924659B2 (en) Performance improvement in flash memory accesses
US10635317B2 (en) Operation method of storage system and host
TWI684860B (en) Method for performing read acceleration, and associated data storage device and controller thereof
CN113168374A (en) Write command retention in partition namespaces
US11385831B2 (en) Memory controller and storage device including the same
WO2019062202A1 (en) Method, hard disk, and storage medium for executing hard disk operation instruction
CN108628543B (en) Garbage collection method and device using same
CN111108488B (en) Memory block recovery method and device
TWI734220B (en) Apparatus and method and computer program product for executing host input-output commands
CN111796759B (en) Computer readable storage medium and method for fragment data reading on multiple planes
TW202139012A (en) Method for performing access management of memory device, associated memory device and controller thereof, associated host device and associated electronic device
KR20170110810A (en) Data processing system and operating method thereof
US11150809B2 (en) Memory controller and storage device including the same
CN114253461A (en) Mixed channel memory device
CN114253462A (en) Method for providing mixed channel memory device
KR100843199B1 (en) High speed IDE interface device and method for the same
US10922013B2 (en) Suspending and resuming a read operation for a non-volatile memory
CN213338708U (en) Control unit and storage device
CN117850873A (en) Method for managing memory and control part
CN114610654A (en) Solid-state storage device and method for writing data into solid-state storage device
TWI747660B (en) Method and apparatus and computer program product for reading data from multiple flash dies
KR20190051416A (en) Semiconductor device and semiconductor system
CN108536475B (en) Complete programming command processing method and device
CN113778317A (en) Computer readable storage medium, method and device for scheduling host commands

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination