CN111176726A - Configurable command cancellation method and device thereof - Google Patents

Configurable command cancellation method and device thereof Download PDF

Info

Publication number
CN111176726A
CN111176726A CN201911412331.5A CN201911412331A CN111176726A CN 111176726 A CN111176726 A CN 111176726A CN 201911412331 A CN201911412331 A CN 201911412331A CN 111176726 A CN111176726 A CN 111176726A
Authority
CN
China
Prior art keywords
command
undo
queue
processing unit
processing
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
CN201911412331.5A
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.)
Xiamen Kingblaze Technology Co ltd
Original Assignee
Xiamen Kingblaze 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 Xiamen Kingblaze Technology Co ltd filed Critical Xiamen Kingblaze Technology Co ltd
Priority to CN201911412331.5A priority Critical patent/CN111176726A/en
Publication of CN111176726A publication Critical patent/CN111176726A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

A configurable command retraction method and apparatus are provided. An information processing apparatus is provided, including: the command processing device comprises a command submitting queue, a command finishing queue, a cancellation processing unit and a command processing device; the cancellation processing unit is coupled with the command submission queue and the command processing device; the undo processing unit, in response to a first command acquired from the command submission queue, traverses the command submission queue to identify whether the first command is to be undone; if the first command is to be revoked, the revocation processing unit adds a processing result indicating that the first command is revoked to the command completion queue; if the first command is not to be revoked, the revocation processing unit gives the first command to the command processing apparatus.

Description

Configurable command cancellation method and device thereof
Technical Field
The present application relates to an information processing technology, and in particular, to a method of revoking a previously issued command among a plurality of information processing units communicating through a queue and an apparatus therefor.
Background
Fig. 1A shows a block diagram of an information processing apparatus based on queue communication.
A typical information processing apparatus processes commands externally submitted thereto, including a command submission queue, a command completion queue, and a command processing unit. The external device adds the command to the command submission queue. The command processing unit acquires and processes the command from the command submission queue, and also adds the processing result of the command to the command completion queue, and the external device fetches the command processing result from the command completion queue.
An operation to add a command to the queue, occurring at the tail of the queue; the operation of fetching a command from the queue occurs at the head of the queue. By exchanging commands through the queue, the difference in speed between the external component that generates the command and the information processing apparatus that processes the command is masked, so that the command that has not been processed is buffered in the queue.
FIG. 1B illustrates a block diagram of a memory device. The storage device 102 is coupled to a host for providing storage capabilities to the host. The host and the solid-state Storage device 102 may be coupled by various methods, including, but not limited to, connecting the host and the Storage device 102 by, for example, SATA (Serial Advanced Technology Attachment), SCSI (small computer System Interface), SAS (Serial Attached SCSI ), IDE (Integrated Drive Electronics), USB (Universal Serial bus), PCIE (Peripheral Component Interconnect Express, PCIE, high-speed Peripheral Component Interconnect), NVMe (NVM Express, high-speed nonvolatile Storage), UFS (Universal Flash Storage), mc (embedded MMC), ethernet, fibre channel, wireless communication network, etc. The host may be an information processing device, such as a personal computer, tablet, server, portable computer, network switch, router, cellular telephone, personal digital assistant, etc., capable of communicating with the storage device in the manner described above. The Memory device 102 includes an interface 103, a control component 104, one or more NVM chips 105, and optionally a DRAM (Dynamic Random Access Memory) 110.
NAND flash Memory, phase change Memory, FeRAM (Ferroelectric RAM), MRAM (magnetoresistive Memory), RRAM (Resistive Random Access Memory), XPoint Memory, and the like are common NVM.
The interface 103 may be adapted to exchange data with a host by means such as SATA, IDE, USB, PCIE, NVMe, SAS, UFS (universal flashstore), ethernet, fibre channel, etc.
The control unit 104 is used to control data transfer between the interface 103, the NVM chip 105, and the DRAM 110, and also used for memory management, host logical address to flash physical address mapping, erase leveling, bad block management, and the like. The control component 104 can be implemented in various manners of 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), an ASIC (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. The control component 104 may also be coupled to the DRAM 110 and may access data of the DRAM 110. FTL tables and/or cached IO command data may be stored in the DRAM.
Control section 104 includes a flash interface controller (or referred to as a media interface controller, a flash channel controller) that is coupled to NVM chip 105 and issues commands to NVM chip 105 in a manner that conforms to an interface protocol of NVM chip 105 to operate NVM chip 105 and receive command execution results output from NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI", etc.
UFS (universal flash storage) is an interface standard for flash memory storage devices established by the JEDEC standards organization, with a standard number such as JESD 220C. The UFS Protocol exchanges commands between a host and a storage device with UPIU (UFS Protocol Information Unit) as a transfer Unit. The UPIU includes various types such as a command unit, an RTT unit, a read data unit, a write data unit, and a response unit.
In addition to read commands, write commands, the UFS protocol defines task management commands, advisory commands, eject commands, null commands, and the like. The task management commands include, for example, an undo (Abort) function that indicates one or more commands that were committed to the UFS storage device prior to the undo.
Disclosure of Invention
The queue has a first-in first-out feature, and commands added to the queue first are fetched earlier for processing and then are processed later. This brings the advantage of sequentiality. But creates a significant hurdle when a command that was previously added to the queue needs to be retired at a later time. When the information processing apparatus processes a preceding command to be revoked in the queue, it is difficult to obtain the existence of the revoke command in time, and thus the revoke command is difficult to take effect.
In particular, the UFS protocol defines the task management command retraction function. The UFS storage device needs to handle the revocation command issued by the host. And proper processing of the undo command also reduces the amount of data written to the flash storage medium, reduces wear on the storage medium, and improves the performance of the storage device due to the reduction of pending commands.
And support of the revocation function is also desired to have as little influence on the existing information processing apparatus as possible.
According to a first aspect of the present application, there is provided a first information processing apparatus according to the first aspect of the present application, comprising: the command processing device comprises a command submitting queue, a command finishing queue, a cancellation processing unit and a command processing device; the cancellation processing unit is coupled with the command submission queue and the command processing device; the undo processing unit, in response to a first command acquired from the command submission queue, traverses the command submission queue to identify whether the first command is to be undone; if the first command is to be revoked, the revocation processing unit adds a processing result indicating that the first command is revoked to the command completion queue; if the first command is not to be revoked, the revocation processing unit gives the first command to the command processing apparatus.
According to a first information processing apparatus of a first aspect of the present application, there is provided the second information processing apparatus of the first aspect of the present application, wherein each command in the command submission queue includes a command identification and a command body, the command identification uniquely identifying the command being processed by the information processing apparatus.
According to the first or second information processing apparatus of the first aspect of the present application, there is provided the third information processing apparatus according to the first aspect of the present application, wherein to identify whether the first command is to be revoked, the undo processing unit traverses the command submission queue from the head of the queue to the tail of the queue to access the undone commands in the command submission queue, and identifies whether the first command is to be undone based on whether one or more command identifications indicated by one or more undone commands in the command submission queue are the same as the command identification of the first command.
According to a third information processing apparatus of the first aspect of the present application, there is provided the fourth information processing apparatus of the first aspect of the present application, wherein the revocation processing unit recognizes that the first command is to be revoked, if the revocation processing unit records the command identification of the first command from the command body of the revocation command found in the command submission queue.
According to a third or fourth information processing apparatus of the first aspect of the present application, there is provided the fifth information processing apparatus of the first aspect of the present application, wherein if none of the command bodies of one or more of the undo commands in the command submission queue records the command identifier of the first command, or if no undo command is included in the command submission queue, the undo processing unit recognizes that the first command is not to be undone.
According to one of the first to fifth information processing apparatuses of the first aspect of the present application, there is provided the sixth information processing apparatus according to the first aspect of the present application, wherein in response to the revocation processing unit handing over the first command to the command processing apparatus, the revocation processing unit continues the other commands acquired from the command submission queue.
According to one of the first to sixth information processing apparatuses of the first aspect of the present application, there is provided the seventh information processing apparatus according to the first aspect of the present application, wherein in response to acquisition of the undo command from the command submission queue, the undo processing unit adds the processing result of the undo command to the command completion queue without handing over the undo command to the command processing apparatus.
According to a seventh information processing apparatus of the first aspect of the present application, there is provided the eighth information processing apparatus of the first aspect of the present application, wherein if the first command is to be revoked, the revocation processing unit further records, in association, a command identification of the first command and a command identification of a first revocation command indicating that the first command is revoked; in response to acquiring the first undo command from the command submission queue, the undo processing unit records, in the processing result of the first undo command, the command identifications of the one or more commands that it successfully undoes.
According to one of the first to eighth information processing apparatuses according to the first aspect of the present application, there is provided the ninth information processing apparatus according to the first aspect of the present application, further comprising a revocation enablement port; in response to the undo enable port being set, the undo processing unit, in response to a first command being obtained from the command submission queue, walks the command submission queue to identify whether the first command is to be undone.
According to a ninth information processing apparatus of the first aspect of the present application, there is provided the tenth information processing apparatus of the first aspect of the present application, wherein in response to the revocation enable port not being set, the revocation processing unit forwards the first command to the command processing apparatus in response to the first command acquired from the command submission queue without recognizing whether the first command is to be revoked.
According to one of the first to eighth information processing apparatuses of the first aspect of the present application, there is provided the eleventh information processing apparatus according to the first aspect of the present application, further comprising a revocation enablement port; the revocation processing unit responds to a first command acquired from the command submission queue and also accesses a revocation enabling port; in response to the undo enable port being set, the undo processing unit walks the command submission queue to identify whether the first command is to be undone.
According to an eleventh information processing apparatus of the first aspect of the present application, there is provided the twelfth information processing apparatus of the first aspect of the present application, wherein in response to the revocation enable port not being set, the revocation processing unit forwards the first command to the command processing apparatus in response to the first command acquired from the command submission queue without recognizing whether the first command is to be revoked.
According to one of the first to twelfth information processing apparatuses of the first aspect of the present application, there is provided the thirteenth information processing apparatus according to the first aspect of the present application, wherein the command processing apparatus includes a scheduling unit, a status storage unit, and one or more command processing units; a state storage unit storing a context of each command being processed by the command processing apparatus;
the dispatching unit dispatches one of the command processing units to process the command; the command processing unit processes the command in response to being scheduled.
According to a thirteenth information processing apparatus of the first aspect of the present application, there is provided the fourteenth information processing apparatus according to the first aspect of the present application, wherein in response to acquisition of the first undo command from the command submission queue, the undo processing unit accesses the status storage unit in accordance with the command identification of the command desirous of undo indicated by the first undo command, and sets an undo flag in the context of the command having the same command identification stored in the status storage unit.
According to a fourteenth information processing apparatus of the first aspect of the present application, there is provided the fifteenth information processing apparatus of the first aspect of the present application, wherein the command processing unit decides by itself whether to continue processing the second command in response to the revocation flag being set in the context of the one or more second commands it processes.
According to a fifteenth information processing apparatus of the first aspect of the present application, there is provided the sixteenth information processing apparatus of the first aspect of the present application, wherein if the command processing unit decides to continue processing the second command, after the processing of the second command is completed, a normal command processing result is added to the command completion queue.
According to a fifteenth or sixteenth information processing apparatus of the first aspect of the present application, there is provided the seventeenth information processing apparatus of the first aspect of the present application, wherein if the command processing unit decides to terminate processing of the second command, a command processing result indicating that the second command is revoked is generated and added to the command completion queue.
According to one of the first to seventeenth information processing apparatuses of the first aspect of the present application, there is provided the eighteenth information processing apparatus according to the first aspect of the present application, wherein the information processing apparatus is a media interface controller.
According to a second aspect of the present application, there is provided a first UFS memory device according to the second aspect of the present application, comprising a control section and an NVM chip; the control means comprises a host interface, a UFS command processing unit, and a media interface controller according to claim 18; the media interface controller is coupled to the NVM chip and sends an NVM command to the NVM chip.
According to a first UFS storage device of a second aspect of the present application, there is provided a second UFS storage device of the second aspect of the present application, wherein a UFS command received by the host interface is supplied to the UFS command processing unit; the UFS command processing unit generates a command to add to a command submission queue of the media interface controller in response to receiving the UFS command.
According to a second UFS storage device of the second aspect of the present application, there is provided a third UFS storage device of the second aspect of the present application, wherein if the UFS command is a task management command indicating a revocation function, the UFS command processing unit generates a revocation command to be added to a command submission queue of the media interface controller; wherein the command body of the undo command indicates a command identification of one or more commands that the UFS command processing unit has provided to the media interface controller.
According to a third UFS storage device of the second aspect of the present application, there is provided the fourth UFS storage device of the second aspect of the present application, wherein in response to adding the generated undo command to the command submission queue of the media interface controller, the UFS command processing unit further sets an undo enable port of the media interface controller.
According to one of the first to fourth UFS storage devices of the second aspect of the present application, there is provided the fifth UFS storage device of the second aspect of the present application, wherein the UFS command processing unit obtains a processing result of a command according to a command completion queue from the media interface controller.
According to a fifth UFS storage device of the second aspect of the present application, there is provided the sixth UFS storage device of the second aspect of the present application, wherein the UFS command processing unit knows which commands that the undo command wishes to undo have been successfully undone, based on a result of processing the undo command obtained from the command completion queue of the media interface controller.
According to a fifth or sixth UFS storage device of the second aspect of the present application, there is provided the seventh UFS storage device of the second aspect of the present application, wherein the UFS command processing unit knows which commands that the undo command is intended to undo are successfully undone, based on the processing results of the undo command and other commands obtained from the command completion queue of the media interface controller.
According to a third aspect of the present application, there is provided a first information processing method according to the third aspect of the present application, comprising: a first command obtained from a command submission queue; traversing the command submission queue to identify whether the first command is to be revoked; if the first command is to be revoked, adding a processing result indicating that the first command is revoked to a command completion queue; if the first command is not to be revoked, the first command is processed.
According to a first information processing method of a third aspect of the present application, there is provided the second information processing method according to the third aspect of the present application, wherein each command in the command submission queue includes a command identification and a command body, and the command identification uniquely identifies the command being processed.
According to the first or second information processing method of the third aspect of the present application, there is provided the third information processing method according to the third aspect of the present application, wherein to identify whether the first command is to be revoked, the command submission queue is traversed from the head of the queue to the tail of the queue to access the revoked command in the command submission queue, and whether the first command is to be revoked is identified according to whether one or more command identifications indicated by one or more revoked commands in the command submission queue are the same as the command identification of the first command.
According to a third information processing method of the third aspect of the present application, there is provided the fourth information processing method of the third aspect of the present application, wherein if a command identification of the first command is recorded from a command body of a cancel command found in the command submission queue, it is recognized that the first command is to be canceled.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1A is a block diagram of a related art information processing apparatus;
FIG. 1B is a block diagram of a prior art storage device;
FIG. 2A is a diagram illustrating a command accepted by an information processing apparatus according to an embodiment of the present application;
FIG. 2B shows a block diagram of an information processing apparatus according to an embodiment of the present application;
FIG. 2C illustrates a flow diagram of an undo command in accordance with an embodiment of the present application;
FIGS. 3A and 3B illustrate an undo command according to yet another embodiment of the present application;
FIG. 4 illustrates a block diagram of an information processing apparatus according to another embodiment of the present application;
figure 5 illustrates a block diagram of a UFS storage device according to yet another embodiment of the present application; and
fig. 6 illustrates a block diagram of a UFS storage device according to yet another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application are clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 2A is a schematic diagram illustrating a command accepted by an information processing apparatus according to an embodiment of the present application.
In order to instruct the information processing apparatus to cancel the preceding command, a cancel command is provided. The external unit issues a cancel command to the information processing apparatus, and the information processing apparatus can receive and process the cancel command. The undo command has a similar structure (e.g., the same size) as other commands processed by the information processing apparatus and thus can be added to the command submission queue.
The information processing apparatus receives a plurality of commands through a command submission queue. FIG. 2A illustrates a read command, a write command, and an undo command. It will be appreciated that other kinds of commands may be accepted by the information processing apparatus.
Each command added to the command submission also has a command identification. The command identification uniquely identifies the command being processed. Commands that have been added to the command submission queue and whose processing results have not been pulled from the command completion queue are referred to as commands being processed.
The undo command shown in fig. 2A includes a command identification "03" and its command body. The command body of an undo command includes a command type (indicating an "undo command") and one or more command identifications. The command identifier carried by the command body of the command to be cancelled indicates the identifier of the target command which the command to be cancelled is desired to be cancelled. Optionally, the command body of the undo command indicates a special command identity indicating that all commands being processed are undone.
The command identification is appended to the command by the external unit and added to the command submission queue. So that the external unit knows which command identifications are being used and to which command the used command identification is associated. Thereby indicating the undo target command by specifying the command identification in the command body of the undo command. It can be understood that the undo command itself also has a command identifier, and the meaning of the command identifier of the undo command is different from the command identifier carried in the command body of the undo command and indicating the target command that is desired to be undone.
Optionally, the undo command is not mandatory. The information processing apparatus revokes one, part or all of the command it indicates as being desired to revoke, according to its own capability.
Still alternatively, the processing result of the revoked command is also notified to the external unit using the information processing apparatus through the command completion queue.
Fig. 2B shows a block diagram of an information processing apparatus according to an embodiment of the present application.
The information processing apparatus includes a command submission queue 210, a command completion queue 220, and a command processing unit 260. The information processing apparatus further includes a revocation processing unit 240 and a revocation-enabled port 245.
The external unit adds the undo command to the command submission queue 210. The external unit also sets a revocation enable port 245 to indicate that a revocation command is submitted to the information processing apparatus. The disable port 245 is, for example, a one-bit register. If the undo enable port 245 is not set, the undo unit 240 does not operate, and the command processing unit 260 directly obtains the pending command from the command submission queue 210. Alternatively, if the withdrawal enable port 245 is not set, the withdrawal unit 240 directly forwards the command acquired from the command submission queue 210 to the command processing unit.
If the undo enable port 245 is set, the undo unit 240 intervenes in the processing of the command retrieved from the command submission queue 210. The undo unit 240 fetches a command (current command) from the command submission queue 210, and extracts the command identification (denoted as CID) of the command. The undo unit 240 also traverses the command submission queue 210 to find an undo command that may exist therefrom. And when the command revocation is found, extracting the command identification carried in the command body of the command revocation. If one of the command identifications extracted from the command to be withdrawn is consistent with the command identification CID of the current command, the command is withdrawn. The undo processing unit generates a command processing result for the command, the command processing result indicating that the command was undone, and adds the command processing result to the command completion queue 210. The undo processing unit does not forward the command to the command processing unit 260. In response to the current command being retired, the retire processing unit 240 completes processing of the current command, then retrieves the next command from the command submission queue 210, and repeats the above-described processing.
If any command identification extracted from the undo command is not consistent with the command identification CID of the current command, the undo processing unit 240 continues to traverse the command submission queue 210 for other undo commands, and performs the same operations as above on the found undo command to determine whether to undo the current command.
If the command submission queue 210 has been traversed without finding any undo command, or none of the found undo commands carries the command identification CID, it means that the current command does not need to be undone, and the undo processing unit 240 forwards the current command to the command processing unit 260 for processing. The command processing unit 260 processes the current command and adds the command processing result to the command completion queue 220.
If the command that the undo processing unit 240 obtains from the command submission queue 210 is an undo command, the undo processing unit 240 generates a command processing result for the undo command and adds the command processing result to the command completion queue 220 to represent that the processing of the undo command is completed. The command processing result of the undo command is, for example, the undo command itself or the command identification of the undo command.
If the undo enable port 245 is not set, the command obtained from the command submission queue 210 by the undo unit 240 is an undo command, and the undo processing unit 240 also generates a command processing result for the undo command and adds the command processing result to the command completion queue 220 to represent that the processing of the undo command is completed.
By providing the undo processing unit 240, the information processing apparatus is enabled to process an undo command and undo a target command added earlier to the command submission queue 210 in accordance with an undo command added later to the command submission queue 210.
It will be appreciated that, according to embodiments of the present application, the undo command may not be able to undo any command being processed. Some commands have been forwarded to command processing unit 260 for processing. The undo processing unit 240 checks whether the command acquired from the command submission queue 210 is to be undone, without checking whether the command being processed by the command processing unit 260 is to be undone. So that even if the command instructed to be revoked is a revoked command, the command unit 260 can normally process it and add the result of the normal processing to the command completion queue 220.
Fig. 2C illustrates a flow diagram of an undo command according to an embodiment of the application.
The external unit submits the command to the command submission queue 210 (see also fig. 2B) of the information processing apparatus. In order to revoke a command that has been submitted to an information processing apparatus, an external unit generates a revoke command indicating a command identification of a target command to be revoked. And the external unit also sets a disable port 245.
Fig. 2C shows a processing flow of the revocation processing unit 240 of the information processing apparatus.
The undo processing unit 240 fetches the first command from the command submission queue 210 (270). The revocation processing unit 240 checks whether the revocation enabled port 245 is set (272). If the revocation enablement port 245 is not set (272), the revocation processing unit 240 forwards the acquired first command to the command processing unit 260 (290). Next, the undo processing unit 240 again fetches the next command from the head of the command submission queue 210 (e.g., returns to step 270).
If the undo enable port 245 is set (272), the undo processing unit 240 extracts its command identification from the first command (274). The undo processing unit 240 also walks the command submission queue 210 from head of queue to tail of queue (276). In traversing the command submission queues 210, it is identified whether each queue is an undo command (278). For non-undo commands, directly skipping over and continuing to access the next command in the queue; for a command to undo, an identification of a target command indicating to undo recorded in its command body is obtained. It will be appreciated that each command that is accessed remains in the command submission queue 210 during traversal of the command submission queue 210 by the undo processing unit 240.
The undo processing unit 240 compares whether the identification of the target command acquired from the undo command is the same as the first command identification (280). If the identification of the target command obtained from the undo command is the same as the first command identification (280), meaning that an undo command was found that was to undo the first command, command processing results are generated for the first command and added to the command completion queue 220 in response (282). For example, the undo processing unit 240 adds the first command to the command completion queue 220, or adds the first command with an appended undo flag to the command completion queue 220. Next, the undo processing unit 240 again fetches the next command from the head of the command submission queue 210 (e.g., returns to step 270).
If the identification of any target command obtained from the undo command is different from the first command identification (280), meaning that no undo command was found to undo the first command, the undo processing unit 240 returns to step 276 to continue traversing the command submission queue 210 to the end of the queue.
If the entire command submission queue 210 has been traversed and an undo command to undo the first command has not yet been found (278), then, turning to step 290, the undo processing unit 240 forwards the first command to the command processing unit 260 (290). Next, the undo processing unit 240 again fetches the next command from the head of the command submission queue 210 (e.g., returns to step 270).
Fig. 3A and 3B are schematic diagrams illustrating an undo command according to another embodiment of the present application.
Referring to fig. 3A, the command submission queue of the information processing apparatus is added with commands whose command identifications are "00", "01", … … and "07", respectively, in which the command identified as "00" is located at the head of the queue and the commands identified as "04" and "06" are undo commands. The command body of the undo command with command identification "04" indicates that the commands with command identifications "03" and "01" are to be undone, while the command body of the undo command with command identification "06" indicates that the commands with command identifications "05" and "00" are to be undone.
The undo processing unit acquires a command identified by the command "00" from the head of the command submission queue (indicated by (1) in fig. 3A). The revocation processing unit next acquires whether the revocation enabled port is set (indicated by (2) in fig. 3A). In the example of FIG. 3A, the undo enable port has been set, and the undo processing unit in response walks the command submission queue to identify whether to undo a command identified as "00" obtained from the command submission queue.
The undo unit traverses the command submission queue from the head of the queue to the tail of the queue, recognizing that none of the commands identified as "01", "02", and "03" are undo commands, and the command identified as "04" is an undo command (indicated by (3) in fig. 3A). The revocation unit acquires the command body of the revocation command having the command identification "04" and obtains the command identifications "03" and "01" indicated therein to be revoked. Both the command identifications "03" and "01" to be revoked are different from the command identification "00" currently acquired from the head of the queue, and thus the revocation unit completes the check of the revoked command with the command identification "04" and continues to traverse the command submission queue.
The undo unit continues to traverse the command submission queue to the end of the queue recognizing that the command identified as "05" is not an undo command, and the command identified as "06" is an undo command (indicated by (4) in fig. 3A). The revocation unit acquires the command body of the revocation command having the command identification "06", and obtains the command identifications "05" and "00" to be revoked indicated therein. The two command identifications "05" and "00" to be revoked include the command identification "00" currently acquired from the head of the queue, and thus the revocation unit revokes the command having the command identification "00" currently acquired from the head of the queue.
With continued reference to FIG. 3B, the undo unit appends an "undo" tag in the command body of the command with command identification "00" and adds it to the command completion queue (indicated by (5) in FIG. 3A).
Since the command with the command identification "00" is revoked, the revocation unit no longer continues to look for the revoked command in the command submission queue, although the end of the command submission queue has not been traversed, but has completed processing of the command with the command identification "00" acquired from the head of the queue. The head of the command submission queue becomes the command with the command identification of "01", and the undo unit continues to acquire the command from the head of the queue and process it.
Fig. 4 shows a block diagram of an information processing apparatus according to another embodiment of the present application.
The information processing apparatus includes a command submission queue 410, a command completion queue 420, an undo processing unit 440, an undo enable port 445, a plurality of command processing units (460, 462, 464, and 446), a status storage unit 452, and a scheduling unit 454.
The external unit adds the undo command to the command submission queue 410. The external unit also sets the revocation enable port 445 to indicate that a revocation command is submitted to the information processing apparatus. If the retraction enable port 445 is not set and the retraction unit 440 is not active, the retraction unit 440 forwards the command retrieved from the command submission queue 410 directly to the scheduling unit 454.
Dispatch unit 454 dispatches one of the command processing units (460, 462, 464, or 446) to process the command based on the received command and its status. The command processing unit processes the commands in multiple stages, and the state storage unit 452 records the context and processing stage of each processed command, so that the command processing unit temporarily stores the intermediate result of the command processing or continues to process the not-completed command according to the information of the state storage unit 452.
If the undo enable port 445 is set, the undo unit 440 intervenes in the processing of commands retrieved from the command submission queue 410.
According to one embodiment of the present application, the undo unit 440 fetches a command (current command) from the command submission queue 410 and traverses the command submission queue 410 to determine that there is an undo command in the command submission queue 410 to undo the current command. If the current command is retired, retire processing unit 440 adds the processing result of the current command to command completion queue 420 without forwarding it to dispatch unit 454. If there is no undo command to undo the current command in the command submission queue 410, the undo processing unit 440 forwards the current command to the scheduling unit 454. In such an embodiment, the retired command may be a command pending in the command submission queue 410 that cannot be retired if the command has been fetched from the command submission queue 410 and processed by the command processing unit.
In response to the current command acquired from the head of the command submission queue 410 being an undo command, the undo processing unit 440 generates a processing result for the undo command and adds to the command completion queue 420, so that the external unit becomes aware from the command completion queue 420 that the undo command is processed. In response to acquiring the undo command, the undo processing unit 440 no longer traverses the command submission queue 440 to check whether there are commands in the command submission queue 440 to be undone. Such that an undo command can only undo commands added to the command submission queue 440 before it, but does not affect commands added to the command submission queue 440 after it.
Optionally according to yet another embodiment of the present application. In response to acquisition of the undo command, the undo processing unit 440 accesses the status storage unit 452 in addition to adding the processing result of the undo command to the command completion queue 420. The revocation processing unit 440 searches whether a context of a command having the same command identification is recorded in the status storage unit 452, based on the command identification of the command that the revocation command wishes to revoke. For a context of a command having the same command identification recorded in the state storage unit 452, the revocation processing unit 440 also sets a revocation flag in the context. The undo flag in the command context indicates to the command processing unit that the command is desired to be undone. The command processing unit, in response to the context of the command it processes being set with the undo flag, autonomously decides whether to continue processing the command. If the command processing unit decides to continue processing the command, normal command processing results are added to the command completion queue after the command processing is completed. If the command processing unit decides to terminate processing the command, a command processing result indicating that the command is revoked is generated and added to a command completion queue. Thus, if an undo command is added to the command submission queue 410, the undo processing unit 440, when processing the undo command, still has the opportunity to request the command processing unit to undo the command if the command that is desired to be retired has been fetched from the command submission queue 410 and processed.
Further, the undo processing unit 440 also records the command identification of each command that it undoes and the command identification of the corresponding undo command. Thus, when the undo processing unit 440 acquires an undo command from the command submission queue 410, it is known whether one or more commands that are desired to be undone and indicated by the acquired undo command are all undone through the recorded undo command identification and the command identification of the undone command. If the command that the undo command wishes to undo has all been undone by the undo processing unit 440, the undo processing unit does not have to set an undo flag in the status storage unit 452 according to the undo command. If one or more commands that the undo command wishes to undo have not been undone by the undo processing unit 440, the undo processing unit accesses the status storage unit 452 according to the undo command to search for a context of commands with the same command identification recorded in the status storage unit 452 and sets an undo flag in the context.
The command processing unit (460, 462, 464 or 446) acquires the context and processing stage of the command to be processed from the state storage unit 452 in response to being scheduled by the scheduling unit 454 to process the command, and continues the processing of the command. Further, the command processing unit (460, 462, 464, or 446) also identifies whether the undo flag is set in the context of the command before continuing to process the command in response to the scheduling by the scheduling unit 454. For a command for which the undo flag is set, it is determined that processing of the command is to be terminated according to the processing stage of the command. For example, the command is a read command, and the current processing stage is to wait for the storage medium to output data to be read, at which time the command processing unit is not to wait for the storage medium to output data to be read, or to supply the storage medium to output data to an external unit, in response to the command being set with the undo flag. As yet another example, the command is an erase command, the storage command takes about 10ms (milliseconds) to process the erase command, the command processing stage indicates that the storage medium has processed 9.5ms for the erase command (near process completion), the command processing unit does not terminate processing of the command, but completes processing of the command, and populates the command completion queue 420 based on the erase command processing results presented by the storage medium.
Figure 5 illustrates a block diagram of a UFS storage device according to yet another embodiment of the present application.
The UFS memory device includes a control component and one or more NVM chips. The control means comprises a host interface, a UFS command processing unit 500, a media interface controller and an optional memory. The media interface controller is coupled with one or more NVM chips, and is used for sending an NVM command to the NVM chips and receiving the processing result of the NVM chips on the NVM command. The NVM commands are commands to operate the NVM chip.
The media interface controller includes a command submission queue 510, a command completion queue 520, an undo processing unit 540, an undo enable port 545, a 5NVM command processing unit 560.
The host interface receives the data packet of the UFS protocol, extracts the UFS command, and provides it to the USF command processing unit 500. The UFS command processing unit 500 generates a command to be supplied to the media interface controller through the command submission queue 510 in response to processing the UFS command, and acquires a processing result of the command from the command completion queue 520.
The UFS command processing unit 500 appends a command identification, which uniquely identifies the command being processed by the media interface controller, to each command added to the command submission queue 510.
In response to receiving a task management command indicating a cancel function of the UFS protocol, the USF command processing unit 500 generates a cancel command to add to the command submission queue 510, where the command body of the generated cancel command indicates the command identification of one or more commands that have been provided to the media interface controller. The USF command processing unit 500 also sets a cancel enable port 545 to instruct the cancel processing unit 540 of the media interface controller to check whether the command acquired is to be canceled when acquiring the command from the command submission queue 510.
For an un-revoked command fetched from the command submission queue 510, the undo processing unit 540 forwards it to the NVM command processing unit 560. The NVM command processing unit 560 issues an NVM command to the NVM chip according to the received command and obtains a processing result of the NVM command provided by the NVM chip.
Optionally, for the undo command, the undo processing unit 540 further records the command identification of the command that was successfully undone by the undo command in the processing result of the undo command. The UFS command processing unit 500 thus knows which commands it wishes to undo have been successfully undone, and also knows which commands it wishes to undo have not been undone, from the processing result of the undo command acquired from the command completion queue 520.
Fig. 6 illustrates a block diagram of a UFS storage device according to yet another embodiment of the present application.
The UFS memory device includes a control component and one or more NVM chips. The control means comprises a host interface, a UFS command processing unit 600, a media interface controller and an optional memory. The media interface controller couples one or more NVM chips.
The media interface controller includes a command submission queue 610, a command completion queue 620, a retirement processing unit 640, a retirement enable port 645, a plurality of NVM command processing units, a status storage unit, and a scheduling unit. Each NVM command processing unit is individually coupled to an NVM chip. And the scheduling unit sends the received command to the corresponding NVM command processing unit for processing according to the NVM chip to be accessed by the command.
The host interface provides the UFS command to the USF command processing unit 600. The UFS command processing unit 600 generates a command to be provided to the media interface controller through the command submission queue 610 in response to processing of the UFS command, and acquires a processing result of the command from the command completion queue 620.
In response to receiving a task management command indicating a cancel function of the UFS protocol, the USF command processing unit 600 generates a cancel command to add to the command submission queue 610. The USF command processing unit 600 also sets a revocation enable port 645.
In response to the retraction enabling port 645 being set, the retraction processing unit 640 traverses the command submission queue 610 to check whether it is to be retracted for a command retrieved from the command submission queue 610.
For an un-revoked command fetched from the command submission queue 610, the revocation processing unit 640 forwards it to the scheduling unit.
Alternatively, in response to the withdrawal of the undo command from the command submission queue 610, the undo processing unit 640 accesses the state storage unit in addition to adding the processing result of the undo command to the command completion queue 620. The undo processing unit 440 also sets an undo flag in a context of a command having the same command identification recorded in the status storage unit, according to the command identification of the command desired to be undone, indicated by the command body of the undo command. The NVM command processing unit, in response to the undo flag being set in the context of the command it is processing, autonomously decides whether to continue processing the command. The command processing results that the NVM command processing units add to the command completion queue 620 also indicate whether the corresponding command was successfully retired.
Optionally, for the undo command, the undo processing unit 640 further records the command identification of the command successfully undone by the undo command in the processing result of the undo command. The UFS command processing unit 600 thus knows which commands it wishes to revoke are successfully revoked and also knows which commands it wishes to revoke are not revoked, based on the processing results of the revoke command acquired from the command completion queue 620 and the processing results of the other commands.
Embodiments according to the present application also provide a storage device including a controller and a nonvolatile memory chip, wherein the controller executes any one of the processing methods provided by the embodiments of the present application.
Embodiments according to the present application also provide a program stored on a readable medium, which when executed by a controller of a storage device, causes the storage device to perform any one of the processing methods provided according to the embodiments of the present application.
While the 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. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application. It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. An information processing apparatus comprising: the command processing device comprises a command submitting queue, a command finishing queue, a cancellation processing unit and a command processing device;
the cancellation processing unit is coupled with the command submission queue and the command processing device;
the undo processing unit, in response to a first command acquired from the command submission queue, traverses the command submission queue to identify whether the first command is to be undone;
if the first command is to be revoked, the revocation processing unit adds a processing result indicating that the first command is revoked to the command completion queue;
if the first command is not to be revoked, the revocation processing unit gives the first command to the command processing apparatus.
2. The information processing apparatus according to claim 1, wherein
To identify whether the first command is to be revoked, the undo processing unit traverses the command submission queue from the head of the queue to the tail of the queue to access the undone commands in the command submission queue, and identifies whether the first command is to be undone based on whether one or more command identifications indicated by one or more undone commands in the command submission queue are the same as the command identification of the first command.
3. The method of claim 1 or 2, wherein
In response to acquiring the undo command from the command submission queue, the undo processing unit adds a processing result of the undo command to the command completion queue without handing over the undo command to the command processing apparatus;
if the first command is to be revoked, the revocation processing unit also records the command identification of the first command in association
A command identification associated with a first undo command indicating an undo of the first command;
in response to acquiring the first undo command from the command submission queue, the undo processing unit records, in the processing result of the first undo command, the command identifications of the one or more commands that it successfully undoes.
4. The information processing apparatus according to one of claims 1 to 3, further comprising a revocation enablement port;
in response to the undo enable port being set, the undo processing unit, in response to a first command being obtained from the command submission queue, walks the command submission queue to identify whether the first command is to be undone.
5. The information processing apparatus according to one of claims 1 to 4, wherein
The command processing device comprises a scheduling unit, a state storage unit and one or more command processing units;
a state storage unit storing a context of each command being processed by the command processing apparatus;
the dispatching unit dispatches one of the command processing units to process the command;
the command processing unit processes the command in response to being scheduled.
6. An information processing apparatus according to claim 5, wherein
In response to acquisition of the first undo command from the command submission queue, the undo processing unit accesses the state storage unit based on the command identification of the command whose undo is desired as indicated by the first undo command, and sets an undo flag in the context of the command having the same command identification stored in the state storage unit.
7. The information processing apparatus according to claim 6, wherein
The command processing unit determines itself whether to continue processing the second command in response to the revocation flag being set in the context of the one or more second commands it processes.
8. The information processing apparatus according to one of claims 1 to 7, wherein
The information processing apparatus is a media interface controller.
9. A UFS storage device includes a control unit and an NVM chip;
the control means includes a host interface, a UFS command processing unit, and the media interface controller of claim 8;
the media interface controller is coupled to the NVM chip and sends an NVM command to the NVM chip.
10. An information processing method comprising:
a first command obtained from a command submission queue;
traversing the command submission queue to identify whether the first command is to be revoked;
if the first command is to be revoked, adding a processing result indicating that the first command is revoked to a command completion queue;
if the first command is not to be revoked, the first command is processed.
CN201911412331.5A 2019-12-31 2019-12-31 Configurable command cancellation method and device thereof Pending CN111176726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911412331.5A CN111176726A (en) 2019-12-31 2019-12-31 Configurable command cancellation method and device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911412331.5A CN111176726A (en) 2019-12-31 2019-12-31 Configurable command cancellation method and device thereof

Publications (1)

Publication Number Publication Date
CN111176726A true CN111176726A (en) 2020-05-19

Family

ID=70623752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911412331.5A Pending CN111176726A (en) 2019-12-31 2019-12-31 Configurable command cancellation method and device thereof

Country Status (1)

Country Link
CN (1) CN111176726A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022237582A1 (en) * 2021-05-11 2022-11-17 Mediatek Inc. Abort handling by host controller for storage device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022237582A1 (en) * 2021-05-11 2022-11-17 Mediatek Inc. Abort handling by host controller for storage device

Similar Documents

Publication Publication Date Title
US10282132B2 (en) Methods and systems for processing PRP/SGL entries
US10620832B1 (en) Method and apparatus to abort a command
US9727503B2 (en) Storage system and server
CN102841872B (en) High-performance path for command process
US20180113615A1 (en) Storage device generating adaptive interrupt and operating method thereof
US8924627B2 (en) Flash memory device comprising host interface for processing a multi-command descriptor block in order to exploit concurrency
US20150253992A1 (en) Memory system and control method
US20180275921A1 (en) Storage device
US9052835B1 (en) Abort function for storage devices by using a poison bit flag wherein a command for indicating which command should be aborted
EP3608790B1 (en) Modifying nvme physical region page list pointers and data pointers to facilitate routing of pcie memory requests
US9710191B1 (en) Rapid memory buffer write storage system and method
US8266371B2 (en) Non-volatile storage device, host device, non-volatile storage system, data recording method, and program
CN103678193A (en) Host for controlling non-volatile memory card, system including the same, and methods operating the host and the system
US10282103B1 (en) Method and apparatus to delete a command queue
US20150149741A1 (en) Storage System and Control Method Thereof
CN111258932A (en) Method for accelerating UFS protocol processing and storage controller
US11494318B2 (en) Controller and operation method thereof
CN105389268B (en) Data storage system and its operation method
CN109213423B (en) Address barrier-based lock-free processing of concurrent IO commands
US10324622B2 (en) Data storage device and operating method thereof
CN108628759B (en) Method and apparatus for out-of-order execution of NVM commands
CN111176726A (en) Configurable command cancellation method and device thereof
CN110515861B (en) Memory device for processing flash command and method thereof
US10268388B2 (en) Access control method, storage device, and system
US20060277326A1 (en) Data transfer system and method

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