CN116149559A - Queue processing method, device, server, electronic equipment and storage medium - Google Patents

Queue processing method, device, server, electronic equipment and storage medium Download PDF

Info

Publication number
CN116149559A
CN116149559A CN202310146480.1A CN202310146480A CN116149559A CN 116149559 A CN116149559 A CN 116149559A CN 202310146480 A CN202310146480 A CN 202310146480A CN 116149559 A CN116149559 A CN 116149559A
Authority
CN
China
Prior art keywords
queue
current completion
commit
control register
completion queue
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
CN202310146480.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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310146480.1A priority Critical patent/CN116149559A/en
Publication of CN116149559A publication Critical patent/CN116149559A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • 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
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • 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/30098Register arrangements
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a queue processing method, a queue processing device, a server, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a backpressure enabling identifier, the number of idle entries of a current completion queue and a preset backpressure threshold corresponding to the current completion queue; setting the read-write state of a control register corresponding to a commit queue corresponding to the current completion queue to be unreadable under the condition that the backpressure enabling identifier is true and the number of idle entries is smaller than the preset backpressure threshold; the read-write state of the control register corresponding to the commit queue is used for controlling the storage device to acquire a data read-write command issued by the host device from the commit queue. The queue processing method, the queue processing device, the server, the electronic equipment and the storage medium can prevent overtime of data reading and writing and improve the efficiency of data reading and writing.

Description

Queue processing method, device, server, electronic equipment and storage medium
Technical Field
The present application relates to the technical field of servers, and in particular, to a queue processing method, a queue processing device, a server, an electronic device, and a storage medium.
Background
With the continuous improvement of the performance requirements of the storage devices in the industry, an NVMe (Non Volatile Memory express, nonvolatile memory host controller interface specification) SSD (Solid State Drive, solid state disk) with better read-write performance is becoming a mainstream device of the storage world. NVMe SSD adopts NVMe protocol specifications, which are not only logical protocol interfaces, but also an instruction standard, a specified protocol. In this protocol, the storage device implements instruction and data interaction with the host device through SQ (commit Queue), CQ (Completion Queue), and DB (Doorbell, queue Doorbell). In brief, the host device places the prepared command into the SQ, and notifies the storage device to fetch the command from the SQ through the DB; after the storage device finishes processing the command, a completion message is placed in the CQ, and the host device is informed of the completion of the command processing through the DB.
For faster processing speed, greater data throughput, the NVMe protocol supports a 64K (upper limit of protocol support) sized queue number and a 64K sized queue depth, which can be flexibly set by the host device through commands. When the SSD is in a high-pressure IO (Input Output) service scenario, the CQ may be in a "full" state, and at this time, the storage device cannot place a completion message in the CQ, and if the host device cannot receive the completion message of the command for a long time, an IO timeout error may be generated.
To address this problem, the industry typically retransmits commands that have not been previously issued while waiting for CQ to have space available through a retransmission mechanism. However, in the large-pressure service scenario, there are many commands that need to be retransmitted, and the technical problem of overtime of data reading and writing cannot be effectively solved.
Disclosure of Invention
The application provides a queue processing method, a queue processing device, a server, electronic equipment and a storage medium, which are used for solving the technical problem of data read-write timeout errors in the prior art.
The application provides a queue processing method, which comprises the following steps:
acquiring a backpressure enabling identifier, the number of idle entries of a current completion queue and a preset backpressure threshold corresponding to the current completion queue;
setting the read-write state of a control register corresponding to a commit queue corresponding to the current completion queue to be unreadable under the condition that the backpressure enabling identifier is true and the number of idle entries is smaller than the preset backpressure threshold;
the read-write state of the control register corresponding to the commit queue is used for controlling the storage device to acquire a data read-write command issued by the host device from the commit queue.
According to the queue processing method provided by the application, before the back pressure enabling identifier, the number of idle entries of the current completion queue and the preset back pressure threshold corresponding to the current completion queue are obtained, the method includes:
determining a preset back pressure threshold corresponding to the current completion queue based on the number of data read-write commands processed by the storage device and/or the queue depth of the current completion queue;
and writing a preset back pressure threshold corresponding to the current completion queue into a first control register corresponding to the current completion queue.
According to the queue processing method provided by the application, after writing the preset back pressure threshold corresponding to the current completion queue into the first control register corresponding to the current completion queue, the method includes:
determining a commit queue corresponding to the current completion queue based on queue creation information in the host device;
acquiring a queue identifier of the submitting queue;
and writing the queue identification of the submitting queue into a second control register corresponding to the current completion queue.
According to the queue processing method provided by the application, after the queue identifier of the submitted queue is written into the second control register corresponding to the current completion queue, the method includes:
the backpressure enable identifier is set to true and written to the completion queue management control register.
According to the queue processing method provided by the application, the setting of the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue to be unreadable includes:
acquiring a queue identifier of a commit queue corresponding to the current completion queue based on a second control register corresponding to the current completion queue;
and determining a control register corresponding to the commit queue based on the queue identification of the commit queue corresponding to the current completion queue, and setting the read-write state of the control register corresponding to the commit queue to be unreadable.
According to the queue processing method provided by the application, after the back pressure enabling identifier, the number of idle entries of the current completion queue and the preset back pressure threshold corresponding to the current completion queue are obtained, the method includes:
and setting the read-write state of a control register corresponding to a commit queue corresponding to the current completion queue to be readable under the condition that the backpressure enabling identifier is false or the number of the idle entries is greater than or equal to the preset backpressure threshold, so that the storage device obtains a data read-write command issued by the host device from the commit queue.
According to one queue processing method provided by the present application,
the application also provides a queue processing device, which comprises:
the system comprises an acquisition unit, a counter pressure starting identifier, a current completion queue and a preset counter pressure threshold corresponding to the current completion queue, wherein the acquisition unit is used for acquiring the counter pressure starting identifier, the number of idle entries of the current completion queue and the preset counter pressure threshold corresponding to the current completion queue;
the processing unit is used for setting the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue to be unreadable under the condition that the backpressure enabling identifier is true and the number of the idle entries is smaller than the preset backpressure threshold;
the read-write state of the control register corresponding to the commit queue is used for controlling the storage device to acquire a data read-write command issued by the host device from the commit queue.
The application also provides a server comprising a processor;
the processor is provided with the queue processing device.
The application also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing any of the queue processing methods described above when executing the program.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a queue processing method as described in any one of the above.
The queue processing method, the queue processing device, the server, the electronic equipment and the storage medium can identify whether the host equipment issues a command for starting back pressure or not by acquiring the back pressure starting identifier; the occupation condition of the entries of the current completion queue can be judged by acquiring the number of the idle entries of the current completion queue and a preset back pressure threshold corresponding to the current completion queue; when the counter-pressure enabling identifier is true and the number of free entries is smaller than a preset counter-pressure threshold value, namely, when the entries of the current completion queue are about to be occupied by the completion message, the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue is set to be unreadable, so that the storage device can be prevented from acquiring new data read-write commands of the commit queue, buffer time is provided for the storage device and the commit queue, after the storage device finishes processing the data read-write commands, the completion message can be placed into the completion queue in time, the host device can timely receive the completion message of the commands, and the occurrence of data read-write timeout errors is prevented.
Drawings
For a clearer description of the present application or of the prior art, the drawings that are used in the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow diagram of a queue processing method provided herein;
FIG. 2 is a second flow chart of the queue processing method provided in the present application;
FIG. 3 is a schematic diagram of a queue processing apparatus provided herein;
FIG. 4 is a schematic diagram of a server provided herein;
fig. 5 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is apparent that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that the terms "first," "second," and the like herein are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic flow chart of a queue processing method provided in the present application, and as shown in fig. 1, the method includes a step 110 and a step 120.
Step 110, acquiring a backpressure enabling identifier, the number of free entries of the current completion queue, and a preset backpressure threshold corresponding to the current completion queue.
Specifically, the execution body of the queue processing method provided in the embodiment of the present application is a queue processing device, and the device may be a hardware device independently set in a host device, or may be a software program running in the host device.
The backpressure-enabled identifier is an identifier that is used to determine whether to backpressure an operation of the storage device to obtain a data read-write command. The back pressure refers to the rate at which the storage device processes the data read-write command and does not keep up with the rate at which the host device sends the data read-write command, and the storage device needs to be limited to acquire the data read-write command, i.e. the operation that the storage device acquires the data read-write command issued by the host device from the commit queue is prevented.
For example, the backpressure enabling identifier may be "True (TURE)" or "FALSE (FALSE)", if the backpressure enabling identifier is "true", that is, the host device issues a command for enabling backpressure, the queue processing device will determine whether to backpressure the operation of the storage device to obtain the data read-write command, based on the current system environment; if the back pressure enabling identifier is false, that is, the host device does not issue a command for enabling back pressure, the queue processing device does not back pressure the operation of the storage device for acquiring the data read-write command.
The number of free entries is the number of completion messages of the data read-write commands that the current completion queue is also capable of receiving from the storage device. The completion queue includes a plurality of entries, and a command may occupy an entry. The fewer the number of free entries, the greater the processing pressure of the storage device; the greater the number of free entries, the less processing pressure the storage device is.
For example, the completion queue includes 10 entries, where 4 entries in the current completion queue are occupied by the completion message of the data read-write command, and the remaining 6 entries are unoccupied, and the 6 entries are free entries, and the number of free entries is 6.
The preset back pressure threshold is used for measuring whether the storage device continues to acquire the data read-write command from the commit queue corresponding to the current completion queue.
If the number of the free items is smaller than a preset back pressure threshold, namely more items in the current completion queue are occupied by the completion message of the data read-write command, in order to prevent the items in the current completion queue from being occupied by the completion message completely, the completion message cannot be placed in the current completion queue continuously, namely the current completion queue is blocked, the queue processing device can back pressure the operation of acquiring the data read-write command by the storage device; if the number of the free entries is greater than or equal to the preset back pressure threshold, that is, more entries which are not occupied by the completion message in the current completion queue, in order to improve the data reading and writing efficiency, the queue processing device may not back pressure the operation of acquiring the data reading and writing command by the storage device.
The queue processing device can back-pressure the operation of the storage device for acquiring the data read-write command by acquiring the back-pressure enabling identifier, the number of idle entries of the current completion queue and a preset back-pressure threshold corresponding to the current completion queue.
In step 120, in the case that the backpressure enabling identifier is true and the number of free entries is smaller than the preset backpressure threshold, the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue is set to be unreadable.
The read-write state of the control register corresponding to the commit queue is used for controlling the storage device to acquire a data read-write command issued by the host device from the commit queue.
Specifically, the storage device in the embodiment of the application may be a solid state disk adopting NVMe protocol specifications.
The host device may be a variety of electronic devices including, but not limited to, smartphones, tablets, laptop portable computers, desktop computers, servers, and the like. The host device can be connected with the storage device through the interface, and read and write data of the storage device.
The control register corresponding to the commit queue is used for indicating the storage device to acquire the data read-write command of the commit queue.
The read-write state of the control register corresponding to the commit queue includes readable and unreadable. If the read-write state is readable, the storage device can acquire a data read-write command of the submitting queue through the control register; if the read-write state is unreadable, the storage device cannot acquire the data read-write command of the commit queue through the control register.
The correspondence between the commit queue and the completion queue may be set according to the specific situation. For example, one commit queue may correspond to one completion queue; multiple commit queues may also correspond to a completion queue.
And under the condition that the backpressure enabling identifier is true and the number of idle entries is smaller than a preset backpressure threshold, the queue processing device sets the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue to be unreadable, and the storage device cannot acquire the data read-write command of the commit queue.
According to the queue processing method provided by the embodiment of the application, whether the host equipment issues a command for enabling the back pressure can be identified by acquiring the back pressure enabling identifier; the occupation condition of the entries of the current completion queue can be judged by acquiring the number of the idle entries of the current completion queue and a preset back pressure threshold corresponding to the current completion queue; when the counter-pressure enabling identifier is true and the number of free entries is smaller than a preset counter-pressure threshold value, namely, when the entries of the current completion queue are about to be occupied by the completion message, the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue is set to be unreadable, so that the storage device can be prevented from acquiring new data read-write commands of the commit queue, buffer time is provided for the storage device and the commit queue, after the storage device processes the data read-write commands, the completion message can be timely placed into the completion queue, the host device can timely receive the completion message of the commands, the occurrence of data read-write timeout error is prevented, the operation steps of queue processing are reduced, and the data read-write efficiency is improved.
Based on the above embodiment, step 110 further includes:
determining a preset back pressure threshold corresponding to the current completion queue based on the number of data read-write commands processed by the storage device and/or the queue depth of the current completion queue;
and writing a preset back pressure threshold corresponding to the current completion queue into a first control register corresponding to the current completion queue.
Specifically, the number of data read/write commands that the storage device can simultaneously process is the maximum number of data read/write commands that the current storage device can simultaneously process.
The setting of the preset back pressure threshold value cannot be too large or too small, and if the setting of the preset back pressure threshold value is too large, the data reading and writing efficiency of the host equipment is reduced; or the preset back pressure threshold value is too small, the technical problem of overtime of data reading and writing can not be solved.
The preset back pressure threshold corresponding to the current completion queue can be determined according to the number of data read-write commands processed by the storage device at the same time and/or the queue depth of the current completion queue.
For example, if the number of data read-write commands processed by the storage device is 10, the preset back pressure threshold is 6, and the number of free entries in the current completion queue is 7, the number of free entries in the current completion queue is greater than the preset back pressure threshold, and the queue processing device does not perform back pressure in the process of processing the queue. If the storage device processes 10 data read-write commands simultaneously and prepares to place the completion messages of the 10 data read-write commands simultaneously in the current completion queue, but at this time, the number of free entries in the current completion queue does not support the completion messages for placing the 10 data read-write commands, and an alarm occurs to the queue processing device. Therefore, if the preset back pressure threshold value is smaller than the number of the data read-write commands processed by the storage device at the same time, the risk of the alarm of the queue processing device is larger.
For example, if the number of data read-write commands processed by the storage device is 5, the preset back pressure threshold is 15, and the number of free entries in the current completion queue is 10, the number of free entries in the current completion queue is smaller than the preset back pressure threshold, the queue processing device will perform back pressure in the process of processing the queue, if the storage device processes 10 data read-write commands simultaneously, the storage device can also be placed simultaneously to the current completion queue to support the placement of the completion message of the 10 data read-write commands, but because the back pressure causes the storage device to be unable to continue to read the data read-write commands from the commit queue, the computing resource is idle, and the efficiency of data read-write is reduced.
Thus, the preset backpressure threshold may be set to the number of data read and write commands that the storage device is processing at the same time.
The queue depth is the number of all entries that can place completion messages in the current completion queue. If the preset back pressure threshold is greater than the queue depth of the current completion queue, the queue processing device can give an alarm.
For example, the preset back pressure threshold is 10, the queue depth of the current completion queue is 5, and the completion message of one data read/write command occupies one entry of the current completion queue. If the storage device acquires 8 data read-write commands from the submitting queue, the storage device processes the 8 data read-write commands simultaneously and processes the 8 data read-write commands simultaneously, and the completion message of the 8 data read-write commands needs to occupy 8 entries of the current completion queue, but the depth of the current completion queue is 5, and the completion message of the 8 data read-write commands cannot be placed even if the entries of the current completion queue are idle entries, so that an alarm can appear in the queue processing device.
Thus, the preset backpressure threshold should be less than the queue depth of the current completion queue.
And after determining a preset back pressure threshold corresponding to the current completion queue, writing the back pressure threshold into a first control register corresponding to the current completion queue. The preset backpressure threshold may be obtained by parsing the first control register.
According to the queue processing method, the number of the data read-write commands and/or the queue depth of the current completion queue are processed by the storage device at the same time, the preset back pressure threshold corresponding to the current completion queue can be determined, the back pressure can be performed on the operation of the storage device for acquiring the data read-write commands in time by setting the preset back pressure threshold, the data read-write efficiency is improved, and the data read-write overtime is prevented.
Based on any of the foregoing embodiments, after writing the preset backpressure threshold corresponding to the current completion queue into the first control register corresponding to the current completion queue, the method further includes:
determining a commit queue corresponding to the current completion queue based on queue creation information in the host device;
acquiring a queue identifier of a submitting queue;
and writing the queue identification of the submitted queue into a second control register corresponding to the current completion queue.
Specifically, the commit queue and the completion queue are both created by the host device, and the commit queue corresponding to the current completion queue may be determined according to the queue creation message in the host device, where the current completion queue may correspond to only one commit queue or may correspond to multiple commit queues.
The queue identifier of the submitting queue is a unique identifier capable of identifying the submitting queue, namely, the unique submitting queue corresponding to the queue identifier can be determined through the queue identifier. The queue identification of the commit queue may be address information of the commit queue.
The queue processing device obtains the queue identification of the commit queue corresponding to the current completion queue, writes the queue identification into the second control register corresponding to the current completion queue, and can obtain the commit queue corresponding to the current completion queue by analyzing the second control register.
According to the queue processing method, the submitted queue and the completion queue are corresponding, so that the operation of the storage device for acquiring the data read-write command issued by the host device from the submitted queue corresponding to the current completion queue can be effectively back-pressed, and the data read-write efficiency is improved.
Based on any of the above embodiments, after writing the queue identifier of the commit queue into the second control register corresponding to the current completion queue, the method includes:
the backpressure enable identifier is set to true and written to the completion queue management control register.
Specifically, the back pressure enabling identifier is set to true, that is, the host device may issue a command for enabling back pressure, the back pressure enabling identifier is written into the completion queue management control register, at this time, the completion queue management control register can determine that the host device issues the command for enabling back pressure, and the queue processing device determines whether to prevent the storage device from acquiring the data read-write command issued by the host device from the commit queue through further judgment on the current system environment.
According to the queue processing method, the back pressure enabling identifier is written into the completion queue management control register, whether the host equipment issues a command for enabling back pressure or not can be determined through the completion queue management control register, whether the storage equipment is prevented from acquiring a data read-write command issued by the host equipment from the submission queue or not is further determined, and the data read-write efficiency is improved.
Based on any of the above embodiments, step 120 includes:
acquiring a queue identifier of a commit queue corresponding to the current completion queue based on a second control register corresponding to the current completion queue;
and determining a control register corresponding to the commit queue based on the queue identification of the commit queue corresponding to the current completion queue, and setting the read-write state of the control register corresponding to the commit queue to be unreadable.
Specifically, under the condition that the backpressure enabling identifier is true and the number of idle entries is smaller than a preset backpressure threshold, the queue processing device analyzes a second control register corresponding to a current completion queue to obtain queue identifiers of a commit queue corresponding to the current completion queue, and because the commit queue and the queue identifiers are in one-to-one correspondence, the commit queue and the control register corresponding to the commit queue can be determined through the obtained queue identifiers of the commit queue corresponding to the current completion queue, and the read-write state of the control register corresponding to the commit queue is set to be unreadable.
Under the condition that the read-write state of the control register corresponding to the commit queue is unreadable, the storage device cannot read the control register corresponding to the commit queue, namely the storage device cannot acquire the data read-write command in the commit queue, and at the moment, the storage device can only process the data read-write command acquired before back pressure, and cannot acquire a new data read-write command from the commit queue.
According to the queue processing method provided by the embodiment of the invention, under the condition that the counter-pressure enabling identifier is true and the number of idle entries is smaller than the preset counter-pressure threshold, the read-write state of the control register corresponding to the submitting queue corresponding to the current completion queue is set to be unreadable, so that the storage device can be prevented from continuously acquiring the data read-write command from the submitting queue, entries in the completion queue are occupied by a large number of data read-write completion messages, the completion queue is in a full state, and when a large number of data read-write commands occur, the technical problem of data read-write overtime can be effectively solved, and the data read-write efficiency is improved.
Based on any of the above embodiments, after step 110, the method further comprises:
and setting the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue to be readable under the condition that the backpressure enabling identifier is false or the number of the idle entries is greater than or equal to a preset backpressure threshold, so that the storage device obtains a data read-write command issued by the host device from the commit queue.
Specifically, in the case that the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue is set to be unreadable, the storage device can only process the data read-write command before back pressure, and cannot acquire a new data read-write command from the commit queue, so that the number of idle entries of the current completion queue can be continuously increased, and in order to prevent resource waste, the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue can be set to be readable under the condition that the number of idle entries is greater than or equal to a preset back pressure threshold.
In addition, the host device may determine the current system environment, determine that the command for enabling the back pressure is no longer issued, and when the back pressure enabling identifier is false, may set the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue to be readable under the condition that the back pressure enabling identifier is false, so that the storage device may acquire the data read-write command issued by the host device from the commit queue.
According to the queue processing method, the read-write state of the control register corresponding to the submitting queue corresponding to the current completion queue is set to be readable under the condition that the counter-pressure enabling identifier is false or the number of idle entries is larger than or equal to the preset counter-pressure threshold, so that the storage device can be timely controlled to acquire the data read-write command issued by the host device from the submitting queue under the condition that the current system environment allows, resource waste is avoided, and the data read-write efficiency is improved.
Fig. 2 is a second flow chart of a queue processing method provided in the present application, and as shown in fig. 2, the method includes steps 210, 220, 230 and 240.
In step 210, the completion queue management control register is queried to obtain the backpressure enable identifier, and it is determined whether the host device issues a backpressure enable command. If the host device issues a command for enabling back pressure, a first control register corresponding to the current completion queue is queried, and a preset back pressure threshold value is obtained.
Step 220, determining whether the number of free entries in the current completion queue is less than a preset backpressure threshold.
Step 230, if the number of free entries in the current completion queue is less than the preset back pressure threshold, setting the read-write status of the control register corresponding to the commit queue to unreadable.
Under the condition that the read-write state of the control register corresponding to the commit queue is unreadable, the storage device cannot acquire the data read-write command of the commit queue until the counter-pressure enabling identifier is false or the number of idle entries is greater than or equal to a preset counter-pressure threshold value, the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue is set to be readable, and the storage device can acquire the data read-write command issued by the host device from the commit queue.
In step 240, if the host device bit does not send a command to enable back pressure and the number of free entries in the current completion queue is greater than or equal to the preset back pressure threshold, when the host device places the data read/write command in the commit queue, the data read/write command is obtained from the commit queue through the queue doorbell, and the data read/write command is sent to the storage device, and after the storage device processes the data read/write command, the completion message is placed in the completion queue through the completion queue engine.
According to the queue processing method, the control register is configured, the preset back pressure threshold value is set, so that the back pressure can be effectively carried out on the operation of the storage device for acquiring the data read-write command issued by the host device from the commit queue corresponding to the current completion queue, and the data read-write efficiency is improved.
Based on the queue processing method, the application also provides a queue processing device. The device will be described in detail below in connection with fig. 3.
Fig. 3 is a schematic structural diagram of a queue processing apparatus provided in the present application, and as shown in fig. 3, the queue processing apparatus in the embodiment of the present application includes an obtaining unit 310 and a processing unit 320.
The obtaining unit 310 is configured to obtain the backpressure enabling identifier, the number of free entries in the current completion queue, and a preset backpressure threshold corresponding to the current completion queue.
The processing unit 320 is configured to set a read-write state of a control register corresponding to a commit queue corresponding to a current completion queue to unreadable when the backpressure enabling identifier is true and the number of free entries is less than a preset backpressure threshold.
The read-write state of the control register corresponding to the commit queue is used for controlling the storage device to acquire a data read-write command issued by the host device from the commit queue.
Specifically, according to an embodiment of the present application, any of the plurality of units in the acquisition unit 310 and the processing unit 320 may be combined and implemented in one unit, or any of the plurality of units may be split into a plurality of units.
Alternatively, at least some of the functionality of one or more of the units may be combined with at least some of the functionality of other units and implemented in one unit.
According to embodiments of the present application, at least one of the acquisition unit 310 and the processing unit 320 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware, such as any other reasonable way of integrating or packaging the circuits, or in any one of or a suitable combination of three of software, hardware, and firmware.
Alternatively, at least one of the acquisition unit 310 and the processing unit 320 may be at least partly implemented as a computer program element, which, when being executed, may perform the respective functions.
The queue processing device provided by the embodiment of the application can identify whether the host equipment issues a command for enabling the back pressure or not by acquiring the back pressure enabling identifier; the occupation condition of the entries of the current completion queue can be judged by acquiring the number of the idle entries of the current completion queue and a preset back pressure threshold corresponding to the current completion queue; when the counter pressure enabling identifier is true and the number of free entries is smaller than a preset counter pressure threshold value, namely, when the entries of the current completion queue are about to be occupied by the completion message, the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue is set to be unreadable, so that the storage device can be prevented from acquiring new data read-write commands of the commit queue, buffer time is provided for the storage device and the commit queue, after the storage device finishes processing the data read-write commands, the completion message can be timely placed into the completion queue, the host device can timely receive the completion message of the commands, the occurrence of data read-write timeout errors is prevented, and the queue processing device provided by the embodiment of the application does not need to use a retransmission mechanism to retransmit the commands which are not sent out, so that the operation steps of queue processing are reduced, and the data read-write efficiency is improved.
Based on any of the above embodiments, the queue processing apparatus further includes a writing unit:
the writing unit is used for determining a preset back pressure threshold corresponding to the current completion queue based on the number of data read-write commands processed by the storage device and/or the queue depth of the current completion queue;
and writing a preset back pressure threshold corresponding to the current completion queue into a first control register corresponding to the current completion queue.
Based on any of the above embodiments, the writing unit is further configured to:
determining a commit queue corresponding to the current completion queue based on queue creation information in the host device;
acquiring a queue identifier of a submitting queue;
and writing the queue identification of the submitted queue into a second control register corresponding to the current completion queue.
Based on any of the above embodiments, the writing unit is further configured to:
the backpressure enable identifier is set to true and written to the completion queue management control register.
Based on any of the above embodiments, the processing unit is specifically configured to:
acquiring a queue identifier of a commit queue corresponding to the current completion queue based on a second control register corresponding to the current completion queue;
and determining a control register corresponding to the commit queue based on the queue identification of the commit queue corresponding to the current completion queue, and setting the read-write state of the control register corresponding to the commit queue to be unreadable.
Based on any of the above embodiments, the obtaining unit is further configured to:
and setting the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue to be readable under the condition that the backpressure enabling identifier is false or the number of the idle entries is greater than or equal to a preset backpressure threshold, so that the storage device obtains a data read-write command issued by the host device from the commit queue.
The application also provides a server. FIG. 4 is a schematic diagram of a server provided herein; as shown in fig. 4, the server 400 includes a processor 410; the processor is provided with the queue processing means 420 described above.
The embodiment of the application provides a server including the queue processing device, so as to implement the queue processing method, where a specific implementation manner of the queue processing device is consistent with that of the foregoing method, and the queue processing device can achieve the same beneficial effects, and is not repeated herein.
Based on any of the above embodiments, fig. 5 is a schematic structural diagram of an electronic device provided in the present application, and as shown in fig. 5, the electronic device may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540 (Communication Bus), wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a queue processing method comprising:
acquiring a backpressure enabling identifier, the number of idle entries of a current completion queue and a preset backpressure threshold corresponding to the current completion queue;
setting the read-write state of a control register corresponding to a commit queue corresponding to a current completion queue to be unreadable under the condition that the backpressure enabling identifier is true and the number of idle entries is smaller than a preset backpressure threshold;
the read-write state of the control register corresponding to the commit queue is used for controlling the storage device to acquire a data read-write command issued by the host device from the commit queue.
Further, the logic instructions in the memory described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application also provides a computer program product, where the computer program product includes a computer program, where the computer program may be stored on a non-transitory computer readable storage medium, and where the computer program when executed by a processor may implement the method provided by the foregoing embodiments.
In yet another aspect, the present application further provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, can implement the method provided by the above embodiments.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the units may be selected according to actual needs to achieve the purposes of the embodiments of the present application. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. A method of queue processing, comprising:
acquiring a backpressure enabling identifier, the number of idle entries of a current completion queue and a preset backpressure threshold corresponding to the current completion queue;
setting the read-write state of a control register corresponding to a commit queue corresponding to the current completion queue to be unreadable under the condition that the backpressure enabling identifier is true and the number of idle entries is smaller than the preset backpressure threshold;
the read-write state of the control register corresponding to the commit queue is used for controlling the storage device to acquire a data read-write command issued by the host device from the commit queue.
2. The queue processing method according to claim 1, wherein before the acquiring the backpressure enabling identifier, the number of free entries of the current completion queue, and the preset backpressure threshold corresponding to the current completion queue, the method comprises:
determining a preset back pressure threshold corresponding to the current completion queue based on the number of data read-write commands processed by the storage device and/or the queue depth of the current completion queue;
and writing a preset back pressure threshold corresponding to the current completion queue into a first control register corresponding to the current completion queue.
3. The queue processing method according to claim 2, wherein after writing the preset back pressure threshold corresponding to the current completion queue into the first control register corresponding to the current completion queue, the method includes:
determining a commit queue corresponding to the current completion queue based on queue creation information in the host device;
acquiring a queue identifier of the submitting queue;
and writing the queue identification of the submitting queue into a second control register corresponding to the current completion queue.
4. A method of queue processing according to claim 3, wherein after writing the queue identifier of the commit queue to the second control register corresponding to the current completion queue, the method comprises:
the backpressure enable identifier is set to true and written to the completion queue management control register.
5. The queue processing method according to claim 1, wherein the setting the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue to be unreadable includes:
acquiring a queue identifier of a commit queue corresponding to the current completion queue based on a second control register corresponding to the current completion queue;
and determining a control register corresponding to the commit queue based on the queue identification of the commit queue corresponding to the current completion queue, and setting the read-write state of the control register corresponding to the commit queue to be unreadable.
6. The queue processing method according to one of claims 1 to 5, wherein after the obtaining the backpressure enabling identifier, the number of free entries of the current completion queue, and the preset backpressure threshold corresponding to the current completion queue, the method comprises:
and setting the read-write state of a control register corresponding to a commit queue corresponding to the current completion queue to be readable under the condition that the backpressure enabling identifier is false or the number of the idle entries is greater than or equal to the preset backpressure threshold, so that the storage device obtains a data read-write command issued by the host device from the commit queue.
7. A queue processing apparatus, comprising:
the system comprises an acquisition unit, a counter pressure starting identifier, a current completion queue and a preset counter pressure threshold corresponding to the current completion queue, wherein the acquisition unit is used for acquiring the counter pressure starting identifier, the number of idle entries of the current completion queue and the preset counter pressure threshold corresponding to the current completion queue;
the processing unit is used for setting the read-write state of the control register corresponding to the commit queue corresponding to the current completion queue to be unreadable under the condition that the backpressure enabling identifier is true and the number of the idle entries is smaller than the preset backpressure threshold;
the read-write state of the control register corresponding to the commit queue is used for controlling the storage device to acquire a data read-write command issued by the host device from the commit queue.
8. A server, comprising a processor;
the processor has the queue processing device according to claim 7.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the queue processing method of any one of claims 1 to 6 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the queue processing method according to any one of claims 1 to 6.
CN202310146480.1A 2023-02-21 2023-02-21 Queue processing method, device, server, electronic equipment and storage medium Pending CN116149559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310146480.1A CN116149559A (en) 2023-02-21 2023-02-21 Queue processing method, device, server, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310146480.1A CN116149559A (en) 2023-02-21 2023-02-21 Queue processing method, device, server, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116149559A true CN116149559A (en) 2023-05-23

Family

ID=86355911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310146480.1A Pending CN116149559A (en) 2023-02-21 2023-02-21 Queue processing method, device, server, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116149559A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116909492A (en) * 2023-09-12 2023-10-20 合肥康芯威存储技术有限公司 Storage device and control method thereof
CN117118924A (en) * 2023-10-24 2023-11-24 苏州元脑智能科技有限公司 Network submission queue monitoring device, method, computer equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116909492A (en) * 2023-09-12 2023-10-20 合肥康芯威存储技术有限公司 Storage device and control method thereof
CN116909492B (en) * 2023-09-12 2023-12-08 合肥康芯威存储技术有限公司 Storage device and control method thereof
CN117118924A (en) * 2023-10-24 2023-11-24 苏州元脑智能科技有限公司 Network submission queue monitoring device, method, computer equipment and storage medium
CN117118924B (en) * 2023-10-24 2024-02-09 苏州元脑智能科技有限公司 Network submission queue monitoring device, method, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US10261853B1 (en) Dynamic replication error retry and recovery
CN116149559A (en) Queue processing method, device, server, electronic equipment and storage medium
WO2019179026A1 (en) Electronic device, method for automatically generating cluster access domain name, and storage medium
EP3457283B1 (en) Centralized error handling in aplication specific integrated circuits
CN115934389A (en) System and method for error reporting and handling
WO2017193964A1 (en) Component upgrade method, apparatus and system
US9377966B2 (en) Method and apparatus for efficiently processing storage commands
CN106681660A (en) IO (input/output) scheduling method and IO scheduling device
US9430338B2 (en) Method and computing device for recording log entries
CN108062224B (en) Data reading and writing method and device based on file handle and computing equipment
CN116361031A (en) Message transmission method, system, device, processor and electronic equipment
CN111309521B (en) FPGA reloading method, FPGA card type equipment and host
CN112748883B (en) IO request pipeline processing device, method, system and storage medium
CN112463037B (en) Metadata storage method, device, equipment and product
CN109710187A (en) Read command accelerated method, device, computer equipment and the storage medium of NVMe SSD main control chip
CN111324668B (en) Database data synchronous processing method, device and storage medium
CN113342698A (en) Test environment scheduling method, computing device and storage medium
CN112506675A (en) Task completion system
US10394673B2 (en) Method and system for hardware accelerated copyback
US20200073759A1 (en) Maximum data recovery of scalable persistent memory
CN111427868B (en) Processing method and device for operation request in database migration and electronic equipment
CN112650445B (en) Method and device for executing Trim by solid state disk
US7568121B2 (en) Recovery from failure in data storage systems
CN112003860B (en) Memory management method, system and medium suitable for remote direct memory access
CN112732176B (en) SSD (solid State disk) access method and device based on FPGA (field programmable Gate array), storage system and storage medium

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