WO2024113996A1 - Optimization method and apparatus for host io processing, device, and nonvolatile readable storage medium - Google Patents
Optimization method and apparatus for host io processing, device, and nonvolatile readable storage medium Download PDFInfo
- Publication number
- WO2024113996A1 WO2024113996A1 PCT/CN2023/115975 CN2023115975W WO2024113996A1 WO 2024113996 A1 WO2024113996 A1 WO 2024113996A1 CN 2023115975 W CN2023115975 W CN 2023115975W WO 2024113996 A1 WO2024113996 A1 WO 2024113996A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- control
- control block
- page table
- host
- ring
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 96
- 238000012545 processing Methods 0.000 title claims abstract description 64
- 238000005457 optimization Methods 0.000 title abstract description 11
- 230000004044 response Effects 0.000 claims abstract description 27
- 230000008569 process Effects 0.000 claims description 36
- 238000004590 computer program Methods 0.000 claims description 11
- 238000004458 analytical method Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 20
- 230000006870 function Effects 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 3
- 238000004064 recycling Methods 0.000 description 3
- 230000001960 triggered effect Effects 0.000 description 3
- 230000003247 decreasing effect Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
- G06F3/0611—Improving I/O performance in relation to response time
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/1009—Address translation using page tables, e.g. page table structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
Definitions
- the present application relates to the field of storage, and in particular to a method, device, equipment and non-volatile readable storage medium for optimizing host IO processing.
- computational storage architecture reduces the corresponding data movement operations by migrating data calculations from the host CPU to the data processing acceleration unit close to the storage unit, thereby achieving the greatest degree of system performance.
- UAA Unified Acceleration Architecture
- PCIe Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard
- control plane is based on a microcode drive architecture to implement acceleration tasks, and flows between various acceleration engine modules in steps.
- CP Control Page
- CB Control Block
- the number of CBs required for an IO has a clear growth trend, and the demand for storage space for CP or CP chain has increased accordingly.
- the number of CPs and CP chains that can be accommodated at the same time by a given size of storage space on the chip has a decreasing trend, resulting in a reduction in the ability to process parallel IO; the processing time of CB processing varies greatly.
- a considerable number of CBs in the CP page table and CP chain corresponding to an IO need to perform DDR (Double Data Rate), hard disk access or complex calculations, which take a long time to complete.
- DDR Double Data Rate
- the occupation of the memory by all the previous CBs that have been executed is meaningless.
- the closer to the tail CB the longer the waiting time, which reduces the efficiency of memory use; from the perspective of IO processing delay, according to the method of creating all CBs and then handing the first CB to UAA for execution, the delay will increase due to the increase in the number of CBs that need to be created.
- the present application proposes a method, device, equipment and non-volatile readable storage medium for optimizing host IO processing.
- a method for optimizing host IO processing On the basis of the definition of a single CP and a chained CP, a ring control page table (ring CP) mode is defined.
- ring CP ring control page table
- all CB storage spaces of a host IO are organized in a ring manner, namely, a control block ring (CB Ring).
- all CBs required for an IO are dynamically generated in batches according to the execution order and filled into the CB Ring. After the execution is completed, they are dynamically recycled until a complete IO process is processed.
- the storage space of the CB Ring can be smaller than the total space required for a complete CB sequence corresponding to an IO, thereby reducing space occupancy; the space can be recycled after the CB is executed, which improves the efficiency of storage space utilization; the use and generation of CBs are dynamic, and only part of the CB needs to be generated to start execution, which reduces the delay of the host IO.
- an embodiment of the present application provides a method for optimizing host IO processing, the method comprising the following steps: obtaining the space size and execution order of the control blocks required by the host IO, and establishing multiple control block rings according to the space size and the execution order; filling the control blocks required by the host IO into the multiple control block rings in batches according to the execution order; in response to the completion of the first batch of filling of the control blocks required by the host IO, starting the execution of the control blocks required by the host IO.
- the method further includes: adding a determination of the ring mode to the definition of the control page table and generating parameter information required for the corresponding control block ring from the control page table of the ring mode to obtain an updated definition of the control page table.
- the determination of the ring mode is added to the definition of the control page table, and the parameter information required for generating the corresponding control block ring from the control page table of the ring mode is obtained to obtain the definition of the updated control page table, including:
- the definition of the additional parameter table is added to the definition of the control page table to obtain the definition of the updated control page table, wherein the definition of the additional parameter table is used to indicate the parameters required for generating the CB in the ring mode.
- the updated control page table includes: a control page table header area, a control block ring control header, a control block storage area, a data cache pointer area, and an original NVMe management and IO instruction backup area.
- the judgment of the annular mode and the parameter information required for generating the corresponding control block ring from the control page table of the annular mode are added to the definition of the control page table, and the definition of the updated control page table includes: updating the definition of the header area of the control page table based on judging whether the current control page table is in annular mode and obtaining the position of the current control page table in the control page linked list; in response to the current control page table being a control page table of annular mode, obtaining the parameter information required for generating the corresponding control block ring from the control page table of the annular mode, and setting the corresponding parameter information in the additional parameter table based on the parameter information, and setting the additional parameter table offset address in the control page table of the annular mode to obtain the starting position of the additional parameter table of the control page table of the annular mode.
- the definition of updating the header area of the control page table based on determining whether the current control page table is in a ring mode and obtaining the position of the current control page table in the control page linked list includes: updating the attribute determination of the control page table based on determining whether the current control page table is in a ring mode; in response to the current control page table being a control page table in a ring mode, obtaining the position of the control page table in the ring mode in the control page linked list, and setting a pointer to the address of the first control block of the next control page table in the control page linked list in the control page table in the ring mode.
- obtaining the space size and execution order of the control block required by the host IO, and establishing multiple control block rings according to the space size and the execution order include: establishing multiple control page tables in a ring mode based on the definition of the updated control page table and the obtained space size and execution order of the control block required by the host IO, and generating corresponding multiple control block rings through the multiple control page tables in a ring mode.
- obtaining the space size and execution order of the control block required by the host IO, and establishing multiple control block rings according to the space size and the execution order also includes: setting an additional parameter table in the control block storage area of the last control page table in the control page linked list in a serial order, for storing the parameter information required for the corresponding control block ring generated by the control page table in the ring mode.
- an additional parameter table is set in the control block storage area of the last control page table of the control page chain list in a serial order to store parameter information required for the corresponding control block ring generated by the control page table in a ring mode, including: in response to the parameter volume of the additional parameter table being larger than the control block storage area of the last control page table, the control block storage area of the previous control page table is occupied in reverse order from the serial order.
- obtaining the space size and execution order of the control block required by the host IO, and establishing multiple control block rings according to the space size and the execution order also includes: setting the control block type corresponding to the mode of the control page table; establishing a control block status mark in the control block header of the control block to execute different processing logic according to different control block status marks.
- a status mark of a control block is established in a control block header of the control block to execute different processing logic according to the status marks of different control blocks, including: setting a control block valid flag, a completion flag, and an end flag, and in response to the valid flag being valid, the completion flag and the end flag exist.
- the valid flag when the valid flag is 1, it indicates that the control block is a legal control block; when the valid flag is 0, it indicates that the control block is an illegal control block.
- the completion flag when the completion flag is 1, it indicates that the control block is a control block that has been executed; when the valid flag is 0, it indicates that the control block is a control block that has not been executed.
- the end flag when the end flag is 1, it indicates that the control block is the control page table for processing an IO process or the last control block of the control page linked list for processing an IO process; when the end flag is 0, it indicates that the control block is not the control page table for processing an IO process or the last control block of the control page linked list for processing an IO process.
- setting the control block type corresponding to the mode of controlling the page table includes: setting a loopback control block flag for the table Indicates that the current control block is located at the end of the linear address of the storage space of the control block ring; sets an active generation control block flag to indicate that the control block behind the current control block has not been generated.
- a generation engine is set for the control block with the active generation control flag to generate the subsequent control block and fill it into the corresponding control block ring.
- filling the control blocks required by the host IO into multiple control block rings in batches according to the execution order includes: creating a first batch of control page tables for the host IO according to the firmware's analysis of the host IO commands, and filling the control blocks into the control block rings corresponding to the first batch of control page tables in sequence according to the execution order; setting the firmware to pass the address of the first filled control block to the work queue of the corresponding engine for queuing and waiting.
- starting the execution of the control blocks required by the host IO includes: in response to detecting an active generation of a control block flag, sending a notification to the firmware through the work queue management engine to complete the first batch of filling of the control blocks, and reclaiming the space corresponding to the first batch of filled control page tables, and starting the execution of the control blocks required by the host IO.
- an embodiment of the present application also provides an optimization device for host IO processing, including the following modules: a first module is configured to obtain the space size and execution order of the control blocks required by the host IO, and establish multiple control block rings according to the space size and the execution order; a second module is configured to fill the control blocks required by the host IO into batches according to the execution order onto the multiple control block rings; a third module is configured to start the execution of the control blocks required by the host IO in response to the completion of the first batch of filling of the control blocks required by the host IO.
- an embodiment of the present application also provides a computer device, including at least one processor; and a memory, the memory storing computer instructions that can be executed on the processor, and the instructions implement the steps of any of the above methods when executed by the processor.
- an embodiment of the present application further provides a non-volatile readable storage medium, which stores a computer program that implements any of the above method steps when executed by a processor.
- the present application has at least the following beneficial effects: the present application proposes a method, device, equipment and non-volatile readable storage medium for optimizing host IO processing, wherein the method for optimizing host IO processing proposed by the present application allows the storage space of the control block ring to be smaller than the total space required for a complete control block sequence corresponding to a host IO by establishing a control block ring, thereby reducing the demand for storage space of the control page table; the control block ring generated under the control page table in the ring mode is based on the granularity of the control page table, so it is flexible, that is, it allows the host IO to balance between performance and efficiency; the control block running on the corresponding control block ring under the control page table in the ring mode reclaims the corresponding space after execution, thereby improving the efficiency of storage space utilization; and the control block is dynamically generated and recycled, so in a host IO, only part of the control block needs to be generated to start serving the IO, thereby reducing the processing delay of
- FIG1 is a schematic diagram showing a general computing architecture
- FIG2 is a schematic diagram showing an embodiment of a method for processing host IO in the related art
- FIG3 is a schematic diagram showing the structure of a single control page table in the related art
- FIG4 is a schematic diagram showing the structure of a chain control page table in the related art.
- FIG5 is a schematic diagram showing an embodiment of a method for optimizing host IO processing provided by the present application
- FIG6 is a schematic diagram showing another embodiment of a method for optimizing host IO processing provided by the present application.
- FIG. 7 is a schematic diagram showing active triggering and triggering scenarios in a method for optimizing host IO processing provided by the present application
- FIG8 is a schematic diagram showing an embodiment of a device for optimizing host IO processing provided by the present application.
- FIG9 is a schematic diagram showing an embodiment of a computer device provided by the present application.
- FIG. 10 is a schematic diagram showing an embodiment of a non-volatile readable storage medium provided in the present application.
- FIG. 1 shows a schematic diagram of a universal computing architecture
- FIG. 2 shows a schematic diagram of an embodiment of a method for processing host IO in the related art
- the size of the control page table (CP) can be 512 bytes, 1024 bytes or 2048 bytes. Except for the CP header, data cache and original host IO instruction backup, the remaining space is used to store the control block CB. All CPs are placed in a continuous memory space, thereby forming a CP resource pool.
- the CP granularity in a single resource pool needs to be consistent, that is, only one CP size can be selected.
- the size of CB can be 16 bytes, 32 bytes, 64 bytes and 128 bytes according to different application engine types. Therefore, the number of CBs that can be carried in a single CP is jointly determined by the size of CP and the size of CB. Therefore, in some complex application scenarios, the length difference of CB chains corresponding to different types of IO is too large, and the selection of CP size will cause certain difficulties. If it is too small, it cannot carry a long CB chain; on the contrary, if the CP granularity is too large, it will cause a certain waste of CP resources.
- AEM Acceleration Engine Manager
- WQS Work Queue Scheduler
- the firmware parses the IO command, creates a CP for this IO operation, and fills the CB of the step-by-step operation into the CP as required.
- the firmware passes the address of the first CB1 (4B wide) to WQS, and WQS puts the CB1 address into the work queue of the corresponding engine for waiting.
- the corresponding engine When the corresponding engine starts to execute the CB1, it performs the corresponding acceleration operation according to the configuration information of CB1. After completion, the execution status is returned to WQS (optionally, the firmware can be notified), and the entry address of the next CB2 is prepared, which is also returned to WQS to enter the work queue of the corresponding engine and wait, and so on.
- the entire transfer process is under the control of WQS hardware, and the firmware does not need to be involved unless necessary.
- the firmware When the last CBX is completed, it is necessary to respond to the host and notify the firmware to reclaim the CP space.
- FIG. 3 shows a schematic diagram of the structure of a single control page table in the related art
- FIG. 4 shows a schematic diagram of the structure of a chain control page table in the related art.
- CP is generally divided into ordinary CP and chain CP.
- Chain CP is introduced on the basis of single CP.
- Ordinary CP adds an 8-byte address pointer pointing to the next chain CP on the basis of the definition of single CP; the size of chain CP is consistent with that of ordinary CP.
- chain CP except for the CP header, the remaining space is used to store CB.
- the number of CPs and CP chains that can be accommodated at the same time by a given size of storage space on the chip is decreasing, resulting in a reduction in the ability to process parallel IO.
- the processing time of CB processing varies greatly. A considerable number of CBs in the CP page table and CP chain corresponding to an IO require DDR (Double Data Rate), hard disk access or complex calculations, which take a long time to complete. During the execution process, the occupation of memory by all the preceding CBs that have been executed is meaningless. On the other hand, for the subsequent CBs waiting to be executed, the closer to the end of the CB, the longer the waiting time, which reduces the efficiency of memory use. From the perspective of IO processing delay, according to the method of creating all CBs and then handing over the first CB to UAA for execution, the delay will increase due to the increase in the number of CBs that need to be created.
- FIG5 shows a schematic diagram of an embodiment of a method for optimizing host IO processing provided by the present application.
- an optimization method for host IO processing in an embodiment of the present application includes the following steps:
- FIG6 shows a schematic diagram of another embodiment of a method for optimizing host IO processing provided by the present application.
- a ring CP mode is proposed.
- a definition of the ring CP mode is added on the basis of the original CP and CB definitions.
- a mark of the ring CP mode is added to the CP attributes;
- the definition of an additional parameter table is added to the definition of the CP page in the ring CP;
- the size of the modified single CP page table can be 512 bytes, 1K bytes or 2K bytes, and it mainly consists of five parts.
- control page header area including:
- CP attributes the type of CP, and whether the CP is in a CP linked list, whether it is a ring CP page mode, and its position in the linked list;
- NVMe Non-Volatile Memory Express
- the 8 bytes include the address pointer to the first CB of the next linked CP;
- CP attribute is the ring CP page mode, it contains 32 bytes of CB Ring control header (control block ring control header):
- Additional parameter table offset address 4 bytes, indicating the starting address of the additional parameter table in a single CP, that is, the relative offset address starting from the address of the first CP;
- a CB storage area (control block storage area) of several bytes corresponds to a CP length of 512B/1KB/2KB.
- the length of the CB storage area is 192 bytes/704 bytes/1728 bytes respectively; when the CP is in other modes, the length of the CB storage area is 224 bytes/738 bytes/1760 bytes respectively.
- the additional parameter table is located in the CB storage area starting from the last CP. If the additional parameter table itself is large, it will occupy the CB storage area of the previous CP in reverse order from the last CP, and the remaining CB storage areas in the CP chain will form a CB ring.
- the modification of CB includes adding CB header flag definition and two new CB types.
- Optional including:
- CB validity flag 1 indicates a legal CB, 0 indicates an illegal CB;
- CB completion flag 1 indicates that the CB has been executed, and 0 indicates that the CB has not been executed;
- Last CB flag 1 indicates that it is the last CB in the CP or CP chain that processes an IO process, and 0 indicates that it is not the last CB.
- the ring CP mode is supported.
- two new CB types are added in the ring:
- Loopback CB i.e. CB Return (CB_R)
- CB_R CB Return
- CB_B The CB that actively generates CB is CB Builder (CB_B).
- CB_B CB Builder
- WQS Work Queue Scheduler
- CB_B is optional.
- FIG7 shows a schematic diagram of active triggering and triggering scenarios in an optimization method for host IO processing provided by the present application.
- WQS is responsible for distributing CBs, and a dedicated software or hardware engine processes the corresponding CBs, and returns the processing results and the address of the next CB to WQS.
- CB Ring mode when the hardware engine that processes the CB submits the next CB, the different CB valid flags, CB completion flags, and Last CB flags in the next CB header are detected to complete different logics such as CB filling and CB processing.
- the optional processing logic is as follows:
- WQS receives the processing result of the current CB and first determines whether the current CB is the last CB, that is, whether the Last CB flag of the current CB is 1. If the Last CB flag of the current CB is 1, the IO process ends and the CP is recycled; otherwise, it determines whether the next CB of the current CB is valid.
- the CB engine finds that the next CB is CB_R, it needs to perform additional processing, that is, relocate to the first CB of the first CP and submit this CB as the next CB to WQS.
- the dynamic generation of CB can be achieved by the firmware in the original UAA architecture. It only needs to change the one-time generation of all CBs to batch generation.
- a dedicated hardware engine can be designed and implemented for dynamic creation and recycling of CBs.
- a typical IO command processing flow working in the ring CP mode includes: First, AEM will follow a certain interface protocol to retrieve the original IO request and notify the firmware through the hardware event queue managed by WQS. After the firmware is notified, it will parse the IO command, create the first batch of CPs for this IO operation, and fill the CBs of the step-by-step operation into the CP as required. After completing the above steps, the firmware will pass the address of the first CB1 (4B wide) to WQS, and WQS will put the CB1 address into the work queue of the corresponding engine for waiting. When an engine processing CB detects CB_B, it will be submitted to the CB generation engine for processing through WQS.
- an engine processing CB When an engine processing CB detects a passive CB filling trigger scenario, it sends a message to the firmware through WQS, and the firmware completes the CB filling. After the firmware fills, it is still handed over to WQS for distribution. When the last CBX is completed, it is necessary to respond to the host and notify the firmware to reclaim the CP space. Active trigger scenarios and passive scenarios are allowed to appear one after another in an IO process, or only one can appear.
- the above method allows the storage space of the control block ring to be smaller than the total space required for the complete control block sequence corresponding to a host IO, thereby reducing the demand for storage space for the control page table;
- the control block ring generated under the control page table in the ring mode is based on the granularity of the control page table, so it is flexible, that is, it allows the host IO to balance between performance and efficiency;
- the control block running on the corresponding control block ring under the control page table in the ring mode reclaims the corresponding space after execution, thereby improving the efficiency of storage space utilization;
- the control block is dynamically generated and recycled, so in a host IO, only part of the control block needs to be generated to start serving the IO, thereby reducing the processing delay of the IO; by setting the loopback control block flag and the active generation control block flag, the CB execution and generation are allowed to proceed synchronously, that is, the time consumption of CB generation is hidden in the execution process of other CBs.
- FIG8 shows a schematic diagram of an embodiment of an optimization device for host IO processing provided by the present application.
- an optimization device for host IO processing provided by the present application includes: a first module 011, which is configured to obtain the space size and execution order of the control block required by the host IO, and establish multiple control block rings according to the space size and execution order; a second module 012, which is configured to fill the control blocks required by the host IO into multiple control block rings in batches according to the execution order; a third module 013, which is configured to complete the first batch of filling in response to the control blocks required by the host IO, and start the execution of the control blocks required by the host IO.
- the optimization device configured for host IO processing also includes being configured to: add a judgment of a ring mode to the definition of a control page table and generate parameter information required for a corresponding control block ring from the control page table of the ring mode, to obtain an updated definition of the control page table.
- the optimization device configured to process host IO also includes being configured to: update the definition of the header area of the control page table based on determining whether the current control page table is in a ring mode and obtaining the position of the current control page table in the control page linked list; in response to the current control page table being a control page table in a ring mode, obtain the parameter information required for the control page table in the ring mode to generate the corresponding control block ring, and set the corresponding parameter information in the additional parameter table based on the parameter information, and set the additional parameter table offset address in the control page table in the ring mode to obtain the starting position of the additional parameter table of the control page table in the ring mode.
- the optimization device configured to process host IO also includes being configured to: update the attribute judgment of the control page table based on whether the current control page table is in a ring mode; in response to the current control page table being a control page table in a ring mode, obtain the position of the control page table in the ring mode in the control page linked list, and set a pointer to the address of the first control block of the next control page table in the control page linked list in the control page table in the ring mode.
- the first module 011 is further configured to: establish multiple ring-mode control page tables based on the definition of the updated control page table and the space size and execution order of the control block required by the acquired host IO, and generate corresponding multiple control block rings through the multiple ring-mode control page tables.
- the first module 011 is further configured to: set an additional parameter table in the control block storage area of the last control page table in the control page chain list in a serial order to store parameter information required for the corresponding control block ring generated by the control page table in the ring mode.
- the first module 011 is further configured to: in response to the parameter volume of the additional parameter table being larger than the control block storage area of the last control page table, occupy the control block storage area of the previous control page table in reverse order of the serial connection sequence.
- the first module 011 is further configured to: set a control block type corresponding to the mode of the control page table; establish a control block status mark in a control block header of the control block to execute different processing logics according to different control block status marks.
- the first module 011 is further configured to: set a control block valid flag, a completion flag, and an end flag, and in response to the valid flag being valid, the completion flag and the end flag being present.
- the first module 011 is further configured to: set a loopback control block flag to indicate that the current control block is located at the end of the linear address of the storage space of the control block ring; set an active generation control block flag to indicate that the control block located after the current control block has not been generated, and in response to calling a control block with an active generation control flag, set a generation engine for the control block with the active generation control flag to generate the subsequent control block and fill it into the corresponding control block ring.
- the second module 012 is further configured to: create a first batch of control page tables for the host IO according to the firmware's analysis of the host IO command, and fill the control blocks into the control block rings corresponding to the first batch of control page tables in sequence according to the execution order; set the firmware to pass the address of the first filled control block to the work queue of the corresponding engine for queuing and waiting.
- the third module 013 is further configured to: in response to detecting an active generation of a control block flag, send a notification to the firmware through the work queue management engine to complete the first batch of filling of the control block, and reclaim the space corresponding to the first batch of filled control page tables, and start the execution of the control block required for the host IO.
- FIG9 shows a schematic diagram of an embodiment of a computer device provided by the present application.
- an embodiment of a computer device provided by the present application includes the following modules: at least one processor 021; and a memory 022, the memory 022 stores computer instructions 023 that can be run on the processor 021, and the computer instructions 023 implement the steps of the above method when executed by the processor 021.
- the present application also provides a non-volatile readable storage medium.
- Figure 10 shows a schematic diagram of an embodiment of a non-volatile readable storage medium provided by the present application.
- the non-volatile readable storage medium 031 stores a computer program 032 that performs the above method when executed by a processor.
- the process in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program of the method for setting system parameters can be stored in a non-volatile readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods.
- the non-volatile readable storage medium of the program can be a magnetic disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc.
- ROM read-only storage memory
- RAM random access memory
- the method disclosed in the embodiment of the present application can also be implemented as a computer program executed by a processor, and the computer program can be stored in a non-volatile readable storage medium.
- the computer program is executed by the processor, the above functions defined in the method disclosed in the embodiment of the present application are performed.
- the above method steps and system units may also be implemented using a controller and a non-volatile readable storage medium configured to store a computer program that enables the controller to implement the above steps or unit functions.
- the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored as one or more instructions or codes on or transmitted through a non-volatile readable storage medium.
- Non-volatile readable storage media include computer storage media and communication media, which include any media that facilitate the transfer of computer programs from one location to another.
- Non-volatile readable storage media may be any available media that can be accessed by a general or special purpose computer.
- the non-volatile readable storage medium may include RAM, ROM, EEPROM, CD ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or any other medium that can be configured to carry or store the required program code in the form of instructions or data structures and can be accessed by a general or special purpose computer or a general or special purpose processor.
- any connection may be appropriately referred to as a non-volatile readable storage medium.
- disks and optical disks include compact disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks, and Blu-ray disks, where disks typically reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of non-volatile readable storage media.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
An optimization method and apparatus for host IO processing, a device, and a nonvolatile readable storage medium, relating to the field of storage. The method comprises: acquiring space sizes and an execution sequence of control blocks required by a host IO, and according to the space sizes and the execution sequence, establishing a plurality of control block rings; according to the execution sequence, filling in batches the plurality of control block rings with the control blocks required by the host IO; and in response to completing the first-batch filling of the control blocks required by the host IO, starting the execution of the control blocks required by the host IO. The present application can improve use efficiency of storage spaces, allow IOs to strike the balance between the performance and efficiency, and reduce the delay of IO processing.
Description
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2022年11月29日提交中国专利局,申请号为202211508344.4,申请名称为“一种对主机IO处理的优化方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application filed with the China Patent Office on November 29, 2022, with application number 202211508344.4 and application name “A method, device, equipment and medium for optimizing host IO processing”, all contents of which are incorporated by reference in this application.
本申请涉及存储领域,尤其涉及一种对主机IO处理的优化方法、装置、设备及非易失性可读存储介质。The present application relates to the field of storage, and in particular to a method, device, equipment and non-volatile readable storage medium for optimizing host IO processing.
随着计算存储(Computational Storage)技术的兴起,计算存储架构通过将数据的计算从主机CPU中迁移到靠近存储单元的数据处理加速单元,减少了相应的数据的搬移操作,进而实现较大程度释放系统的性能。With the rise of computational storage technology, computational storage architecture reduces the corresponding data movement operations by migrating data calculations from the host CPU to the data processing acceleration unit close to the storage unit, thereby achieving the greatest degree of system performance.
相关技术中,一种基于微码驱动的通用计算加速芯片架构中,UAA(Unified Acceleration Architecture,通用加速架构)通过PCIe(Peripheral Component Interconnect express,高速串行计算机扩展总线标准)接口同主机连接,UAA分为控制平而和数据平而两个部分,控制平而基于微码驱动架构以实现加速任务,分步骤地流转于各个加速引擎模块之间。UAA的架构下的CP(Control Page,控制页表)和CB(Control Block,控制块)的主要方式中存在工作效率和性能的问题,可选的,随着存储功能越来越复杂,一个IO(Input/Output,输入/输出)需要的CB个数增长趋势明显,随之而来的是对CP或CP链的存储空间的需求的增长,芯片上给定大小的存储空间能够同时容纳的CP和CP链的个数呈减少趋势,导致了处理并行IO能力的降低;CB处理的处理时间差异很大,一个IO对应的CP页表和CP链中有相当一部分CB需要进行DDR(Double Data Rate,双倍速率)、硬盘访问或复杂运算,这些操作需要耗费较长的时间才能完成,在执行过程中,所有已经执行完成的前序CB对存储器的占用是没有意义的,另一方而,对于后续等待被执行的CB,越趋向尾部的CB,等待的时间越久,进而降低了存储器的使用效率;从IO处理延迟角度考虑,按照创建完成所有CB后再把第一个CB交由UAA执行的方式,由于需要创建的CB个数增多,延迟也会增加。In the related technology, in a general computing acceleration chip architecture based on microcode drive, UAA (Unified Acceleration Architecture) is connected to the host through a PCIe (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard) interface. UAA is divided into two parts: a control plane and a data plane. The control plane is based on a microcode drive architecture to implement acceleration tasks, and flows between various acceleration engine modules in steps. There are problems with work efficiency and performance in the main modes of CP (Control Page) and CB (Control Block) under the UAA architecture. Optionally, as storage functions become more and more complex, the number of CBs required for an IO (Input/Output) has a clear growth trend, and the demand for storage space for CP or CP chain has increased accordingly. The number of CPs and CP chains that can be accommodated at the same time by a given size of storage space on the chip has a decreasing trend, resulting in a reduction in the ability to process parallel IO; the processing time of CB processing varies greatly. A considerable number of CBs in the CP page table and CP chain corresponding to an IO need to perform DDR (Double Data Rate), hard disk access or complex calculations, which take a long time to complete. During the execution process, the occupation of the memory by all the previous CBs that have been executed is meaningless. On the other hand, for the subsequent CBs waiting to be executed, the closer to the tail CB, the longer the waiting time, which reduces the efficiency of memory use; from the perspective of IO processing delay, according to the method of creating all CBs and then handing the first CB to UAA for execution, the delay will increase due to the increase in the number of CBs that need to be created.
发明内容Summary of the invention
有鉴于此,本申请提出了一种对主机IO处理的优化方法、装置、设备及非易失性可读存储介质。其中,为了提高CP存储空间的使用效率和降低IO处理延迟,本申请提出了一种对主机IO处理的优化方法,在单个CP和链式CP定义的基础上,定义了环形控制页表(环形CP)模式,当CP或CP链使用环形控制页表模式时,一个主机IO的所有CB存储空间以环形的方式组织,即为控制块环(CB Ring)。在CB Ring模式下,一个IO所需的所有CB按照执行顺序动态的分批产生并填充至到CB Ring,执行完成后再动态回收,直到一个完整的IO流程处理完毕。CB Ring的存储空间可以小于一个IO对应的完整CB序列所需要的总空间,因此减少了空间占用;CB执行完毕后空间可以回收,提高了存储空间使用效率;CB的使用和生成是动态的,只需要生成部分CB就可以开始执行,降低了主机IO的延迟。In view of this, the present application proposes a method, device, equipment and non-volatile readable storage medium for optimizing host IO processing. Among them, in order to improve the utilization efficiency of CP storage space and reduce IO processing delay, the present application proposes a method for optimizing host IO processing. On the basis of the definition of a single CP and a chained CP, a ring control page table (ring CP) mode is defined. When the CP or CP chain uses the ring control page table mode, all CB storage spaces of a host IO are organized in a ring manner, namely, a control block ring (CB Ring). In the CB Ring mode, all CBs required for an IO are dynamically generated in batches according to the execution order and filled into the CB Ring. After the execution is completed, they are dynamically recycled until a complete IO process is processed. The storage space of the CB Ring can be smaller than the total space required for a complete CB sequence corresponding to an IO, thereby reducing space occupancy; the space can be recycled after the CB is executed, which improves the efficiency of storage space utilization; the use and generation of CBs are dynamic, and only part of the CB needs to be generated to start execution, which reduces the delay of the host IO.
第一个方而,基于以上目的,本申请的实施例提供了一种对主机IO处理的优化方法,方法包括以下步骤:获取主机IO所需的控制块的空间大小以及执行顺序,根据空间大小以及执行顺序建立多个控制块环;将主机IO所需的控制块按照执行顺序分批填充到多个控制块环上;响应于主机IO所需的控制块完成首批填充,开启对主机IO的所需的控制块的执行。
First, based on the above purpose, an embodiment of the present application provides a method for optimizing host IO processing, the method comprising the following steps: obtaining the space size and execution order of the control blocks required by the host IO, and establishing multiple control block rings according to the space size and the execution order; filling the control blocks required by the host IO into the multiple control block rings in batches according to the execution order; in response to the completion of the first batch of filling of the control blocks required by the host IO, starting the execution of the control blocks required by the host IO.
在一些实施例中,方法还包括:在控制页表的定义中添加环形模式的判断和由环形模式的控制页表生成对应的控制块环所需的参数信息,得到更新后的控制页表的定义。In some embodiments, the method further includes: adding a determination of the ring mode to the definition of the control page table and generating parameter information required for the corresponding control block ring from the control page table of the ring mode to obtain an updated definition of the control page table.
在一些实施例中,在控制页表的定义中添加环形模式的判断和由环形模式的控制页表生成对应的控制块环所需的参数信息,得到更新后的控制页表的定义,包括:In some embodiments, the determination of the ring mode is added to the definition of the control page table, and the parameter information required for generating the corresponding control block ring from the control page table of the ring mode is obtained to obtain the definition of the updated control page table, including:
在控制页表的定义中增加附加参数表的定义,得到更新后的控制页表的定义,其中,附加参数表的定义用于指示在环形模式下生成CB需要的参数。The definition of the additional parameter table is added to the definition of the control page table to obtain the definition of the updated control page table, wherein the definition of the additional parameter table is used to indicate the parameters required for generating the CB in the ring mode.
在一些实施例中,更新后的控制页表包括:控制页表头区域,控制块环控制头,控制块存放区域,数据缓存指针区域,以及,原始NVMe管理和IO指令备份区域。In some embodiments, the updated control page table includes: a control page table header area, a control block ring control header, a control block storage area, a data cache pointer area, and an original NVMe management and IO instruction backup area.
在一些实施例中,在控制页表的定义中添加环形模式的判断和由环形模式的控制页表生成对应的控制块环所需的参数信息,得到更新后的控制页表的定义包括:基于判断当前控制页表是否为环形模式以及获取当前控制页表在控制页链表中的位置更新控制页表的头区域的定义;响应于当前控制页表为环形模式的控制页表,获取环形模式的控制页表生成对应的控制块环所需的参数信息,并基于参数信息设置附加参数表中的对应参数信息,并在环形模式的控制页表中设置附加参数表偏移地址,以得到环形模式的控制页表的附加参数表的起始位置。In some embodiments, the judgment of the annular mode and the parameter information required for generating the corresponding control block ring from the control page table of the annular mode are added to the definition of the control page table, and the definition of the updated control page table includes: updating the definition of the header area of the control page table based on judging whether the current control page table is in annular mode and obtaining the position of the current control page table in the control page linked list; in response to the current control page table being a control page table of annular mode, obtaining the parameter information required for generating the corresponding control block ring from the control page table of the annular mode, and setting the corresponding parameter information in the additional parameter table based on the parameter information, and setting the additional parameter table offset address in the control page table of the annular mode to obtain the starting position of the additional parameter table of the control page table of the annular mode.
在一些实施例中,基于判断当前控制页表是否为环形模式以及获取当前控制页表在控制页链表中的位置更新控制页表的头区域的定义包括:基于判断当前控制页表是否为环形模式更新控制页表的属性判断;响应于当前控制页表为环形模式的控制页表,获取环形模式的控制页表在控制页链表中的位置,并在环形模式的控制页表中设置指向控制页链表中下一个控制页表的首个控制块的地址的指针。In some embodiments, the definition of updating the header area of the control page table based on determining whether the current control page table is in a ring mode and obtaining the position of the current control page table in the control page linked list includes: updating the attribute determination of the control page table based on determining whether the current control page table is in a ring mode; in response to the current control page table being a control page table in a ring mode, obtaining the position of the control page table in the ring mode in the control page linked list, and setting a pointer to the address of the first control block of the next control page table in the control page linked list in the control page table in the ring mode.
在一些实施例中,获取主机IO所需的控制块的空间大小以及执行顺序,根据空间大小以及执行顺序建立多个控制块环包括:基于更新后的控制页表的定义和获取的主机IO所需的控制块的空间大小以及执行顺序建立多个环形模式的控制页表,通过多个环形模式的控制页表生成对应的多个控制块环。In some embodiments, obtaining the space size and execution order of the control block required by the host IO, and establishing multiple control block rings according to the space size and the execution order include: establishing multiple control page tables in a ring mode based on the definition of the updated control page table and the obtained space size and execution order of the control block required by the host IO, and generating corresponding multiple control block rings through the multiple control page tables in a ring mode.
在一些实施例中,获取主机IO所需的控制块的空间大小以及执行顺序,根据空间大小以及执行顺序建立多个控制块环还包括:按照串接顺序在控制页链表的最后一个控制页表的控制块存放区域设置附加参数表,以用于存放由环形模式的控制页表生成的对应控制块环所需的参数信息。In some embodiments, obtaining the space size and execution order of the control block required by the host IO, and establishing multiple control block rings according to the space size and the execution order also includes: setting an additional parameter table in the control block storage area of the last control page table in the control page linked list in a serial order, for storing the parameter information required for the corresponding control block ring generated by the control page table in the ring mode.
在一些实施例中,按照串接顺序在控制页链表的最后一个控制页表的控制块存放区域设置附加参数表,以用于存放由环形模式的控制页表生成的对应控制块环所需的参数信息包括:响应于附加参数表的参数体积大于最后一个控制页表的控制块存放区域,按照串接顺序逆序向前依次占用前一个控制页表的控制块存放区域。In some embodiments, an additional parameter table is set in the control block storage area of the last control page table of the control page chain list in a serial order to store parameter information required for the corresponding control block ring generated by the control page table in a ring mode, including: in response to the parameter volume of the additional parameter table being larger than the control block storage area of the last control page table, the control block storage area of the previous control page table is occupied in reverse order from the serial order.
在一些实施例中,获取主机IO所需的控制块的空间大小以及执行顺序,根据空间大小以及执行顺序建立多个控制块环还包括:设置与控制页表的模式相对应的控制块类型;在控制块的控制块头中建立控制块的状态标记,以根据不同的控制块的状态标记执行不同的处理逻辑。In some embodiments, obtaining the space size and execution order of the control block required by the host IO, and establishing multiple control block rings according to the space size and the execution order also includes: setting the control block type corresponding to the mode of the control page table; establishing a control block status mark in the control block header of the control block to execute different processing logic according to different control block status marks.
在一些实施例中,在控制块的控制块头中建立控制块的状态标记,以根据不同的控制块的状态标记执行不同的处理逻辑包括:设置控制块有效标志、完成标志以及结束标志,并且响应于有效标志有效,完成标志和结束标志存在。In some embodiments, a status mark of a control block is established in a control block header of the control block to execute different processing logic according to the status marks of different control blocks, including: setting a control block valid flag, a completion flag, and an end flag, and in response to the valid flag being valid, the completion flag and the end flag exist.
在一些实施例中,在有效标志为1时,表示控制块为合法控制块;有效标志为0时,表示控制块为非法控制块。In some embodiments, when the valid flag is 1, it indicates that the control block is a legal control block; when the valid flag is 0, it indicates that the control block is an illegal control block.
在一些实施例中,在完成标志为1时,表示控制块为已执行完成的控制块;在有效标志为0时,表示控制块为尚未执行的控制块。In some embodiments, when the completion flag is 1, it indicates that the control block is a control block that has been executed; when the valid flag is 0, it indicates that the control block is a control block that has not been executed.
在一些实施例中,在结束标志为1时,表示控制块为处理一个IO流程的控制页表或者处理一个IO流程的控制页链表的最后一个控制块;在结束标志为0时,表示控制块不为处理一个IO流程的控制页表或者处理一个IO流程的控制页链表的最后一个控制块。In some embodiments, when the end flag is 1, it indicates that the control block is the control page table for processing an IO process or the last control block of the control page linked list for processing an IO process; when the end flag is 0, it indicates that the control block is not the control page table for processing an IO process or the last control block of the control page linked list for processing an IO process.
在一些实施例中,设置与控制页表的模式相对应的控制块类型包括:设置环回控制块标志,以用于表
示当前控制块位于控制块环的存储空间的线性地址的尾部;设置主动生成控制块标志,以用于表示位于当前控制块的后而的控制块未生成,响应于调用带有主动生成控制标志的控制块,为带有主动生成控制标志的控制块设置生成引擎,以用于生成后而的控制块并填充到对应的控制块环上。In some embodiments, setting the control block type corresponding to the mode of controlling the page table includes: setting a loopback control block flag for the table Indicates that the current control block is located at the end of the linear address of the storage space of the control block ring; sets an active generation control block flag to indicate that the control block behind the current control block has not been generated. In response to calling a control block with an active generation control flag, a generation engine is set for the control block with the active generation control flag to generate the subsequent control block and fill it into the corresponding control block ring.
在一些实施例中,将主机IO所需的控制块按照执行顺序分批填充到多个控制块环上包括:根据固件对主机IO的命令的解析以为主机IO创建第一批控制页表,并按照执行顺序将控制块依次填充到第一批控制页表对应的控制块环上;设置固件将第一个填充的控制块的地址传递给对应引擎的工作队列,以进行排队等待。In some embodiments, filling the control blocks required by the host IO into multiple control block rings in batches according to the execution order includes: creating a first batch of control page tables for the host IO according to the firmware's analysis of the host IO commands, and filling the control blocks into the control block rings corresponding to the first batch of control page tables in sequence according to the execution order; setting the firmware to pass the address of the first filled control block to the work queue of the corresponding engine for queuing and waiting.
在一些实施例中,响应于主机IO所需的控制块完成首批填充,开启对主机IO的所需的控制块的执行包括:响应于检测到主动生成控制块标志,通过工作队列管理引擎向固件发送通知以完成控制块的首批填充,并将首批填充的控制页表对应的空间进行回收,开启对主机IO所需控制块的执行。In some embodiments, in response to the completion of the first batch of filling of control blocks required by the host IO, starting the execution of the control blocks required by the host IO includes: in response to detecting an active generation of a control block flag, sending a notification to the firmware through the work queue management engine to complete the first batch of filling of the control blocks, and reclaiming the space corresponding to the first batch of filled control page tables, and starting the execution of the control blocks required by the host IO.
第二个方而,本申请实施例还提供了一种对主机IO处理的优化装置,包括以下模块:第一模块,被设置为获取主机IO所需的控制块的空间大小以及执行顺序,根据空间大小以及执行顺序建立多个控制块环;第二模块,被设置为将主机IO所需的控制块按照执行顺序分批填充到多个控制块环上;第三模块,被设置为响应于主机IO所需的控制块完成首批填充,开启对主机IO的所需的控制块的执行。On the second aspect, an embodiment of the present application also provides an optimization device for host IO processing, including the following modules: a first module is configured to obtain the space size and execution order of the control blocks required by the host IO, and establish multiple control block rings according to the space size and the execution order; a second module is configured to fill the control blocks required by the host IO into batches according to the execution order onto the multiple control block rings; a third module is configured to start the execution of the control blocks required by the host IO in response to the completion of the first batch of filling of the control blocks required by the host IO.
第三个方而,本申请实施例还提供一种计算机设备,包括至少一个处理器;以及存储器,存储器存储有可在处理器上运行的计算机指令,指令由处理器执行时实现上述任一方法的步骤。On the third aspect, an embodiment of the present application also provides a computer device, including at least one processor; and a memory, the memory storing computer instructions that can be executed on the processor, and the instructions implement the steps of any of the above methods when executed by the processor.
第四个方而,本申请实施例还提供了一种非易失性可读存储介质,非易失性可读存储介质存储有被处理器执行时实现如上任一方法步骤的计算机程序。In a fourth aspect, an embodiment of the present application further provides a non-volatile readable storage medium, which stores a computer program that implements any of the above method steps when executed by a processor.
本申请至少具有以下有益效果:本申请提出一种对主机IO处理的优化方法、装置、设备及非易失性可读存储介质,其中,本申请提出的一种对主机IO处理的优化方法通过建立控制块环,允许控制块环的存储空间小于一个主机IO对应的完整控制块序列所需的总的空间,减少了控制页表对存储空间的需求;在环形模式的控制页表下生成的控制块环是以控制页表的粒度为前提的,因此具有弹性,即允许主机IO在性能和效率之间做平衡;环形模式的控制页表下对应的控制块环上运行控制块在执行完毕后回收对应的空间,提高了存储空间的使用效率;并且控制块是动态生成和回收的,因此在一个主机IO中,只需要生成部分控制块即可开始服务IO,因此降低了IO的处理延迟;进一步,通过设置环回控制块标志和主动生成控制块标志,允许CB执行和生成两个方而同步进行,即把CB生成的耗时隐藏在其他CB的执行过程中。The present application has at least the following beneficial effects: the present application proposes a method, device, equipment and non-volatile readable storage medium for optimizing host IO processing, wherein the method for optimizing host IO processing proposed by the present application allows the storage space of the control block ring to be smaller than the total space required for a complete control block sequence corresponding to a host IO by establishing a control block ring, thereby reducing the demand for storage space of the control page table; the control block ring generated under the control page table in the ring mode is based on the granularity of the control page table, so it is flexible, that is, it allows the host IO to balance between performance and efficiency; the control block running on the corresponding control block ring under the control page table in the ring mode reclaims the corresponding space after execution, thereby improving the efficiency of storage space utilization; and the control block is dynamically generated and recycled, so in a host IO, only part of the control block needs to be generated to start serving the IO, thereby reducing the processing delay of the IO; further, by setting the loopback control block flag and the active generation control block flag, the CB execution and generation are allowed to proceed synchronously, that is, the time consumption of CB generation is hidden in the execution process of other CBs.
为了更清楚地说明本申请实施例或相关技术中的技术方案,下而将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下而描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的实施例。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
图1示出的为通用计算架构的示意图;FIG1 is a schematic diagram showing a general computing architecture;
图2示出的为相关技术中一种对主机IO处理的方法的实施例的示意图;FIG2 is a schematic diagram showing an embodiment of a method for processing host IO in the related art;
图3示出的为相关技术中单个控制页表的结构的示意图;FIG3 is a schematic diagram showing the structure of a single control page table in the related art;
图4示出的为相关技术中链式控制页表的结构的示意图;FIG4 is a schematic diagram showing the structure of a chain control page table in the related art;
图5示出的为本申请提供的一种对主机IO处理的优化方法的实施例的示意图;FIG5 is a schematic diagram showing an embodiment of a method for optimizing host IO processing provided by the present application;
图6示出的为本申请提供的一种对主机IO处理的优化方法的另一实施例的示意图;FIG6 is a schematic diagram showing another embodiment of a method for optimizing host IO processing provided by the present application;
图7示出的为本申请提供的一种对主机IO处理的优化方法中的主动触发和触发场景的示意图;FIG. 7 is a schematic diagram showing active triggering and triggering scenarios in a method for optimizing host IO processing provided by the present application;
图8示出的是本申请提供的一种对主机IO处理的优化装置的实施例的示意图;FIG8 is a schematic diagram showing an embodiment of a device for optimizing host IO processing provided by the present application;
图9示出的是本申请提供的一种计算机设备的实施例的示意图;FIG9 is a schematic diagram showing an embodiment of a computer device provided by the present application;
图10示出的是本申请提供的一种非易失性可读存储介质的实施例的示意图。
FIG. 10 is a schematic diagram showing an embodiment of a non-volatile readable storage medium provided in the present application.
以下描述了本申请的实施例。然而,应该理解,所公开的实施例仅仅是示例,并且其它实施例可以采取各种替代形式。The following describes embodiments of the present application. However, it should be understood that the disclosed embodiments are merely examples and other embodiments may take various alternative forms.
此外,需要说明的是,本申请实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本申请实施例的限定,后续实施例对此不再一一说明。术语“包括”、“包含”或其任何其它变形旨在涵盖非排他性的包括,以使包含一系列要素的过程、方法、物品或装置不仅包括那些要素,也可以包括未明确列出的或这些过程、方法、物品或装置所固有的要素。In addition, it should be noted that all expressions using "first" and "second" in the embodiments of the present application are intended to distinguish two entities with the same name but not the same or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present application. The subsequent embodiments will not explain this one by one. The terms "include", "comprise" or any other variation thereof are intended to cover non-exclusive inclusions, so that a process, method, article or device containing a series of elements includes not only those elements, but may also include elements that are not explicitly listed or inherent to these processes, methods, articles or devices.
下而将结合附图说明本申请的一个或多个实施例。One or more embodiments of the present application will be described below with reference to the accompanying drawings.
参考图1和图2,图1示出的为通用计算架构的示意图,图2示出的为相关技术中一种对主机IO处理的方法的实施例的示意图,在通用计算架构(UAA)中,控制页表(CP)的大小可以是512字节、1024字节或2048字节,这些空间除去CP头、数据缓存和原始主机IO指令备份外,剩下的空间用来存放控制块CB,所有的CP置于一个连续的内存空间,从而形成一个CP资源池,此外,为了方便CP资源池的管理,单一资源池中的CP颗粒度需要保持一致,即只能选定一种CP的大小。CB的大小依据不同的应用引擎类型可以为16字节、32字节、64字节和128字节,因此,单个CP中所能承载的CB的数量受CP的大小和CB的大小共同决定。因此,在有些复杂应用场景,不同类的IO对应的CB链的长度差异过大,CP的大小选定会造成一定的困难,选的过小就无法承载长的CB链条;相反,CP的颗粒度选的过大,则会造成一定CP资源的浪费。Referring to FIG. 1 and FIG. 2, FIG. 1 shows a schematic diagram of a universal computing architecture, and FIG. 2 shows a schematic diagram of an embodiment of a method for processing host IO in the related art. In the universal computing architecture (UAA), the size of the control page table (CP) can be 512 bytes, 1024 bytes or 2048 bytes. Except for the CP header, data cache and original host IO instruction backup, the remaining space is used to store the control block CB. All CPs are placed in a continuous memory space, thereby forming a CP resource pool. In addition, in order to facilitate the management of the CP resource pool, the CP granularity in a single resource pool needs to be consistent, that is, only one CP size can be selected. The size of CB can be 16 bytes, 32 bytes, 64 bytes and 128 bytes according to different application engine types. Therefore, the number of CBs that can be carried in a single CP is jointly determined by the size of CP and the size of CB. Therefore, in some complex application scenarios, the length difference of CB chains corresponding to different types of IO is too large, and the selection of CP size will cause certain difficulties. If it is too small, it cannot carry a long CB chain; on the contrary, if the CP granularity is too large, it will cause a certain waste of CP resources.
一次典型的主机IO过程在UAA的流程,首先,AEM(Acceleration Engine Manager主机接口管理引擎)遵从一定接口协议将原始的IO请求取回,并通过WQS(Work Queue Scheduler工作队列调度引擎)所管理的硬件事件队列来通知固件,固件得到通知后,对IO命令进行解析后,会为此次IO操作创建CP,并将分步操作的CB按要求填入CP中。在完成上述步骤后,固件会将第一个CB1的地址(4B宽)传递给WQS,WQS会将该CB1地址放入对应引擎的工作队列进行排队等待。当对应的引擎开始执行该CB1,则根据CB1的配置信息进行相应的加速操作。在完成后将执行状态返回给WQS(可选的,可以通知固件),并准备好下一个CB2的入口地址,也返回给WQS进入对应引擎的工作队列等待,以此类推。整个流转过程全在WQS硬件控制之下,非必要无需固件参与,当最后一个CBX完成后,需要对主机进行响应,并通知固件进行CP空间的回收。The process of a typical host IO process in UAA is as follows: First, AEM (Acceleration Engine Manager) retrieves the original IO request in accordance with a certain interface protocol, and notifies the firmware through the hardware event queue managed by WQS (Work Queue Scheduler). After receiving the notification, the firmware parses the IO command, creates a CP for this IO operation, and fills the CB of the step-by-step operation into the CP as required. After completing the above steps, the firmware passes the address of the first CB1 (4B wide) to WQS, and WQS puts the CB1 address into the work queue of the corresponding engine for waiting. When the corresponding engine starts to execute the CB1, it performs the corresponding acceleration operation according to the configuration information of CB1. After completion, the execution status is returned to WQS (optionally, the firmware can be notified), and the entry address of the next CB2 is prepared, which is also returned to WQS to enter the work queue of the corresponding engine and wait, and so on. The entire transfer process is under the control of WQS hardware, and the firmware does not need to be involved unless necessary. When the last CBX is completed, it is necessary to respond to the host and notify the firmware to reclaim the CP space.
在图1和图2的基础上,参考图3和图4,图3示出的为相关技术中单个控制页表的结构的示意图;图4示出的为相关技术中链式控制页表的结构的示意图。如图3和图4所示,CP一般分为普通CP和链式CP,在单个CP的基础上引入链式CP,普通CP的是在单个CP的定义的基础上加入一个8字节的指向下个链式CP的地址指针;链式CP的大小和普通CP的大小保持一致,在链式CP里而除了CP头,剩下的空间用来存放CB,在链式CP头内增加了三个8字节大小的链式指针,一个是指向下个链式CP(若有),一个是指向前一个CP,最后一个是直接指向第一个普通CP(方便查找数据缓存等),并且每个CB里而都标识了它在整个CP链中的位置,方便引擎处理时能快速定位到所需的信息。但是随着UAA架构的发展,单个CP和链式CP遇到了工作效率问题和性能问题,可选的,随着存储功能越来越复杂,一个IO需要的CB个数增长趋势明显,随之而来的是对CP或CP链的存储空间的需求的增长,芯片上给定大小的存储空间能够同时容纳的CP和CP链的个数呈减少趋势,导致了处理并行IO能力的降低;CB处理的处理时间差异很大,一个IO对应的CP页表和CP链中有相当一部分CB需要进行DDR(Double Data Rate)、硬盘访问或复杂运算,这些操作需要耗费较长的时间才能完成,在执行过程中,所有已经执行完成的前序CB对存储器的占用是没有意义的,另一方而,对于后续等待被执行的CB,越趋向尾部的CB,等待的时间越久,进而降低了存储器的使用效率;从IO处理延迟角度考虑,按照创建完成所有CB后再把第一个CB交由UAA执行的方式,由于需要创建的CB个数增多,延迟也会增加。On the basis of FIG. 1 and FIG. 2, refer to FIG. 3 and FIG. 4. FIG. 3 shows a schematic diagram of the structure of a single control page table in the related art; FIG. 4 shows a schematic diagram of the structure of a chain control page table in the related art. As shown in FIG. 3 and FIG. 4, CP is generally divided into ordinary CP and chain CP. Chain CP is introduced on the basis of single CP. Ordinary CP adds an 8-byte address pointer pointing to the next chain CP on the basis of the definition of single CP; the size of chain CP is consistent with that of ordinary CP. In chain CP, except for the CP header, the remaining space is used to store CB. Three 8-byte chain pointers are added in the chain CP header, one pointing to the next chain CP (if any), one pointing to the previous CP, and the last one directly pointing to the first ordinary CP (for convenient search of data cache, etc.), and each CB identifies its position in the entire CP chain, so that the engine can quickly locate the required information when processing. However, with the development of UAA architecture, single CP and chain CP have encountered work efficiency and performance problems. Alternatively, as storage functions become more and more complex, the number of CBs required for an IO has a clear growth trend, and with it the demand for storage space for CPs or CP chains. The number of CPs and CP chains that can be accommodated at the same time by a given size of storage space on the chip is decreasing, resulting in a reduction in the ability to process parallel IO. The processing time of CB processing varies greatly. A considerable number of CBs in the CP page table and CP chain corresponding to an IO require DDR (Double Data Rate), hard disk access or complex calculations, which take a long time to complete. During the execution process, the occupation of memory by all the preceding CBs that have been executed is meaningless. On the other hand, for the subsequent CBs waiting to be executed, the closer to the end of the CB, the longer the waiting time, which reduces the efficiency of memory use. From the perspective of IO processing delay, according to the method of creating all CBs and then handing over the first CB to UAA for execution, the delay will increase due to the increase in the number of CBs that need to be created.
基于以上目的,本申请实施例的第一个方而,提出了一种对主机IO处理的优化方法的实施例。图5示出的为本申请提供的一种对主机IO处理的优化方法的实施例的示意图。如图5所示,本申请实施例的一种对主机IO处理的优化方法包括以下步骤:
Based on the above objectives, the first aspect of the embodiment of the present application proposes an embodiment of a method for optimizing host IO processing. FIG5 shows a schematic diagram of an embodiment of a method for optimizing host IO processing provided by the present application. As shown in FIG5, an optimization method for host IO processing in an embodiment of the present application includes the following steps:
S1、获取主机IO所需的控制块的空间大小以及执行顺序,根据空间大小以及执行顺序建立多个控制块环;S1, obtain the space size and execution order of the control block required by the host IO, and establish multiple control block rings according to the space size and execution order;
S2、将主机IO所需的控制块按照执行顺序分批填充到多个控制块环上;S2, filling the control blocks required by the host IO into multiple control block rings in batches according to the execution order;
S3、响应于主机IO所需的控制块完成首批填充,开启对主机IO的所需的控制块的执行。S3. In response to the completion of the first batch of filling of the control blocks required by the host IO, the execution of the control blocks required by the host IO is started.
基于以上目的,本申请实施例的第一个方而,提出了一种对主机IO处理的优化方法的实施例。图6示出的为本申请提供的一种对主机IO处理的优化方法的另一实施例的示意图。如图6所示,在普通CP和链式CP的基础上,提出了一种环形CP模式,为此,在原有的CP和CB定义的基础上添加关于环形CP模式的定义。可选的,为了表示CP是否存在环形CP模式,在CP属性中增加了环形CP模式的标记;其次,在环形CP模式下动态生成CB可能需要的其他参数,所以在环形CP在CP页的定义中增加了附加参数表的定义;修改后的单个CP页表的大小可以是512字节、1K字节或2K字节,主要由五个部分组成。Based on the above purposes, the first aspect of the embodiment of the present application proposes an embodiment of a method for optimizing host IO processing. FIG6 shows a schematic diagram of another embodiment of a method for optimizing host IO processing provided by the present application. As shown in FIG6, on the basis of ordinary CP and chained CP, a ring CP mode is proposed. To this end, a definition of the ring CP mode is added on the basis of the original CP and CB definitions. Optionally, in order to indicate whether the CP has a ring CP mode, a mark of the ring CP mode is added to the CP attributes; secondly, in order to dynamically generate other parameters that may be required for CB in the ring CP mode, the definition of an additional parameter table is added to the definition of the CP page in the ring CP; the size of the modified single CP page table can be 512 bytes, 1K bytes or 2K bytes, and it mainly consists of five parts.
1. 128字节的CP头区域(控制页表头区域),包括:1. 128 bytes of CP header area (control page header area), including:
(1)CP的属性:CP的类型,并标识了该CP是否位于一个CP链表之中、是否是环形CP页模式以及其在链表中的位置等属性信息;(1) CP attributes: the type of CP, and whether the CP is in a CP linked list, whether it is a ring CP page mode, and its position in the linked list;
(2)当前CP的序列号,在创建CP时指定;(2) The serial number of the current CP, which is specified when the CP is created;
(3)NVMe(Non-Volatile Memory express,非易失性内存主机控制器接口规范)队列的相关信息,包括2字节完成队列ID、2字节提交队列ID以及4字节调教队列头信息;(3) Information related to the NVMe (Non-Volatile Memory Express) queue, including a 2-byte completion queue ID, a 2-byte submission queue ID, and a 4-byte training queue header information;
(4)若组成CP链表,8个字节包括指向下一个链式CP的首个CB的地址指针;(4) If a CP linked list is formed, the 8 bytes include the address pointer to the first CB of the next linked CP;
(5)4个64位的时间戳,用于记录该CP执行过程中的关键时间节点;(5) Four 64-bit timestamps, used to record key time nodes during the execution of the CP;
(6)64个字节的空间,预留给固件使用。(6) 64 bytes of space are reserved for firmware.
2.在CP属性为环形CP页模式时,包含CB Ring控制头(控制块环控制头)32字节:2. When the CP attribute is the ring CP page mode, it contains 32 bytes of CB Ring control header (control block ring control header):
(1)附加参数表偏移地址4字节,表示单个CP中附加参数表的起始地址,即是从第一个CP的地址开始的相对偏移地址;(1) Additional parameter table offset address 4 bytes, indicating the starting address of the additional parameter table in a single CP, that is, the relative offset address starting from the address of the first CP;
(2)28字节预留空间。(2) 28 bytes of reserved space.
3.若干字节的CB存放区域(控制块存放区域),对应于512B/1KB/2KB的CP长度,在CP为环形CP页表时,CB存放区域的长度分别为192字节/704字节/1728字节;在CP在其他模式时,CB存放区域长度分别为224字节/738字节/1760字节。3. A CB storage area (control block storage area) of several bytes corresponds to a CP length of 512B/1KB/2KB. When the CP is a circular CP page table, the length of the CB storage area is 192 bytes/704 bytes/1728 bytes respectively; when the CP is in other modes, the length of the CB storage area is 224 bytes/738 bytes/1760 bytes respectively.
4. 64字节的数据缓存指针区域,用于指向公共的数据缓存区。4. 64-byte data cache pointer area, used to point to the common data cache area.
5. 64字节的原始NVMe管理和IO指令备份区域,便于异常发生时,固件介入进行错误的恢复。5. 64-byte raw NVMe management and IO instruction backup area, which facilitates firmware intervention and error recovery when an exception occurs.
可选的,如下表1所示:
Optional, as shown in Table 1 below:
Optional, as shown in Table 1 below:
表1Table 1
在链式CP中,附加参数表的位置位于从最后一个CP开始的CB存放区域。如果附加参数的参数表本身体积较大,则从最后一个CP开始逆序向前依次占用前序CP的CB存放区域,CP链中剩余的CB存放区域组成CB环。In the chained CP, the additional parameter table is located in the CB storage area starting from the last CP. If the additional parameter table itself is large, it will occupy the CB storage area of the previous CP in reverse order from the last CP, and the remaining CB storage areas in the CP chain will form a CB ring.
对于CB的修改,包括增加CB头标志位定义和两种新的CB类型。可选的,包括:The modification of CB includes adding CB header flag definition and two new CB types. Optional, including:
CB有效标志,1表示为合法CB,0表示为非法CB;CB validity flag, 1 indicates a legal CB, 0 indicates an illegal CB;
CB完成标志,1表示为已执行完成的CB,0表示为尚未执行的CB;CB completion flag, 1 indicates that the CB has been executed, and 0 indicates that the CB has not been executed;
Last CB标志,1表示为处理一个IO流程的CP或者CP链中的最后一个CB,0表示不是最后一个CB。Last CB flag, 1 indicates that it is the last CB in the CP or CP chain that processes an IO process, and 0 indicates that it is not the last CB.
以上的CB完成标志和Last CB标志仅当CB有效标志为1时有意义。The above CB completion flag and Last CB flag are only meaningful when the CB valid flag is 1.
除去以上对CB定义的修改为例,支持环形CP模式,环中的CB除了包含原有CB类型,新增两种CB类型:Taking the above modification of CB definition as an example, the ring CP mode is supported. In addition to the original CB types, two new CB types are added in the ring:
环回CB,即CB Return(CB_R),表示当前CB已位于CB Ring存储空间线性地址的尾部,下一个CB需要到第一个CP的CB存储空间的起始位置去获得,对于环形CP模式来说,CB_R是必须要使用的。Loopback CB, i.e. CB Return (CB_R), means that the current CB is located at the end of the linear address of the CB Ring storage space, and the next CB needs to be obtained from the starting position of the CB storage space of the first CP. For the ring CP mode, CB_R must be used.
主动生成CB的CB,即CB Builder(CB_B),此CB出现在CB Ring中时,表示此CB后续的CB尚未生成,WQS(Work Queue Scheduler工作队列调度引擎)调度到此CB时,需要给CB生成引擎(由软件或硬件实现)来处理这个CB,生成后续的CB并填充到CB Ring,对于环形CP模式来说,CB_B是可选的。The CB that actively generates CB is CB Builder (CB_B). When this CB appears in the CB Ring, it means that the subsequent CB of this CB has not been generated yet. When WQS (Work Queue Scheduler) schedules to this CB, it needs to give the CB generation engine (implemented by software or hardware) to process this CB, generate subsequent CBs and fill them into the CB Ring. For the ring CP mode, CB_B is optional.
其中,图7示出的为本申请提供的一种对主机IO处理的优化方法中的主动触发和触发场景的示意图。在UAA框架下,WQS负责分发CB,由专用的软件或硬件引擎处理对应的CB,并把处理结果和下一个CB的地址返回给WQS。在CB Ring模式下,当处理CB的硬件引擎提交下一个CB时,对于下一个CB头中不同的CB有效标志、CB完成标志、Last CB标志进行检测以完成CB填充、CB处理等不同逻辑。可选的处理逻辑如下:Among them, FIG7 shows a schematic diagram of active triggering and triggering scenarios in an optimization method for host IO processing provided by the present application. Under the UAA framework, WQS is responsible for distributing CBs, and a dedicated software or hardware engine processes the corresponding CBs, and returns the processing results and the address of the next CB to WQS. In CB Ring mode, when the hardware engine that processes the CB submits the next CB, the different CB valid flags, CB completion flags, and Last CB flags in the next CB header are detected to complete different logics such as CB filling and CB processing. The optional processing logic is as follows:
1.WQS收到当前CB的处理结果,首先判断当前CB是否为最后一个CB,即判断当前CB的Last CB的标志是否为1。如果当前CB的Last CB的标志是否为1,则IO流程结束,并回收CP;否则判断当前CB的下一个CB是否有效。1. WQS receives the processing result of the current CB and first determines whether the current CB is the last CB, that is, whether the Last CB flag of the current CB is 1. If the Last CB flag of the current CB is 1, the IO process ends and the CP is recycled; otherwise, it determines whether the next CB of the current CB is valid.
2.判断当前CB的下一个CB是否有效,即判断当前CB的下一个CB的有效标志是否为1。如果当前CB的下一个CB的有效标志不为1(为0),此时IO流程虽未结束,但由于缺少后续的CB,所以通知固件进行后续的填充处理,由固件填充后续的CB,更新CB Ring,把下一个CB交给WQS调度,此过程为被动触发的CB的构建
和回收;如果当前CB的下一个CB的有效标志为1,判断当前CB的下一个CB是否已完成。2. Determine whether the next CB of the current CB is valid, that is, determine whether the valid flag of the next CB of the current CB is 1. If the valid flag of the next CB of the current CB is not 1 (is 0), although the IO process is not completed at this time, due to the lack of subsequent CBs, the firmware is notified to perform subsequent filling processing. The firmware fills the subsequent CBs, updates the CB Ring, and hands the next CB to WQS scheduling. This process is the construction of a passively triggered CB. and recycling; if the valid flag of the next CB of the current CB is 1, determine whether the next CB of the current CB has been completed.
3.判断当前CB的下一个CB是否已完成,即判断当前CB的下一个CB的完成标志是否为1。如果当前CB的下一个CB的完成标志为1,此时IO流程虽未结束,但由于缺少后续的CB,所以通知固件进行后续的填充处理,由固件填充后续的CB,更新CB Ring,把下一个CB交给WQS调度,此过程为被动触发的CB的构建和回收;如果当前CB的下一个CB的完成标志不为1,判断当前CB的下一个CB是否为CB_B。3. Determine whether the next CB of the current CB has been completed, that is, determine whether the completion flag of the next CB of the current CB is 1. If the completion flag of the next CB of the current CB is 1, although the IO process is not completed at this time, due to the lack of subsequent CBs, the firmware is notified to perform subsequent filling processing. The firmware fills the subsequent CBs, updates the CB Ring, and hands the next CB to the WQS scheduling. This process is the construction and recycling of passively triggered CBs; if the completion flag of the next CB of the current CB is not 1, determine whether the next CB of the current CB is CB_B.
4.判断当前CB的下一个CB是否为CB_B,如果当前CB的下一个CB为CB_B,由WQS分发CB_B给CB生成引擎,并由CB生成引擎(SW/HW)填充完成后续CB,填充完成后回复WQS完成状态,并把后续CB交给WQS调度,此过程为主动触发的CB的构建和回收过程;如果当前CB的下一个CB不是CB_B,则按照CB的内容调度给对应的引擎。4. Determine whether the next CB of the current CB is CB_B. If the next CB of the current CB is CB_B, WQS distributes CB_B to the CB generation engine, and the CB generation engine (SW/HW) fills the subsequent CB. After the filling is completed, it replies to the WQS completion status and hands the subsequent CB to the WQS for scheduling. This process is the actively triggered CB construction and recovery process; if the next CB of the current CB is not CB_B, it is scheduled to the corresponding engine according to the content of the CB.
当CB引擎发现下一个CB是CB_R时,需要进行额外的处理,即重新定位到第一个CP的第一个CB,并把此CB当作下一个CB提交至WQS。CB的动态生成,可以由原有UAA架构中的固件来实现,只需把一次性全部生成所有CB改为分批生成,为了提高实时性以及降低软件执行过程中时间的不确定性的影响,可以设计和实现专门的硬件引擎,用于CB的动态创建和回收。When the CB engine finds that the next CB is CB_R, it needs to perform additional processing, that is, relocate to the first CB of the first CP and submit this CB as the next CB to WQS. The dynamic generation of CB can be achieved by the firmware in the original UAA architecture. It only needs to change the one-time generation of all CBs to batch generation. In order to improve real-time performance and reduce the impact of time uncertainty during software execution, a dedicated hardware engine can be designed and implemented for dynamic creation and recycling of CBs.
一个典型的工作在环形CP模式下的IO命令处理流程包括:首先,AEM会遵从一定接口协议将原始的IO请求取回,并通过WQS所管理的硬件事件队列来通知固件。固件得到通知后,对IO命令进行解析后,会为此次IO操作创建第一批CP,并将分步操作的CB按要求填入CP中。在完成上述步骤后,固件会将第一个CB1的地址(4B宽)传递给WQS,WQS会将该CB1地址放入对应引擎的工作队列进行排队等待。当处理CB的某个引擎检测到CB_B时,会通过WQS提交给CB生成引擎处理。当处理CB的某个引擎检测到被动CB填充触发场景时,通过WQS向固件发送消息,由固件完成CB填充。固件填充完成后,仍交给WQS进行分发。当最后一个CBX完成后,需要对主机进行响应,并通知固件进行CP空间的回收。主动触发场景和被动场景允许在一个IO流程中先后出现,也可以仅出现一种。A typical IO command processing flow working in the ring CP mode includes: First, AEM will follow a certain interface protocol to retrieve the original IO request and notify the firmware through the hardware event queue managed by WQS. After the firmware is notified, it will parse the IO command, create the first batch of CPs for this IO operation, and fill the CBs of the step-by-step operation into the CP as required. After completing the above steps, the firmware will pass the address of the first CB1 (4B wide) to WQS, and WQS will put the CB1 address into the work queue of the corresponding engine for waiting. When an engine processing CB detects CB_B, it will be submitted to the CB generation engine for processing through WQS. When an engine processing CB detects a passive CB filling trigger scenario, it sends a message to the firmware through WQS, and the firmware completes the CB filling. After the firmware fills, it is still handed over to WQS for distribution. When the last CBX is completed, it is necessary to respond to the host and notify the firmware to reclaim the CP space. Active trigger scenarios and passive scenarios are allowed to appear one after another in an IO process, or only one can appear.
通过以上方法允许控制块环的存储空间小于一个主机IO对应的完整控制块序列所需的总的空间,减少了控制页表对存储空间的需求;在环形模式的控制页表下生成的控制块环是以控制页表的粒度为前提的,因此具有弹性,即允许主机IO在性能和效率之间做平衡;环形模式的控制页表下对应的控制块环上运行控制块在执行完毕后回收对应的空间,提高了存储空间的使用效率;并且控制块是动态生成和回收的,因此在一个主机IO中,只需要生成部分控制块即可开始服务IO,因此降低了IO的处理延迟;通过设置环回控制块标志和主动生成控制块标志,允许CB执行和生成两个方而同步进行,即把CB生成的耗时隐藏在其他CB的执行过程中。The above method allows the storage space of the control block ring to be smaller than the total space required for the complete control block sequence corresponding to a host IO, thereby reducing the demand for storage space for the control page table; the control block ring generated under the control page table in the ring mode is based on the granularity of the control page table, so it is flexible, that is, it allows the host IO to balance between performance and efficiency; the control block running on the corresponding control block ring under the control page table in the ring mode reclaims the corresponding space after execution, thereby improving the efficiency of storage space utilization; and the control block is dynamically generated and recycled, so in a host IO, only part of the control block needs to be generated to start serving the IO, thereby reducing the processing delay of the IO; by setting the loopback control block flag and the active generation control block flag, the CB execution and generation are allowed to proceed synchronously, that is, the time consumption of CB generation is hidden in the execution process of other CBs.
本申请的实施例的第二个方而,提出了一种对主机IO处理的优化装置。图8示出的是本申请提供的一种对主机IO处理的优化装置的实施例的示意图。如图8所示,本申请提供的一种对主机IO处理的优化装置包括:第一模块011,被设置为获取主机IO所需的控制块的空间大小以及执行顺序,根据空间大小以及执行顺序建立多个控制块环;第二模块012,被设置为将主机IO所需的控制块按照执行顺序分批填充到多个控制块环上;第三模块013,被设置为响应于主机IO所需的控制块完成首批填充,开启对主机IO的所需的控制块的执行。The second aspect of the embodiment of the present application proposes an optimization device for host IO processing. FIG8 shows a schematic diagram of an embodiment of an optimization device for host IO processing provided by the present application. As shown in FIG8, an optimization device for host IO processing provided by the present application includes: a first module 011, which is configured to obtain the space size and execution order of the control block required by the host IO, and establish multiple control block rings according to the space size and execution order; a second module 012, which is configured to fill the control blocks required by the host IO into multiple control block rings in batches according to the execution order; a third module 013, which is configured to complete the first batch of filling in response to the control blocks required by the host IO, and start the execution of the control blocks required by the host IO.
在一些实施例中,被设置为对主机IO处理的优化装置还包括被设置为:在控制页表的定义中添加环形模式的判断和由环形模式的控制页表生成对应的控制块环所需的参数信息,得到更新后的控制页表的定义。In some embodiments, the optimization device configured for host IO processing also includes being configured to: add a judgment of a ring mode to the definition of a control page table and generate parameter information required for a corresponding control block ring from the control page table of the ring mode, to obtain an updated definition of the control page table.
在一些实施例中,被设置为对主机IO处理的优化装置还包括被设置为:基于判断当前控制页表是否为环形模式以及获取当前控制页表在控制页链表中的位置更新控制页表的头区域的定义;响应于当前控制页表为环形模式的控制页表,获取环形模式的控制页表生成对应的控制块环所需的参数信息,并基于参数信息设置附加参数表中的对应参数信息,并在环形模式的控制页表中设置附加参数表偏移地址,以得到环形模式的控制页表的附加参数表的起始位置。
In some embodiments, the optimization device configured to process host IO also includes being configured to: update the definition of the header area of the control page table based on determining whether the current control page table is in a ring mode and obtaining the position of the current control page table in the control page linked list; in response to the current control page table being a control page table in a ring mode, obtain the parameter information required for the control page table in the ring mode to generate the corresponding control block ring, and set the corresponding parameter information in the additional parameter table based on the parameter information, and set the additional parameter table offset address in the control page table in the ring mode to obtain the starting position of the additional parameter table of the control page table in the ring mode.
在一些实施例中,被设置为对主机IO处理的优化装置还包括被设置为:基于判断当前控制页表是否为环形模式更新控制页表的属性判断;响应于当前控制页表为环形模式的控制页表,获取环形模式的控制页表在控制页链表中的位置,并在环形模式的控制页表中设置指向控制页链表中下一个控制页表的首个控制块的地址的指针。In some embodiments, the optimization device configured to process host IO also includes being configured to: update the attribute judgment of the control page table based on whether the current control page table is in a ring mode; in response to the current control page table being a control page table in a ring mode, obtain the position of the control page table in the ring mode in the control page linked list, and set a pointer to the address of the first control block of the next control page table in the control page linked list in the control page table in the ring mode.
在一些实施例中,第一模块011进一步被设置为:基于更新后的控制页表的定义和获取的主机IO所需的控制块的空间大小以及执行顺序建立多个环形模式的控制页表,通过多个环形模式的控制页表生成对应的多个控制块环。In some embodiments, the first module 011 is further configured to: establish multiple ring-mode control page tables based on the definition of the updated control page table and the space size and execution order of the control block required by the acquired host IO, and generate corresponding multiple control block rings through the multiple ring-mode control page tables.
在一些实施例中,第一模块011进一步被设置为:按照串接顺序在控制页链表的最后一个控制页表的控制块存放区域设置附加参数表,以用于存放由环形模式的控制页表生成的对应控制块环所需的参数信息。In some embodiments, the first module 011 is further configured to: set an additional parameter table in the control block storage area of the last control page table in the control page chain list in a serial order to store parameter information required for the corresponding control block ring generated by the control page table in the ring mode.
在一些实施例中,第一模块011进一步被设置为:响应于附加参数表的参数体积大于最后一个控制页表的控制块存放区域,按照串接顺序逆序向前依次占用前一个控制页表的控制块存放区域。In some embodiments, the first module 011 is further configured to: in response to the parameter volume of the additional parameter table being larger than the control block storage area of the last control page table, occupy the control block storage area of the previous control page table in reverse order of the serial connection sequence.
在一些实施例中,第一模块011进一步被设置为:设置与控制页表的模式相对应的控制块类型;在控制块的控制块头中建立控制块的状态标记,以根据不同的控制块的状态标记执行不同的处理逻辑。In some embodiments, the first module 011 is further configured to: set a control block type corresponding to the mode of the control page table; establish a control block status mark in a control block header of the control block to execute different processing logics according to different control block status marks.
在一些实施例中,第一模块011进一步被设置为:设置控制块有效标志、完成标志以及结束标志,并且响应于有效标志有效,完成标志和结束标志存在。In some embodiments, the first module 011 is further configured to: set a control block valid flag, a completion flag, and an end flag, and in response to the valid flag being valid, the completion flag and the end flag being present.
在一些实施例中,第一模块011进一步被设置为:设置环回控制块标志,以用于表示当前控制块位于控制块环的存储空间的线性地址的尾部;设置主动生成控制块标志,以用于表示位于当前控制块的后而的控制块未生成,响应于调用带有主动生成控制标志的控制块,为带有主动生成控制标志的控制块设置生成引擎,以用于生成后而的控制块并填充到对应的控制块环上。In some embodiments, the first module 011 is further configured to: set a loopback control block flag to indicate that the current control block is located at the end of the linear address of the storage space of the control block ring; set an active generation control block flag to indicate that the control block located after the current control block has not been generated, and in response to calling a control block with an active generation control flag, set a generation engine for the control block with the active generation control flag to generate the subsequent control block and fill it into the corresponding control block ring.
在一些实施例中,第二模块012进一步被设置为:根据固件对主机IO的命令的解析为主机IO创建第一批控制页表,并按照执行顺序将控制块依次填充到第一批控制页表对应的控制块环上;设置固件将第一个填充的控制块的地址传递给对应引擎的工作队列,以进行排队等待。In some embodiments, the second module 012 is further configured to: create a first batch of control page tables for the host IO according to the firmware's analysis of the host IO command, and fill the control blocks into the control block rings corresponding to the first batch of control page tables in sequence according to the execution order; set the firmware to pass the address of the first filled control block to the work queue of the corresponding engine for queuing and waiting.
在一些实施例中,第三模块013进一步被设置为:响应于检测到主动生成控制块标志,通过工作队列管理引擎向固件发送通知以完成控制块的首批填充,并将首批填充的控制页表对应的空间进行回收,开启对主机IO所需控制块的执行。In some embodiments, the third module 013 is further configured to: in response to detecting an active generation of a control block flag, send a notification to the firmware through the work queue management engine to complete the first batch of filling of the control block, and reclaim the space corresponding to the first batch of filled control page tables, and start the execution of the control block required for the host IO.
基于以上目的,本申请实施例的第三个方而,提出了一种计算机设备,图9示出的是本申请提供的一种计算机设备的实施例的示意图。如图9所示,本申请提供的一种计算机设备的实施例,包括以下模块:至少一个处理器021;以及存储器022,存储器022存储有可在处理器021上运行的计算机指令023,计算机指令023由处理器021执行时实现如上方法的步骤。Based on the above objectives, the third aspect of the embodiment of the present application proposes a computer device, and FIG9 shows a schematic diagram of an embodiment of a computer device provided by the present application. As shown in FIG9, an embodiment of a computer device provided by the present application includes the following modules: at least one processor 021; and a memory 022, the memory 022 stores computer instructions 023 that can be run on the processor 021, and the computer instructions 023 implement the steps of the above method when executed by the processor 021.
本申请还提供了一种非易失性可读存储介质。图10示出的是本申请提供的一种非易失性可读存储介质的实施例的示意图。如图10所示,非易失性可读存储介质031存储有被处理器执行时执行如上方法的计算机程序032。The present application also provides a non-volatile readable storage medium. Figure 10 shows a schematic diagram of an embodiment of a non-volatile readable storage medium provided by the present application. As shown in Figure 10, the non-volatile readable storage medium 031 stores a computer program 032 that performs the above method when executed by a processor.
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,设置系统参数的方法的程序可存储于一非易失性可读存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,程序的非易失性可读存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program of the method for setting system parameters can be stored in a non-volatile readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the non-volatile readable storage medium of the program can be a magnetic disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned arbitrary method embodiments.
此外,根据本申请实施例公开的方法还可以被实现为由处理器执行的计算机程序,该计算机程序可以存储在非易失性可读存储介质中。在该计算机程序被处理器执行时,执行本申请实施例公开的方法中限定的上述功能。In addition, the method disclosed in the embodiment of the present application can also be implemented as a computer program executed by a processor, and the computer program can be stored in a non-volatile readable storage medium. When the computer program is executed by the processor, the above functions defined in the method disclosed in the embodiment of the present application are performed.
此外,上述方法步骤以及系统单元也可以利用控制器以及被设置为存储使得控制器实现上述步骤或单元功能的计算机程序的非易失性可读存储介质实现。
In addition, the above method steps and system units may also be implemented using a controller and a non-volatile readable storage medium configured to store a computer program that enables the controller to implement the above steps or unit functions.
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本申请实施例公开的范围。It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithmic steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or implemented as hardware depends on application and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the present application embodiment.
在一个或多个示例性设计中,功能可以在硬件、软件、固件或其任意组合中实现。如果在软件中实现,则可以将功能作为一个或多个指令或代码存储在非易失性可读存储介质上或通过非易失性可读存储介质来传送。非易失性可读存储介质包括计算机存储介质和通信介质,该通信介质包括有助于将计算机程序从一个位置传送到另一个位置的任何介质。非易失性可读存储介质可以是能够被通用或专用计算机访问的任何可用介质。作为例子而非限制性的,该非易失性可读存储介质可以包括RAM、ROM、EEPROM、CD ROM或其它光盘存储设备、磁盘存储设备或其它磁性存储设备,或者是可以被设置为携带或存储形式为指令或数据结构的所需程序代码并且能够被通用或专用计算机或者通用或专用处理器访问的任何其它介质。此外,任何连接都可以适当地称为非易失性可读存储介质。例如,如果使用同轴线缆、光纤线缆、双绞线、数字用户线路(DSL)或诸如红外线、无线电和微波的无线技术来从网站、服务器或其它远程源发送软件,则上述同轴线缆、光纤线缆、双绞线、DOL或诸如红外线、无线电和微波的无线技术均包括在介质的定义。如这里所使用的,磁盘和光盘包括压缩盘(CD)、激光盘、光盘、数字多功能盘(DVD)、软盘、蓝光盘,其中磁盘通常磁性地再现数据,而光盘利用激光光学地再现数据。上述内容的组合也应当包括在非易失性可读存储介质的范围内。In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored as one or more instructions or codes on or transmitted through a non-volatile readable storage medium. Non-volatile readable storage media include computer storage media and communication media, which include any media that facilitate the transfer of computer programs from one location to another. Non-volatile readable storage media may be any available media that can be accessed by a general or special purpose computer. As an example and not limitation, the non-volatile readable storage medium may include RAM, ROM, EEPROM, CD ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or any other medium that can be configured to carry or store the required program code in the form of instructions or data structures and can be accessed by a general or special purpose computer or a general or special purpose processor. In addition, any connection may be appropriately referred to as a non-volatile readable storage medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves are used to transmit software from a website, server, or other remote source, then the coaxial cable, fiber optic cable, twisted pair, DOL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of medium. As used herein, disks and optical disks include compact disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks, and Blu-ray disks, where disks typically reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of non-volatile readable storage media.
以上是本申请公开的示例性实施例,但是应当注意,在不背离权利要求限定的本申请实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本申请实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are exemplary embodiments disclosed in the present application, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present application as defined in the claims. The functions, steps and/or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present application may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and/or" refers to any and all possible combinations including one or more of the associated listed items.
上述本申请实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments disclosed in the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,程序可以存储于一种非易失性可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。A person of ordinary skill in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing related hardware through a program, and the program may be stored in a non-volatile readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk, or an optical disk, etc.
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本申请实施例公开的范围(包括权利要求)被限于这些例子;在本申请实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本申请实施例的不同方而的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本申请实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本申请实施例的保护范围之内。
Those skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present application (including the claims) is limited to these examples; under the idea of the embodiments of the present application, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present application as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims (20)
- 一种对主机IO处理的优化方法,其特征在于,包括:A method for optimizing host IO processing, characterized by comprising:获取主机IO所需的控制块的空间大小以及执行顺序,根据所述空间大小以及执行顺序建立多个控制块环;Obtaining the space size and execution order of the control block required by the host IO, and establishing multiple control block rings according to the space size and execution order;将所述主机IO所需的控制块按照所述执行顺序分批填充到所述多个控制块环上;Filling the control blocks required by the host IO into the multiple control block rings in batches according to the execution order;响应于所述主机IO所需的控制块完成首批填充,开启对所述主机IO的所需的控制块的执行。In response to the first batch of filling of the control blocks required by the host IO is completed, the execution of the control blocks required by the host IO is started.
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, characterized in that the method further comprises:在控制页表的定义中添加环形模式的判断和由所述环形模式的控制页表生成对应的控制块环所需的参数信息,得到更新后的控制页表的定义。The determination of the ring mode is added to the definition of the control page table, and parameter information required for generating a corresponding control block ring from the control page table of the ring mode is used to obtain the definition of the updated control page table.
- 根据权利要求2所述的方法,其特征在于,所述在控制页表的定义中添加环形模式的判断和由所述环形模式的控制页表生成对应的控制块环所需的参数信息,得到更新后的控制页表的定义,包括:The method according to claim 2 is characterized in that the step of adding the judgment of the ring mode to the definition of the control page table and generating the parameter information required for the corresponding control block ring from the control page table of the ring mode to obtain the definition of the updated control page table comprises:在控制页表的定义中增加附加参数表的定义,得到更新后的控制页表的定义,其中,所述附加参数表的定义用于指示在所述环形模式下生成CB需要的参数。The definition of the additional parameter table is added to the definition of the control page table to obtain the definition of the updated control page table, wherein the definition of the additional parameter table is used to indicate the parameters required for generating the CB in the ring mode.
- 根据权利要求3所述的方法,其特征在于,所述更新后的控制页表包括:控制页表头区域,控制块环控制头,控制块存放区域,数据缓存指针区域,以及,原始NVMe管理和IO指令备份区域。The method according to claim 3 is characterized in that the updated control page table includes: a control page table header area, a control block ring control header, a control block storage area, a data cache pointer area, and an original NVMe management and IO instruction backup area.
- 根据权利要求2所述的方法,其特征在于,所述在控制页表的定义中添加环形模式的判断和由所述环形模式的控制页表生成对应的控制块环所需的参数信息,得到更新后的控制页表的定义包括:The method according to claim 2 is characterized in that the adding of the judgment of the ring mode in the definition of the control page table and the parameter information required for generating the corresponding control block ring from the control page table of the ring mode to obtain the definition of the updated control page table comprises:基于判断当前控制页表是否为环形模式以及获取所述当前控制页表在控制页链表中的位置更新控制页表的头区域的定义;Based on determining whether the current control page table is in a ring mode and obtaining the position of the current control page table in the control page linked list, a definition of a header area of the control page table is updated;响应于所述当前控制页表为环形模式的控制页表,获取所述环形模式的控制页表生成对应的控制块环所需的参数信息,并基于所述参数信息设置附加参数表中的对应参数信息,并在所述环形模式的控制页表中设置附加参数表偏移地址,以得到所述环形模式的控制页表的附加参数表的起始位置。In response to the fact that the current control page table is a control page table in an annular mode, parameter information required for the control page table in annular mode to generate a corresponding control block ring is obtained, and corresponding parameter information in an additional parameter table is set based on the parameter information, and an additional parameter table offset address is set in the control page table in annular mode to obtain the starting position of the additional parameter table of the control page table in annular mode.
- 根据权利要求5所述的方法,其特征在于,所述基于判断当前控制页表是否为环形模式以及获取所述当前控制页表在控制页链表中的位置更新控制页表的头区域的定义包括:The method according to claim 5 is characterized in that the updating of the definition of the header area of the control page table based on determining whether the current control page table is in a ring mode and obtaining the position of the current control page table in the control page linked list comprises:基于判断当前控制页表是否为环形模式更新控制页表的属性判断;Update the attribute judgment of the control page table based on whether the current control page table is in a ring mode;响应于所述当前控制页表为环形模式的控制页表,获取所述环形模式的控制页表在所述控制页链表中的位置,并在所述环形模式的控制页表中设置指向所述控制页链表中下一个控制页表的首个控制块的地址的指针。In response to the current control page table being a ring-mode control page table, the position of the ring-mode control page table in the control page chain is obtained, and a pointer to the address of the first control block of the next control page table in the control page chain is set in the ring-mode control page table.
- 根据权利要求2所述的方法,其特征在于,所述获取主机IO所需的控制块的空间大小以及执行顺序,根据所述空间大小以及执行顺序建立多个控制块环包括:The method according to claim 2, characterized in that the obtaining of the space size and execution order of the control block required by the host IO, and establishing multiple control block rings according to the space size and execution order comprises:基于所述更新后的控制页表的定义和获取的所述主机IO所需的控制块的空间大小以及执行顺序建立多个环形模式的控制页表,通过所述多个环形模式的控制页表生成对应的多个控制块环。Based on the definition of the updated control page table and the acquired space size and execution order of the control block required by the host IO, multiple control page tables in annular modes are established, and corresponding multiple control block rings are generated through the multiple control page tables in annular modes.
- 根据权利要求7所述的方法,其特征在于,所述获取主机IO所需的控制块的空间大小以及执行顺序,根据所述空间大小以及执行顺序建立多个控制块环还包括:The method according to claim 7, characterized in that the obtaining of the space size and execution order of the control blocks required by the host IO, and establishing multiple control block rings according to the space size and execution order further comprises:按照串接顺序在控制页链表的最后一个控制页表的控制块存放区域设置附加参数表,以用于存放由环形模式的控制页表生成的对应控制块环所需的参数信息。An additional parameter table is set in the control block storage area of the last control page table of the control page chain list in a serial connection order to store parameter information required by the corresponding control block ring generated by the control page table in the ring mode.
- 根据权利要求8所述的方法,其特征在于,所述按照串接顺序在控制页链表的最后一个控制页表的控制块存放区域设置附加参数表,以用于存放由环形模式的控制页表生成的对应控制块环所需的参数信息包括:The method according to claim 8 is characterized in that the additional parameter table is set in the control block storage area of the last control page table of the control page chain table in the serial order to store the parameter information required for the corresponding control block ring generated by the control page table in the ring mode, including:响应于所述附加参数表的参数体积大于所述最后一个控制页表的控制块存放区域,按照所述串接顺序逆序向前依次占用前一个控制页表的控制块存放区域。In response to the parameter volume of the additional parameter table being larger than the control block storage area of the last control page table, the control block storage area of the previous control page table is occupied in reverse order according to the serial connection sequence.
- 根据权利要求2所述的方法,其特征在于,所述获取主机IO所需的控制块的空间大小以及执行顺 序,根据所述空间大小以及执行顺序建立多个控制块环还包括:The method according to claim 2 is characterized in that the space size of the control block required for obtaining the host IO and the execution sequence Sequence, establishing multiple control block rings according to the space size and the execution order also includes:设置与控制页表的模式相对应的控制块类型;Set the control block type corresponding to the mode of controlling the page table;在控制块的控制块头中建立控制块的状态标记,以根据不同的控制块的状态标记执行不同的处理逻辑。A status flag of the control block is established in the control block header of the control block, so as to execute different processing logics according to different status flags of the control block.
- 根据权利要求10所述的方法,其特征在于,所述在控制块的控制块头中建立控制块的状态标记,以根据不同的控制块的状态标记执行不同的处理逻辑包括:The method according to claim 10, characterized in that the step of establishing a status flag of the control block in the control block header of the control block so as to execute different processing logics according to different status flags of the control block comprises:设置控制块有效标志、完成标志以及结束标志,并且响应于所述有效标志有效,所述完成标志和结束标志存在。A control block valid flag, a completion flag, and an end flag are set, and in response to the valid flag being valid, the completion flag and the end flag exist.
- 根据权利要求11所述的方法,其特征在于,在所述有效标志为1时,表示所述控制块为合法控制块;所述有效标志为0时,表示所述控制块为非法控制块。The method according to claim 11 is characterized in that, when the valid flag is 1, it indicates that the control block is a legal control block; when the valid flag is 0, it indicates that the control block is an illegal control block.
- 根据权利要求11所述的方法,其特征在于,在所述完成标志为1时,表示所述控制块为已执行完成的控制块;在所述有效标志为0时,表示所述控制块为尚未执行的控制块。The method according to claim 11 is characterized in that, when the completion flag is 1, it indicates that the control block is a control block that has been executed; when the valid flag is 0, it indicates that the control block is a control block that has not been executed.
- 根据权利要求11所述的方法,其特征在于,在所述结束标志为1时,表示所述控制块为处理一个IO流程的控制页表或者处理一个IO流程的所述控制页链表的最后一个控制块;在所述结束标志为0时,表示所述控制块不为处理一个IO流程的控制页表或者处理一个IO流程的所述控制页链表的最后一个控制块。The method according to claim 11 is characterized in that, when the end flag is 1, it indicates that the control block is a control page table for processing an IO process or the last control block of the control page linked list for processing an IO process; when the end flag is 0, it indicates that the control block is not a control page table for processing an IO process or the last control block of the control page linked list for processing an IO process.
- 根据权利要求11所述的方法,其特征在于,所述设置与控制页表的模式相对应的控制块类型包括:The method according to claim 11, characterized in that the setting of the control block type corresponding to the mode of controlling the page table comprises:设置环回控制块标志,以用于表示当前控制块位于控制块环的存储空间的线性地址的尾部;The loopback control block flag is set to indicate that the current control block is located at the end of the linear address of the storage space of the control block ring;设置主动生成控制块标志,以用于表示位于当前控制块的后面的控制块未生成,响应于调用带有主动生成控制标志的控制块,为所述带有主动生成控制标志的控制块设置生成引擎,以用于生成后面的控制块并填充到对应的控制块环上。An active generation control block flag is set to indicate that the control block behind the current control block has not been generated. In response to calling a control block with an active generation control flag, a generation engine is set for the control block with the active generation control flag to generate the subsequent control blocks and fill them into the corresponding control block ring.
- 根据权利要求15所述的方法,其特征在于,所述将所述主机IO所需的控制块按照所述执行顺序分批填充到所述多个控制块环上包括:The method according to claim 15, characterized in that the step of filling the control blocks required by the host IO into the multiple control block rings in batches according to the execution order comprises:根据固件对主机IO的命令的解析为所述主机IO创建第一批控制页表,并按照执行顺序将控制块依次填充到所述第一批控制页表对应的控制块环上;Creating a first batch of control page tables for the host IO according to the firmware's analysis of the host IO command, and sequentially filling control blocks into control block rings corresponding to the first batch of control page tables according to the execution order;设置所述固件将第一个填充的控制块的地址传递给对应引擎的工作队列,以进行排队等待。The firmware is configured to pass the address of the first filled control block to the work queue of the corresponding engine for queuing.
- 根据权利要求16所述的方法,其特征在于,所述响应于所述主机IO所需的控制块完成首批填充,开启对所述主机IO的所需的控制块的执行包括:The method according to claim 16, wherein in response to the control blocks required by the host IO completing the first batch of filling, starting the execution of the control blocks required by the host IO comprises:响应于检测到主动生成控制块标志,通过工作队列管理引擎向所述固件发送通知以完成控制块的首批填充,并将首批填充的控制页表对应的空间进行回收,开启对所述主机IO所需控制块的执行。In response to detecting the active generation of the control block flag, a notification is sent to the firmware through the work queue management engine to complete the first filling of the control block, and the space corresponding to the first filled control page table is reclaimed to start the execution of the control block required by the host IO.
- 一种对主机IO处理的优化装置,其特征在于,包括:A device for optimizing host IO processing, characterized by comprising:第一模块,被设置为获取主机IO所需的控制块的空间大小以及执行顺序,根据所述空间大小以及执行顺序建立多个控制块环;The first module is configured to obtain the space size and execution order of the control block required by the host IO, and establish multiple control block rings according to the space size and execution order;第二模块,被设置为将所述主机IO所需的控制块按照所述执行顺序分批填充到所述多个控制块环上;A second module is configured to fill the control blocks required by the host IO into the multiple control block rings in batches according to the execution order;第三模块,被设置为响应于所述主机IO所需的控制块完成首批填充,开启对所述主机IO的所需的控制块的执行。The third module is configured to start the execution of the control blocks required by the host IO in response to the completion of the first batch of filling of the control blocks required by the host IO.
- 一种计算机设备,其特征在于,包括:A computer device, comprising:至少一个处理器;以及at least one processor; and存储器,所述存储器存储有可在所述处理器上运行的计算机指令,所述指令由所述处理器执行时实现权利要求1-17任意一项所述方法的步骤。A memory storing computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 17.
- 一种非易失性可读存储介质,所述非易失性可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-17任意一项所述方法的步骤。 A non-volatile readable storage medium storing a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 17 when executed by a processor.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211508344.4A CN115543219B (en) | 2022-11-29 | 2022-11-29 | Method, device, equipment and medium for optimizing host IO processing |
CN202211508344.4 | 2022-11-29 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024113996A1 true WO2024113996A1 (en) | 2024-06-06 |
Family
ID=84722749
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/115975 WO2024113996A1 (en) | 2022-11-29 | 2023-08-30 | Optimization method and apparatus for host io processing, device, and nonvolatile readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115543219B (en) |
WO (1) | WO2024113996A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115543219B (en) * | 2022-11-29 | 2023-04-18 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for optimizing host IO processing |
CN117008843B (en) * | 2023-09-26 | 2024-01-19 | 苏州元脑智能科技有限公司 | Control page linked list construction device and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180024738A1 (en) * | 2016-07-22 | 2018-01-25 | EpoStar Electronics Corp. | Data reading method, data writing method and storage controller using the same |
CN112241310A (en) * | 2020-10-21 | 2021-01-19 | 海光信息技术股份有限公司 | Page table management method, information acquisition method, processor, chip, device, and medium |
CN113885945A (en) * | 2021-08-30 | 2022-01-04 | 山东云海国创云计算装备产业创新中心有限公司 | Calculation acceleration method, equipment and medium |
CN113918101A (en) * | 2021-12-09 | 2022-01-11 | 苏州浪潮智能科技有限公司 | Method, system, equipment and storage medium for writing data cache |
CN114048149A (en) * | 2021-10-30 | 2022-02-15 | 山东云海国创云计算装备产业创新中心有限公司 | Method, system, storage medium and equipment for controlling construction of page chain table |
CN115543219A (en) * | 2022-11-29 | 2022-12-30 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for optimizing host IO processing |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102681952B (en) * | 2012-05-12 | 2015-02-18 | 北京忆恒创源科技有限公司 | Method for writing data into memory equipment and memory equipment |
CN107145311B (en) * | 2017-06-12 | 2020-06-19 | 苏州浪潮智能科技有限公司 | IO data processing method and system |
CN111737002B (en) * | 2020-06-24 | 2022-05-31 | 苏州浪潮智能科技有限公司 | Method, device and equipment for processing chained storage request and readable medium |
-
2022
- 2022-11-29 CN CN202211508344.4A patent/CN115543219B/en active Active
-
2023
- 2023-08-30 WO PCT/CN2023/115975 patent/WO2024113996A1/en unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180024738A1 (en) * | 2016-07-22 | 2018-01-25 | EpoStar Electronics Corp. | Data reading method, data writing method and storage controller using the same |
CN112241310A (en) * | 2020-10-21 | 2021-01-19 | 海光信息技术股份有限公司 | Page table management method, information acquisition method, processor, chip, device, and medium |
CN113885945A (en) * | 2021-08-30 | 2022-01-04 | 山东云海国创云计算装备产业创新中心有限公司 | Calculation acceleration method, equipment and medium |
CN114048149A (en) * | 2021-10-30 | 2022-02-15 | 山东云海国创云计算装备产业创新中心有限公司 | Method, system, storage medium and equipment for controlling construction of page chain table |
CN113918101A (en) * | 2021-12-09 | 2022-01-11 | 苏州浪潮智能科技有限公司 | Method, system, equipment and storage medium for writing data cache |
CN115543219A (en) * | 2022-11-29 | 2022-12-30 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for optimizing host IO processing |
Also Published As
Publication number | Publication date |
---|---|
CN115543219B (en) | 2023-04-18 |
CN115543219A (en) | 2022-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2024113996A1 (en) | Optimization method and apparatus for host io processing, device, and nonvolatile readable storage medium | |
EP4300323A1 (en) | Data processing method and apparatus for blockchain network, computer device, computer readable storage medium, and computer program product | |
WO2021238796A1 (en) | Asynchronous processing method, apparatus, and system for download tasks, and storage medium | |
US11210277B2 (en) | Distributing and processing streams over one or more networks for on-the-fly schema evolution | |
CN108008950B (en) | Method and device for realizing user interface updating | |
CN106095483A (en) | The Automation arranging method of service and device | |
CN111026530A (en) | Task scheduling method and device, computer equipment and storage medium | |
US20230011298A1 (en) | Smart contract-based data processing method, apparatus, device, and storage medium | |
CN111666265B (en) | Data management method, device, server and storage medium | |
US20240314135A1 (en) | Prioritizing operations over content objects of a content management system | |
CN116414527A (en) | Method and system for greatly improving performance of distributed transaction coordinator | |
CN110381150B (en) | Data processing method and device on block chain, electronic equipment and storage medium | |
CN114640706B (en) | Data transmission method, electronic device and computer readable storage medium | |
CN116820527B (en) | Program upgrading method, device, computer equipment and storage medium | |
WO2020220272A1 (en) | Method and system for changing resource state, terminal, and storage medium | |
WO2023274409A1 (en) | Method for executing transaction in blockchain system and blockchain node | |
WO2023045250A1 (en) | Memory pool resource sharing method and apparatus, and device and readable medium | |
WO2023070925A1 (en) | Sharding method for blockchain transaction pool, system, storage medium and computer system | |
CN102053917B (en) | Smart card capable of reducing memory footprint and instruction processing method thereof | |
CN108810645A (en) | Barrage message distributing method, device, equipment and storage medium | |
CN112507347B (en) | Cracking job description information generation method facing distributed password cracking framework | |
JP2001060157A (en) | Inter-application message exchange system | |
CN112925841B (en) | Distributed JDBC implementation method, device and computer-readable storage medium | |
CN112671653B (en) | CAM table operation method based on multi-core heterogeneous platform | |
CN114090626A (en) | Method and device for acquiring database data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23896155 Country of ref document: EP Kind code of ref document: A1 |