I / O wait queue scheduling methods, devices, chips, equipment, and storage systems

By using a shared storage structure and a multi-level arbitration-based IO wait queue scheduling method, the resource waste and latency issues caused by independent queue maintenance and fixed priority strategies are resolved, achieving efficient IO request management and throughput improvement.

CN123114362APending Publication Date: 2026-11-17WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611240989.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, the independent maintenance of IO wait queues leads to large storage resource overhead, fixed priority strategies are prone to causing high-priority IO to be blocked by low-priority IO for a long time, and the single chain removal decision is inefficient, resulting in increased system processing latency.

Method used

A shared memory structure is used to maintain the queue pointer information of each waiting queue. Multi-level arbitration and adaptive release strategies are used to classify and add the queues to the corresponding waiting queues according to the blocking type, and the release amount is dynamically adjusted to optimize the scheduling of IO requests.

Benefits of technology

It enables fine-grained management under different blocking scenarios, reduces hardware storage resource overhead, improves the accuracy and efficiency of scheduling decisions, avoids performance fluctuations caused by improper release of resources, and improves system IO throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114362A_ABST
    Figure CN123114362A_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer storage technology, and discloses an I / O wait queue scheduling method, apparatus, chip, device, and storage system. The method first acquires blocked I / O requests, then classifies them according to their blocking type and adds them to corresponding wait queues, achieving fine-grained management of I / O requests under different blocking scenarios and avoiding interference between different types of blocked requests. Next, a shared memory structure is used to maintain queue pointer information, reducing hardware storage resource overhead. Then, multi-level arbitration is used to determine the currently allowed I / O requests to be released from each wait queue, improving the accuracy and efficiency of scheduling decisions. Finally, an adaptive release strategy is used to calculate the release amount and release the I / O requests, avoiding performance fluctuations caused by improper release amounts. Therefore, the above scheme can achieve efficient and unified management of blocked I / O requests, improving system I / O throughput.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer storage technology, and more specifically to I / O wait queue scheduling methods, devices, chips, equipment, and storage systems. Background Technology

[0002] In storage I / O (Input / Output) acceleration chips, a temporary data buffer area called Cache is typically allocated from DDR (Double Data Rate Synchronous Dynamic Random Access Memory) to cache intermediate data streams from physical disk read / write requests, thereby reducing the frequency of physical disk access and improving the overall system I / O throughput. When an I / O request is blocked due to resource conflicts or flow control, it needs to be placed in a waiting queue for unified management and released for execution when the conditions are met.

[0003] In related technologies, separate waiting queues are typically maintained for different blocking scenarios, and IO requests are dequeued from the queues according to a fixed priority or a simple polling method.

[0004] However, the above scheme has the following drawbacks: the independently maintained queue structure leads to a large storage resource overhead; the fixed priority strategy is prone to causing high-priority IO to be blocked by low-priority IO for a long time; the chain removal decision is simple and inefficient, and the same batch of IO may be repeatedly chained and removed when the resource status fluctuates, causing additional processing delays. Summary of the Invention

[0005] This invention provides an IO waiting queue scheduling method, apparatus, chip, device, and storage system to solve the problem in related technologies where IO requests are repeatedly added to and removed from the chain due to a single chain removal strategy and a fixed release amount, resulting in increased system processing latency.

[0006] In a first aspect, the present invention provides an I / O waiting queue scheduling method, the method comprising: Retrieve blocked I / O requests; Based on the blocking type of the IO request, the IO request is added to the waiting queue corresponding to the blocking type; each blocking type corresponds to at least one waiting queue; A shared memory structure is used to maintain the queue pointer information of each waiting queue; the queue pointer information includes at least head and tail pointer information and backward pointer information; The I / O requests in each of the waiting queues are arbitrated at multiple levels to determine the I / O requests that are currently allowed to be released from each of the waiting queues; The release amount is calculated according to the adaptive release strategy, and the IO request is released from the corresponding waiting queue according to the release amount; wherein, the adaptive release strategy dynamically adjusts the release amount according to the system load status.

[0007] In one optional implementation, maintaining the queue pointer information of each waiting queue using a shared memory structure includes: Each of the waiting queues is divided into at least two queue categories, and each queue category shares a first storage resource; the first storage resource is used to maintain the head and tail pointer information of all waiting queues in the corresponding queue category; Each of the waiting queues shares a second storage resource; the second storage resource is used to maintain backward pointer information for all waiting queues.

[0008] In one optional implementation, the step of performing multi-level arbitration on IO requests in each of the waiting queues to determine the currently allowed IO requests to be released from each of the waiting queues includes: For each queue category, the first-level arbitration is performed on the IO requests in each waiting queue. Based on the head and tail pointer information, the IO requests to be processed are selected from each queue category as the output of the first-level arbitration. The output of the first-level arbitration is then subjected to a second-level arbitration to determine the currently allowed IO requests to be released; The priority of the first-level arbitration is configurable; the priority of the second-level arbitration is also configurable.

[0009] In one alternative implementation, the blocking type includes at least one of the following: CL conflict; index conflict; single disk IO quantity flow control; disk group IO quantity flow control; single disk IO bandwidth flow control; single disk dirty CL quantity flow control; disk group dirty CL quantity flow control.

[0010] In one optional implementation, the adaptive release strategy includes: When the blocking type is CL conflict or index conflict, the release amount release_cnt = wait_io_cnt × k; When the blocking type is single disk IO quantity flow control, disk group IO quantity flow control, single disk IO bandwidth flow control, single disk dirty CL quantity flow control, or disk group dirty CL quantity flow control, the release amount release_cnt=min{wait_io_cnt,flow_th×n}; Where wait_io_cnt is the current number of chains, k is the first gain coefficient, n is the configurable second gain coefficient, and flow_th is the flow control waterline.

[0011] In an optional implementation, the method further includes: A sampling period is set, and when the number of active IO requests within the sampling period does not exceed the flow control threshold, the release process is initiated; wherein, after the IO requests of the previous release operation are processed, the next release operation is executed. If the number of active IO requests does not exceed the flow control threshold after a preset number of consecutive release operations, the second gain coefficient is increased; if the number of active IO requests fluctuates and exceeds the flow control threshold after a preset number of consecutive release operations, the second gain coefficient is decreased.

[0012] Secondly, the present invention provides an I / O waiting queue scheduling device, the device comprising: The request retrieval module is used to retrieve blocked I / O requests; The classification and insertion module is used to insert the IO request into the waiting queue corresponding to the blocking type according to the blocking type of the IO request; each blocking type corresponds to at least one waiting queue; The queue management module is used to maintain queue pointer information for each of the waiting queues using a shared storage structure; the queue pointer information includes at least head and tail pointer information and backward pointer information; An arbitration module is used to perform multi-level arbitration on IO requests in each of the waiting queues to determine the IO requests that are currently allowed to be released from each of the waiting queues; The release control module is used to calculate the release amount according to the adaptive release strategy, and release the IO request from the corresponding waiting queue according to the release amount; wherein, the adaptive release strategy dynamically adjusts the release amount according to the system load status.

[0013] Thirdly, the present invention provides a storage I / O acceleration chip, which is used to execute the I / O wait queue scheduling method of the first aspect above or any corresponding embodiment thereof.

[0014] Fourthly, the present invention provides a storage device, the storage device including the storage I / O acceleration chip described in the third aspect above.

[0015] Fifthly, the present invention provides a storage system including a host and a storage device as described in the fourth aspect above; the host and the storage device are communicatively connected; the storage device is communicatively connected to a back-end physical disk array; the storage device is used to respond to IO requests from the host and to execute the IO wait queue scheduling method of the first aspect above or any corresponding embodiment thereof through the storage IO acceleration chip.

[0016] The technical solution provided by this invention may include the following beneficial effects: The IO waiting queue scheduling method provided by this invention achieves fine-grained management of IO requests under different blocking scenarios by classifying IO requests and adding them to corresponding waiting queues according to their blocking type, thus avoiding mutual interference between different types of blocking requests. It uses a shared memory structure to maintain queue pointer information, reducing hardware storage resource overhead. Multi-level arbitration is used to determine the currently allowed IO requests to be released from each waiting queue, improving the accuracy and efficiency of scheduling decisions. An adaptive release strategy is used to calculate the release amount and release IO requests, avoiding performance fluctuations caused by improper release amounts. Therefore, the above scheme can achieve efficient and unified management of blocked IO requests, improving system IO throughput. Attached Figure Description

[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of an application scenario according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the first type of IO wait queue scheduling method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a second type of IO wait queue scheduling method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an I / O wait queue scheduling system according to an embodiment of the present invention; Figure 5 This is a flowchart of the chaining and unchaining process for a cache resource conflict queue according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the waiting queue chaining process according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the waiting queue unchaining process according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the arbitration scheduling of chain hanging and chain unhooking according to an embodiment of the present invention; Figure 9 This is a structural block diagram of an IO waiting queue scheduling device according to an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0021] As an optional application scenario of this invention, such as Figure 1As shown, the storage device includes a storage I / O acceleration chip. This chip connects to the host via a PCIe (Peripheral Component Interconnect Express) interface and to the backend physical disk array via SAS (Serial Attached SCSI) / SATA (Serial Advanced Technology Attachment) interfaces. Internally, the storage I / O acceleration chip uses DDR memory to allocate a temporary cache area (the cache is a buffer) to buffer intermediate data streams from physical disk read / write requests. The storage I / O acceleration chip can be an FPGA (Field-Programmable Gate Array), ASIC (Application-Specific Integrated Circuit), or SoC (System-on-Chip), and integrates an I / O wait queue scheduling device. When the host sends an I / O request to the storage device, the request first reaches the storage I / O acceleration chip for processing. The chip checks the cache area to see if the required data exists. If the cache hits, the data is written to or read from the cache; if not, the request waits for the cache resources to be released before reprocessing. During this process, IO requests may be blocked. At this time, the IO waiting queue scheduling device in the chip will classify the blocked IO requests according to the blocking type and add them to the corresponding waiting queue (i.e., add them to the queue) for unified management. After the resource is released or the flow control is lifted, the IO requests will be released through multi-level arbitration and adaptive release strategy (i.e., remove them from the queue) to continue execution, so as to complete the host's read and write access to the physical disk array.

[0022] Physical disks can be HDD (Hard Disk Drive), SSD (Solid State Drive), or NVMe (Non-Volatile Memory Express) storage devices, with storage media such as NAND (NAND Flash Memory), phase-change memory, or magnetic recording media. There can be one or more physical disks, and multiple physical disks can be combined to form a RAID array (Redundant Array of Independent Disks) to provide data redundancy and performance expansion.

[0023] This invention provides an I / O waiting queue scheduling method. I / O requests are categorized and placed into corresponding waiting queues based on their blocking type. A shared memory structure is used to maintain the queue pointer information of each waiting queue. After multi-level arbitration of I / O requests in each waiting queue, the release amount is calculated according to an adaptive release strategy, and the I / O requests are released. This achieves unified management and adaptive scheduling of multi-source blocked I / O requests, reduces hardware resource overhead, avoids repeated linking and unlinking of I / O requests, and improves system I / O throughput.

[0024] According to an embodiment of the present invention, an embodiment of an IO wait queue scheduling method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0025] This embodiment provides an IO wait queue scheduling method, which can be used in the aforementioned storage IO acceleration chip. Figure 2 This is a flowchart of an IO wait queue scheduling method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the blocked IO request.

[0026] When a storage I / O acceleration chip processes I / O requests from the host, it may encounter situations where the request cannot be processed immediately due to factors such as cache resources being occupied, cache misses with no available cache lines (CLs), cache flow control reaching its limit, or disk-side IOPS (Input / Output Operations Per Second, used for performance testing of computer storage devices, which can be considered as read / write operations per second) or bandwidth flow control. This type of I / O request is considered blocked. The storage I / O acceleration chip acquires relevant information about the blocked I / O request, such as the I / O request number, the accessed address information, and the reason for blocking, to classify and manage the I / O request based on the blocking reason. The relevant information for blocked I / O requests can be temporarily stored in registers or internal caches, waiting to enter the corresponding waiting queue.

[0027] Step S202: Based on the blocking type of the IO request, add the IO request to the waiting queue corresponding to the blocking type.

[0028] Based on the blocking reason obtained in step S201, the blocking type of the IO request is determined, and the IO request is added to the tail of the waiting queue corresponding to the blocking type. Each blocking type corresponds to at least one waiting queue. IO requests of different blocking types are added to different waiting queues, thereby achieving classified management of IO requests and avoiding the impact of different blocking types of IO requests being mixed in the same queue, which would affect scheduling efficiency. The adding operation can be implemented using a unidirectional chain, where the newly added IO request becomes the new tail element of the queue, and its backward pointer points to null, indicating the end of the current queue.

[0029] Step S203: Use a shared memory structure to maintain the queue pointer information of each waiting queue.

[0030] The queue pointer information includes at least head and tail pointer information and backward pointer information.

[0031] To reduce hardware storage resource overhead, a shared storage structure is used to maintain queue pointer information for each waiting queue. The queue pointer information includes head and tail pointers and a backward pointer. The head and tail pointers indicate the head and tail positions of each waiting queue, while the backward pointer indicates the position of the next I / O request pointed to by each I / O request in the queue. Each waiting queue shares the same storage resource to store the backward pointer information. By allocating a corresponding storage location for each I / O request, the backward pointer information of any I / O request can be directly located and accessed, thereby effectively reducing storage resource consumption.

[0032] Step S204: Perform multi-level arbitration on the IO requests in each waiting queue to determine the IO requests that are currently allowed to be released from each waiting queue.

[0033] Once cached resources are released or flow control is lifted, IO requests that are allowed to be released need to be selected from the waiting queues to continue execution. A multi-level arbitration mechanism is used to arbitrate and select IO requests in each waiting queue, that is, through at least two levels of arbitration to filter at each level, and finally determine the IO requests that are currently allowed to be released from each waiting queue.

[0034] Step S205: Calculate the release amount according to the adaptive release strategy, and release the IO request from the corresponding waiting queue according to the release amount.

[0035] After multi-level arbitration determines the permitted I / O requests to be released, it is also necessary to determine the number of I / O requests to be released to avoid excessive or insufficient release affecting system performance. This adaptive release strategy dynamically adjusts the release amount based on the system load status. The release amount is calculated through the adaptive release strategy, and after determining the release amount, the corresponding number of I / O requests are released from the corresponding waiting queue according to the release amount, and the released I / O requests are sent to the backend physical disk to continue execution.

[0036] The IO waiting queue scheduling method provided in this embodiment achieves fine-grained management of IO requests under different blocking scenarios by classifying IO requests and adding them to corresponding waiting queues according to their blocking type, thus avoiding interference between different types of blocking requests. It uses a shared memory structure to maintain queue pointer information, reducing hardware storage resource overhead. Multi-level arbitration is used to determine the currently allowed IO requests to be released from each waiting queue, improving the accuracy and efficiency of scheduling decisions. An adaptive release strategy is used to calculate the release amount and release IO requests, avoiding performance fluctuations caused by improper release amounts. Therefore, the above scheme can achieve efficient and unified management of blocked IO requests, improving system IO throughput.

[0037] This embodiment provides an IO wait queue scheduling method, which can be used in the aforementioned storage IO acceleration chip. Figure 3 This is a flowchart of an IO wait queue scheduling method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Obtain the blocked IO request.

[0038] Please see details Figure 2 Step S201 of the illustrated embodiment will not be described again here.

[0039] Step S302: Based on the blocking type of the IO request, add the IO request to the waiting queue corresponding to the blocking type.

[0040] Each blocking type corresponds to at least one waiting queue.

[0041] In one optional implementation, the blocking type includes at least one of the following: CL (in this embodiment, the Cache consists of CLs in index rows × way columns, where index is the row number and way is the column number) conflict, i.e., a CL request is successful but the CL is occupied by other IO requests; index conflict, i.e., a CL request is unsuccessful and there are no free CLs available for allocation within the same index; single-disk IO quantity flow control, i.e., the number of IO requests exceeds the limit of a single disk; disk group IO quantity flow control, i.e., the number of IO requests exceeds the limit of the corresponding disk group; single-disk IO bandwidth flow control, i.e., the bandwidth of IO requests exceeds the limit of a single disk; single-disk dirty CL (Dirty Cache-Line) quantity flow control, i.e., the number of dirty CLs exceeds the limit of a single disk; disk group dirty CL quantity flow control, i.e., the number of dirty CLs exceeds the limit of the corresponding disk group. The IO waiting queue scheduling device determines the blocking type of an IO request based on the blocking reason and adds it to the waiting queue corresponding to the blocking type to achieve classified management of different blocking scenarios.

[0042] For example, Figure 4This is a schematic diagram of the structure of an I / O wait queue scheduling system according to an embodiment of the present invention. Figure 4 As shown, this embodiment mainly involves the management of seven types of waiting queues, corresponding to blocking types, including: CL conflict queue ① (corresponding to...) Figure 4 In the cl conflict queue (cl is the same as CL), the index conflict queue ② (corresponding to) Figure 4 (index conflict), single disk I / O quantity flow control queue ③ (corresponding to) Figure 4 The flow control queue for io_cnt_pd and disk group IO quantity (corresponding to ④) Figure 4 The io_cnt_group flow control in the middle), single disk IO bandwidth flow control queue ⑤ (corresponding to Figure 4 The io_bw_pd flow control in the middle), the single disk dirty CL quantity flow control queue ⑥ (corresponding to Figure 4 The flow control queue for cl_pd (in the context of flow control), the flow control queue for the number of dirty CLs in the disk group (corresponding to ⑦). Figure 4 (The cl_group flow control in the code). Based on the blocking type of the IO request, the IO request is added to the corresponding waiting queue. For example, when an IO request is blocked because the CL is occupied by other IO requests, the IO request is added to the CL conflict queue①.

[0043] In one optional implementation, the seven blocking types and their corresponding waiting queues described above are merely illustrative examples of this embodiment and do not constitute a limitation of the present invention. When new blocking scenarios occur in the storage system, such as new disk group strategies or new flow control dimensions brought about by new storage media, corresponding waiting queues can be added according to the same shared storage structure and scheduling strategy. Specifically, the newly added waiting queues can be assigned to existing queue categories or treated as a separate new queue category, sharing the corresponding storage resources to maintain their head and tail pointer information and backward pointer information; at the same time, by incorporating the newly added waiting queues into the management scope of multi-level arbitration and adaptive release strategies, support for new blocking scenarios can be achieved without redesigning the queue management architecture. Therefore, the IO waiting queue scheduling method provided in this embodiment has good scalability.

[0044] Step S303: Use a shared memory structure to maintain the queue pointer information of each waiting queue.

[0045] The queue pointer information includes at least head and tail pointer information and backward pointer information.

[0046] In one optional implementation, when maintaining the queue pointer information of each waiting queue using a shared memory structure, each waiting queue is first divided into at least two queue categories. Each queue category shares a first storage resource, which is used to maintain the head and tail pointer information of all waiting queues within the corresponding category. Simultaneously, each waiting queue shares a second storage resource, which is used to maintain the backward pointer information of all waiting queues. By storing the head and tail pointer information and the backward pointer information in different shared storage resources, the integrity of the queue pointer information is ensured while further optimizing the utilization of storage resources.

[0047] For example, such as Figure 4 As shown, the above seven waiting queues are divided into three categories: the first category is the cache resource conflict category (corresponding to...). Figure 4 The first category is cache conflict (cache is the same as cache), including CL conflict queue ① and index conflict queue ②; the second category is IO flow control, including single disk IO quantity flow control queue ③, disk group IO quantity flow control queue ④ and single disk IO bandwidth flow control queue ⑤; the third category is cache flow control, including single disk dirty CL quantity flow control queue ⑥ and disk group dirty CL quantity flow control queue ⑦. In head and tail pointer management, the three queue categories independently share their corresponding first storage resources to maintain the head and tail pointer information of all waiting queues within their respective queue categories; in backward pointer management, the three queue categories share the same second storage resource to maintain the backward pointer information of all waiting queues.

[0048] Specifically, for cache flow control queues (i.e., queues ⑥ and ⑦), cache resources are allocated based on physical disks, using the disk number pdid as the storage address index to maintain head and tail pointer information. The data structure for head and tail pointer information includes: head pointer valid flag (head_valid), head pointer (head_ioid), tail pointer valid flag (tail_valid), and tail pointer (tail_ioid).

[0049] For IO flow control queues (i.e., queues ③④⑤), IO flow control mainly involves disk-side IOPS and bandwidth, and also uses the disk number pdid as the storage address index to maintain head and tail pointer information. The data structure for head and tail pointer information includes: head pointer valid flag (head_valid), head pointer (head_ioid), tail pointer valid flag (tail_valid), and tail pointer (tail_ioid).

[0050] For cache resource conflict queues (i.e., queues ① and ②), the ioid (resource number of the IO command) is used as the storage address index to reduce hardware resource overhead. The keys for both types of conflicts are also stored in the head and tail pointer information (the two conflict scenarios are naturally mutually exclusive; that is, an IO request cannot be blocked simultaneously due to CL conflict and index conflict). The data structure of the head and tail pointer information includes: head pointer valid flag (head_valid), resource conflict type (conflict_type, used to distinguish between CL and index conflicts), CL index number (index), CL way number (way), tail pointer valid flag (tail_valid), and tail pointer (tail_ioid). It can be understood that if the total number of CLs is less than ioid_max (the largest resource number of the IO command), the management method of the head and tail pointers is consistent with the management method of flow control queues, the difference being that the storage address index becomes the CL number.

[0051] Figure 5 This is a flowchart illustrating the chaining and unchaining process for a cache resource conflict queue according to an embodiment of the present invention. Figure 5 As shown, this process manages the hanging and unhooking operations of IO requests blocked due to CL or index conflicts. First, it reads the valid flag (head_vld) of the head pointer from the head and tail pointer information. If the valid flag is 1, it further parses the arbitration information to obtain the resource conflict type (conflict_type), the CL's index number (index), and the way number (way). If the valid flag is 0, it indicates that the current queue is empty, and no hanging or unhooking operation is needed. Then, it determines whether the current operation is a hanging or unhooking operation.

[0052] For a chaining operation, first, based on the blocking reason of the IO request (CL conflict or index conflict), determine whether the key (i.e., the index number and way number of the CL) has been matched. If the key is not matched, it indicates that the current IO request is the first time this type of conflict has occurred. In this case, initialize the head and tail pointer information at the ioid_new (the number of the IO request to be matched), set head_valid to 1, and record conflict_type, index, and way information; at the same time, initialize the backward pointer information, set current_valid to 1, and update wait_type and io_info. If the key is matched, it indicates that the current IO request is not the first time this type of conflict has occurred. Then, resolve the matched position ioid_hit and match the current IO request to the tail of the queue. Specifically, at the `ioid_new` position, update the head and tail pointer information (set `tail_valid` to 1, update `tail_ioid` to `ioid_new`), and update the backward pointer information of the original tail (update the original tail's `next_ioid` to `ioid_new`, set `next_valid` to 1). Simultaneously, initialize the backward pointer information at the `ioid_new` position (set `current_valid` to 1, update `wait_type` and `io_info`). The chaining operation ends.

[0053] If it's a dechaining operation, first, based on the blocking reason of the IO request (CL conflict or index conflict), determine whether the key (i.e., the index number and way number of the CL) has been matched. If the key is not matched, it indicates that the conflict information of the current IO request is abnormal, and normal dechaining cannot be performed. At this time, the exception handling process is entered. If the key is matched, the matched position ioid_hit is parsed (this position is the position pointed to by the head pointer), and then dechaining is performed sequentially from head to tail. For each IO request dechained, the release count is decremented by 1, and the valid flag (current_valid is set to 0) at the position of the IO request is cleared. At the same time, the head and tail pointer information at the ioid_hit position is updated, and the head pointer is updated to point to the next IO request pointed to by the backward pointer of the currently dechained IO request. Then, it is determined whether the release capacity (allowing capacity) has been used up: if the release capacity has been used up, the unlinking operation ends and the head and tail pointer information is updated (the new head pointer is marked as valid and head_ioid is updated to the new head position); if the release capacity has not been used up, the next IO request is unlinked until the release capacity is used up or the queue is empty, and the unlinking operation ends.

[0054] For backward pointer information, the three queue categories share the same storage resource, managed using `ioid` as the storage address index. When the queue is attached, other I / O-related information also needs to be stored so that it can be directly used by downstream modules when the queue is unattached, without needing to be retrieved from elsewhere. The data structure for backward pointer information includes: a valid flag for the current position's stored information (`current_valid`), the wait type of the I / O corresponding to the current position index (`wait_type`, including the seven types mentioned above), a valid flag for the backward pointer (`next_valid`), the backward pointer (`next_ioid`), and information related to the I / O corresponding to the current position index (`io_info`).

[0055] Figure 6 This is a schematic diagram of the waiting queue chaining process according to an embodiment of the present invention. Figure 6 As shown, the waiting queue is implemented using a unidirectional chain with the tail attached. This process involves the coordinated updating of head and tail pointer information and backward pointer information.

[0056] At time T0, the first IO request (ioid=0) is added. At this point, the queue is empty. After adding ioid=0, this IO request is both the head and tail of the queue, so both the head and tail pointers point to ioid=0. In the head and tail pointer information, head_valid is set to 1, head_ioid=0, tail_valid is set to 1, and tail_ioid=0. In the backward pointer information, current_valid at the position of ioid=0 is set to 1, and next_valid is set to 0 (indicating that there are no subsequent nodes in the current queue).

[0057] At time T1, a second I / O request (ioid=3) is added. The new I / O request is added to the tail of the queue, so the head pointer remains unchanged, still pointing to ioid=0, while the tail pointer is updated to point to ioid=3. In the backward pointer information, the next_ioid of the original tail ioid=0 is updated to 3, and next_valid is set to 1; simultaneously, current_valid at the position where ioid=3 is located is set to 1, and next_valid is set to 0 (indicating that the current position is the tail of the queue).

[0058] At time T2, a third I / O request (ioid=2) is added. Similarly, the head pointer still points to ioid=0, and the tail pointer is updated to point to ioid=2. In the backward pointer information, the next_ioid of the original tail ioid=3 is updated to 2, and next_valid is set to 1; the current_valid of the position where ioid=2 is located is set to 1, and next_valid is set to 0.

[0059] After the operations from time T0 to T2, the order of IO requests in the queue is ioid=0→ioid=3→ioid=2.

[0060] Figure 7 This is a schematic diagram of the unchaining process of the waiting queue according to an embodiment of the present invention. Figure 7 As shown, the unlinking process is implemented by unlinking from the beginning, that is, unlinking sequentially starting from the position pointed to by the head pointer.

[0061] At time T5, the first IO request (ioid=0) is unlinked. Starting from ioid=0, which is pointed to by the head pointer, the next IO request is found to be ioid=3 by using the backward pointer at the position of ioid=0. The head pointer is then updated to point to ioid=3. At the same time, the valid flag at the position of ioid=0 is cleared (current_valid is set to 0).

[0062] At time T6, the second IO request (ioid=3) is unchained. Starting from ioid=3, which is currently pointed to by the head pointer, the next IO request is found to be ioid=2 by using the backward pointer at the position of ioid=3. The head pointer is then updated to point to ioid=2. At the same time, the valid flag at the position of ioid=3 is cleared (current_valid is set to 0).

[0063] At time T7, the third IO request (ioid=2) is delinked. Starting from ioid=2, which is currently pointed to by the head pointer, the queue is delinked. The back pointer at the position of ioid=2 is checked, and next_valid is found to be 0 (indicating that the current position is the tail of the queue). After delinking, the queue becomes empty.

[0064] At time T8, update the head and tail pointers. The queue is now empty, so both the head and tail pointer validity flags are set to 0 (head_valid=0, tail_valid=0), indicating that there are no pending IO requests in the current queue.

[0065] Step S304: Perform multi-level arbitration on the IO requests in each waiting queue to determine the IO requests that are currently allowed to be released from each waiting queue.

[0066] In one optional implementation, when performing multi-level arbitration on IO requests in each waiting queue to determine which IO requests are currently allowed to be released, a first-level arbitration is first performed on the IO requests in each waiting queue of each queue category. Based on head and tail pointer information, IO requests to be processed are selected from each queue category as the output of the first-level arbitration. Then, a second-level arbitration is performed on the output of the first-level arbitration to determine which IO requests are currently allowed to be released from the selected IO requests of each queue category. The priority of the first-level arbitration is configurable, and the priority of the second-level arbitration is also configurable, allowing for flexible adjustment of the arbitration strategy according to the actual application scenario.

[0067] For example, Figure 8 This is a schematic diagram illustrating the arbitration and scheduling of chain attachment and detachment according to an embodiment of the present invention. Figure 8 As shown, the management of the waiting queue needs to guarantee atomic operations. Among these, chaining operations (such as...) Figure 8 (as indicated by the red arrow) and unchaining operations (such as...) Figure 8 (As indicated by the black arrows) are all uniformly scheduled by the arbitration mechanism, but when setting the priority of task scheduling, there is no distinction between hanging and unhooking to simplify implementation. To improve processing speed, the seven-choice arbitration can be split into two levels of processing. The first level of arbitration mainly serves the three head and tail pointer management modules, and the second level of arbitration mainly serves the backward pointer management module. The priority strategy of the two levels of arbitration is shown in Table 1, thereby improving the flexibility of scheduling. Specifically, the first level of arbitration includes arbitrator_0, arbitrator_1, and arbitrator_2. Arbitrator_0 is used to arbitrate queues ① and ②; arbitrator_1 is used to arbitrate queues ③, ④, and ⑤; and arbitrator_2 is used to arbitrate queues ⑥ and ⑦. In the first level of arbitration, the priority of each queue is configurable. The second level of arbitration includes arbitrator_3. Arbitrator_3 is used to arbitrate queues ⑧, ⑨, and ⑩. Among them, queue ⑧ has the highest priority, and the priorities of queues ⑨ and ⑩ are configurable. Table 1 is as follows: Table 1: Queue Arbitration Priority Table.

[0068]

[0069] Step S305: Calculate the release amount according to the adaptive release strategy, and release the IO request from the corresponding waiting queue according to the release amount.

[0070] In one optional implementation, the adaptive release strategy includes: when the blocking type is CL conflict or index conflict, the release amount `release_cnt = wait_io_cnt × k`, where `wait_io_cnt` is the current number of pending chains, and `k` is a first gain coefficient, preset according to requirements; when the blocking type is single-disk IO quantity flow control, disk group IO quantity flow control, single-disk IO bandwidth flow control, single-disk dirty CL quantity flow control, or disk group dirty CL quantity flow control, the release amount `release_cnt = min{wait_io_cnt, flow_th × n}`, where `n` is a configurable second gain coefficient, and `flow_th` is the flow control waterline. Through this method, the IO waiting queue scheduling device can adopt different release strategies according to different blocking types, improving the release efficiency of IO requests while ensuring system stability.

[0071] Step S306: Adaptive control is performed on the release process.

[0072] In an optional implementation, in order to achieve adaptive control of the release process, this embodiment also introduces an adaptive release strategy, including: (1) adding triggering conditions. Specifically, a sampling period (sample_period) is set, and the release process is only started when the number of active IO requests within the sampling period does not exceed the flow control waterline, so as to avoid erroneous triggering of the release operation due to short-term fluctuations in traffic, thereby reducing unnecessary chain hanging and unchaining operations. It is understood that the triggering condition is applicable to flow control type queues, including single disk IO quantity flow control, disk group IO quantity flow control, single disk IO bandwidth flow control, single disk dirty CL quantity flow control, and disk group dirty CL quantity flow control. (2) controlling the release rhythm to ensure that the next release operation is executed only after the IO request of the previous release operation is processed. By controlling the release rhythm, system resource contention or secondary overload caused by excessively fast release speed is avoided, ensuring stable system operation. (3) adaptively updating the gain coefficient. When the blocking type is single-disk I / O flow control, disk group I / O flow control, single-disk I / O bandwidth flow control, single-disk dirty CL flow control, or disk group dirty CL flow control, if the number of active I / O requests does not exceed the flow control threshold after a preset number of consecutive release operations (e.g., m consecutive times), the second gain coefficient is increased to speed up the release. Specifically, CL is increased by n, and the updated gain coefficient n_new = n + n_step, where n_step is the preset step value corresponding to n. If the number of active I / O requests fluctuates above the flow control threshold after a preset number of consecutive release operations (e.g., the number of active I / O requests repeatedly exceeds and falls below the flow control threshold), the second gain coefficient is decreased to slow down the release and ensure stable system operation. Specifically, n is decreased, and the updated gain coefficient n_new = n - n_step.

[0073] The IO waiting queue scheduling method provided in this embodiment achieves fine-grained management of multi-source blocked IO requests by refining the blocking types into seven specific scenarios and assigning them to different waiting queues. By dividing each waiting queue into at least two queue categories and using a shared memory structure to maintain head and tail pointer information and backward pointer information respectively, hardware storage overhead is minimized. Different release amount calculation methods are used for conflict-type queues and flow-control-type queues, avoiding the shortcomings of a single release strategy that cannot accommodate the release needs of different queue types. Simultaneously, by introducing sampling period, release rhythm control, and adaptive control mechanisms, the release amount can be dynamically adjusted according to system load, avoiding system oscillations and the wasted effort of repeated link hanging and unhooking. Furthermore, when a new blocking scenario occurs, a corresponding waiting queue can be added using the same shared memory structure and scheduling strategy, demonstrating good scalability.

[0074] This embodiment also provides an IO wait queue scheduling device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0075] This embodiment provides an I / O waiting queue scheduling device, such as... Figure 9 As shown, it includes: The request acquisition module 901 is used to acquire blocked I / O requests; The classification and insertion module 902 is used to insert the IO request into the waiting queue corresponding to the blocking type according to the blocking type of the IO request; each blocking type corresponds to at least one waiting queue; The queue management module 903 is used to maintain the queue pointer information of each waiting queue using a shared memory structure; the queue pointer information includes at least head and tail pointer information and backward pointer information; Arbitration module 904 is used to perform multi-level arbitration on IO requests in each of the waiting queues to determine the IO requests that are currently allowed to be released from each of the waiting queues; The release control module 905 is used to calculate the release amount according to the adaptive release strategy, and release the IO request from the corresponding waiting queue according to the release amount; wherein, the adaptive release strategy dynamically adjusts the release amount according to the system load status.

[0076] In an optional implementation, the queue management module is further configured to: Each waiting queue is divided into at least two queue categories, and each queue category shares a first storage resource; the first storage resource is used to maintain the head and tail pointer information of all waiting queues in the corresponding queue category; Each waiting queue shares a second storage resource; this second storage resource is used to maintain backward pointer information for all waiting queues.

[0077] In an optional implementation, the arbitration module is further configured to: For each queue category, the first-level arbitration is performed on the IO requests in each waiting queue. Based on the head and tail pointer information, the IO requests to be processed are selected from each queue category as the output of the first-level arbitration. The output of the first-level arbitration is then subjected to a second-level arbitration to determine the currently allowed IO requests to be released; The priority of the first-level arbitration is configurable; the priority of the second-level arbitration is configurable.

[0078] In one alternative implementation, the blocking type includes at least one of the following: CL conflict; index conflict; single disk IO quantity flow control; disk group IO quantity flow control; single disk IO bandwidth flow control; single disk dirty CL quantity flow control; disk group dirty CL quantity flow control.

[0079] In one alternative implementation, the adaptive release strategy includes: When the blocking type is CL conflict or index conflict, the release amount release_cnt = wait_io_cnt × k; When the blocking type is single disk IO quantity flow control, disk group IO quantity flow control, single disk IO bandwidth flow control, single disk dirty CL quantity flow control, or disk group dirty CL quantity flow control, the release amount release_cnt=min{wait_io_cnt,flow_th×n}; Where wait_io_cnt is the current number of chains, k is the first gain coefficient, n is the configurable second gain coefficient, and flow_th is the flow control waterline.

[0080] In an alternative implementation, the device further includes an adaptive control module for: Set a sampling period. When the number of active IO requests within the sampling period does not exceed the flow control threshold, start the release process. The next release operation is executed after the IO requests of the previous release operation are processed. If the number of active IO requests does not exceed the flow control threshold after a preset number of release operations, the second gain coefficient is increased; if the number of active IO requests fluctuates and exceeds the flow control threshold after a preset number of release operations, the second gain coefficient is decreased.

[0081] The IO waiting queue scheduling device provided in this embodiment of the invention can execute the IO waiting queue scheduling method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution. Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0082] In the above embodiments, the various functional modules in the storage I / O acceleration chip, such as the request acquisition module, the classification and insertion module, the queue management module, the arbitration module, and the release control module, can be implemented in whole or in part through hardware circuits, firmware, or a combination of hardware and firmware.

[0083] Specifically, when implemented through hardware circuits, each functional module can utilize hardware logic devices such as Application-Specific Integrated Circuits (ASICs) and Field-Programmable Gate Arrays (FPGAs) to implement corresponding processing logic such as I / O request acquisition, blocking type classification, queue pointer maintenance, multi-level arbitration, and release calculation and release. When implemented using firmware, the firmware configures logic according to the corresponding application scenario and business requirements. This configuration logic can be stored in the memory of the storage I / O acceleration chip in the form of microcode or firmware programs, and executed by the chip's internal processor or logic operation unit, thereby generating all or part of the processes or functions according to the embodiments of this invention, such as classified loading, shared memory management, two-level arbitration scheduling, and adaptive release. Those skilled in the art will understand that the functional modules of the device provided in the specific embodiments of this invention, as well as the method steps of the specific embodiments of this invention, can be implemented through hardware logic circuit design in the chip, or by loading and executing firmware instructions in the chip. These firmware instructions can be stored in on-chip storage media such as read-only memory (ROM), static random access memory (SRAM), and flash memory inside the chip, so that when the chip processes blocking I / O requests, it can implement the I / O wait queue scheduling method steps of any of the above embodiments of the present invention, thereby facilitating unified management of multi-source blocking I / O requests, reducing hardware storage resource overhead, and improving the overall I / O throughput of the system.

[0084] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the invention.

Claims

1. A method for scheduling an I / O wait queue, characterized in that, The method includes: Retrieve blocked I / O requests; Based on the blocking type of the IO request, the IO request is added to the waiting queue corresponding to the blocking type; each blocking type corresponds to at least one waiting queue; A shared memory structure is used to maintain the queue pointer information of each waiting queue; the queue pointer information includes at least head and tail pointer information and backward pointer information; The I / O requests in each of the waiting queues are arbitrated at multiple levels to determine the I / O requests that are currently allowed to be released from each of the waiting queues; The release amount is calculated according to the adaptive release strategy, and the IO request is released from the corresponding waiting queue according to the release amount; wherein, the adaptive release strategy dynamically adjusts the release amount according to the system load status.

2. The method according to claim 1, characterized in that, The method of maintaining the queue pointer information of each waiting queue using a shared memory structure includes: Each of the waiting queues is divided into at least two queue categories, and each queue category shares a first storage resource; the first storage resource is used to maintain the head and tail pointer information of all waiting queues in the corresponding queue category; Each of the waiting queues shares a second storage resource; the second storage resource is used to maintain backward pointer information for all waiting queues.

3. The method according to claim 2, characterized in that, The multi-level arbitration of IO requests in each of the waiting queues to determine the currently allowed IO requests to be released from each of the waiting queues includes: For each queue category, the first-level arbitration is performed on the IO requests in each waiting queue. Based on the head and tail pointer information, the IO requests to be processed are selected from each queue category as the output of the first-level arbitration. The output of the first-level arbitration is then subjected to a second-level arbitration to determine the currently allowed IO requests to be released; The priority of the first-level arbitration is configurable; the priority of the second-level arbitration is also configurable.

4. The method according to claim 1, characterized in that, The blocking type includes at least one of the following: CL conflict; index conflict; single disk IO quantity flow control; disk group IO quantity flow control; single disk IO bandwidth flow control; single disk dirty CL quantity flow control; disk group dirty CL quantity flow control.

5. The method according to claim 4, characterized in that, The adaptive release strategy includes: When the blocking type is CL conflict or index conflict, the release amount release_cnt = wait_io_cnt × k; When the blocking type is single disk IO quantity flow control, disk group IO quantity flow control, single disk IO bandwidth flow control, single disk dirty CL quantity flow control, or disk group dirty CL quantity flow control, the release amount release_cnt=min{wait_io_cnt,flow_th×n}; Where wait_io_cnt is the current number of chains, k is the first gain coefficient, n is the configurable second gain coefficient, and flow_th is the flow control waterline.

6. The method according to claim 5, characterized in that, The method further includes: A sampling period is set, and when the number of active IO requests within the sampling period does not exceed the flow control threshold, the release process is initiated; wherein, after the IO requests of the previous release operation are processed, the next release operation is executed. If the number of active IO requests does not exceed the flow control threshold after a preset number of consecutive release operations, the second gain coefficient is increased; if the number of active IO requests fluctuates and exceeds the flow control threshold after a preset number of consecutive release operations, the second gain coefficient is decreased.

7. An I / O wait queue scheduling device, characterized in that, The device includes: The request retrieval module is used to retrieve blocked I / O requests; The classification and insertion module is used to insert the IO request into the waiting queue corresponding to the blocking type according to the blocking type of the IO request; each blocking type corresponds to at least one waiting queue; The queue management module is used to maintain queue pointer information for each of the waiting queues using a shared storage structure; the queue pointer information includes at least head and tail pointer information and backward pointer information; An arbitration module is used to perform multi-level arbitration on IO requests in each of the waiting queues to determine the IO requests that are currently allowed to be released from each of the waiting queues; The release control module is used to calculate the release amount according to the adaptive release strategy, and release the IO request from the corresponding waiting queue according to the release amount; wherein, the adaptive release strategy dynamically adjusts the release amount according to the system load status.

8. A storage I / O acceleration chip, characterized in that, The storage I / O acceleration chip is used to execute the I / O wait queue scheduling method according to any one of claims 1 to 6.

9. A storage device, characterized in that, The storage device includes the storage I / O acceleration chip as described in claim 8.

10. A storage system, characterized in that, It includes a host and a storage device as described in claim 9; the host and the storage device are communicatively connected; the storage device is communicatively connected to a back-end physical disk array; the storage device is used to respond to the host's IO requests and to execute the IO wait queue scheduling method as described in any one of claims 1 to 6 through the storage IO acceleration chip.