Dynamic IO scheduling method and system
Through dynamic IO scheduling methods, the queue scheduling weights are dynamically updated and the reward and punishment correction strategy is adopted, which solves the problem that the overall IO queue scheduling effect of QoS in the existing technology, and realizes efficient storage system and priority IO request processing capabilities.
Patent Information
- Application Number
- PCT/CN2024/136668
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-14
- Filing Date
- 2024-12-04
- Publication Date
- 2025-06-19
Smart Images

Figure CN2024136668_19062025_PF_FP_ABST
Abstract
Description
A dynamic IO scheduling method and system
[0001] Related applications
[0002] This application claims priority to Chinese patent application number 2023117153179, filed on December 14, 2023, entitled “A Dynamic IO Scheduling Method and System,” the entire text of which is hereby incorporated by reference. Technical Field
[0003] The present application belongs to the field of emerging information technology, and specifically relates to a dynamic IO scheduling method and system. Background Art
[0004] Research has found that with the development and commercialization of 5G wireless communication technology and edge computing technology, a variety of application scenarios have emerged. The best-effort service model of traditional network technology can no longer meet users' diverse needs for application services and provide effective guarantees for data transmission reliability, transmission latency, and other performance. With the development and popularization of cloud storage technology, the number of concurrent IO requests faced by storage systems is also increasing, and traditional storage IO scheduling methods are gradually becoming inadequate. A method and system that can dynamically schedule IO based on the current status is becoming increasingly important to improve the efficiency of the entire storage system.
[0005] With the continuous development of information technology and the increasing complexity of IO types and business categories, the optimization of storage system IO scheduling has become a hot research topic to ensure the quality of storage services and meet the service needs of different users.
[0006] In the existing technology, under the premise of ensuring the high performance of the overall system, IO requests for high-priority services such as low latency are met, and methods and systems supporting dynamic IO scheduling are studied; the IO scheduling strategy is modified based on the reward and punishment of the balance strategy, and multiple status indicators are integrated, but it cannot guarantee that the overall IO queue scheduling effect based on QoS reaches the optimal current state. Summary of the Invention
[0007] The purpose of this application is to provide a dynamic IO scheduling method and system, aiming to solve the problem that the existing technology uses a reward and punishment correction IO scheduling strategy based on a balance strategy, which integrates multiple status indicators and cannot ensure that the overall IO queue scheduling effect based on QoS reaches the optimal current state.
[0008] To achieve the above objectives, this application provides the following technical solutions:
[0009] A dynamic IO scheduling method includes the following steps:
[0010] S1. Queue initialization: According to the IO priority support level n (where the larger n is, the higher the priority), initialize n IO queues, corresponding to the respective QoS levels. The maximum queue length is Lmax, and the system then allocates the corresponding memory resources.
[0011] S2. Queue scheduling weight initialization: Set the minimum time slice Ts (i.e., the time required to schedule one IO). The IO scheduler initializes the basic scheduling time slice length parameter Tn for each IO queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority IOs can be scheduled as soon as possible.
[0012] S3. IO request grouping: The IO queue grouping module groups the received IO requests according to the IO request QoS level and places them at the tail of the FIFO IO queue with the corresponding priority.
[0013] S4. IO polling scheduling: The IO scheduling module polls and schedules the IO requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue.
[0014] S5. Dynamically update the queue scheduling weight: After an IO scheduling cycle ends, the IO scheduling algorithm module dynamically updates the queue scheduling weight according to the current system state and feeds back the parameter results to the IO scheduling module.
[0015] S6. Repeat the above steps S3 - S5.
[0016] As a preferred solution of this application, in step S5, recalculate the reward and punishment correction parameter ΔTn,1 for each queue according to the current IO length Ln of each queue, where the result of ΔTn is rounded down, and αn is the empirical value of the correction factor for different queues: ΔTn,1 = [Ln - (L1 + L2 + … Ln) / n] * αn.
[0017] As a preferred solution of this application, when the length of a certain IO queue is greater than the average queue length, it indicates that the remaining IO requests in this priority queue are too long, and reward correction needs to be performed to increase the scheduling speed of this queue and prevent IO requests from waiting too long; when the length of a certain IO queue is less than the average queue length, it indicates that the remaining IO requests in this priority queue are relatively few, and punishment correction needs to be performed to relatively reduce the scheduling speed of this queue.
[0018] As a preferred solution of the present application, in step S5, the weight correction parameter ΔTn,2 of each queue is calculated based on the difference between the average access delay of the IO requests scheduled by each queue in the previous cycle and the QoS level delay target requirement, where Delayavg,n is the average access delay of the IO requests scheduled by queue n in the previous cycle, Goaln is the QoS level delay target requirement of queue n, and αn is the empirical value of the correction factor for different queues: ΔTn,2 = [Delayavg,n-Goaln*0.9]*αn.
[0019] As a preferred solution of the present application, when the average IO delay of a queue in the previous cycle is greater than 0.9 times the expected delay, it indicates that the queue needs to be rewarded and corrected to increase the scheduling speed of the queue; when the average IO delay of a queue in the previous cycle is less than 0.9 times the expected delay, it indicates that the queue needs to be penalized and corrected to relatively reduce the scheduling speed of the queue. The Goaln is multiplied by 0.9 to reserve a certain performance buffer for the delay.
[0020] As a preferred solution of the present application, in step S5, a sequence is formed based on the number of IO requests entering the FIFO IO queue of each queue in the last N cycles, and the number of IO requests Nn that may enter the IO queue in the next cycle is predicted by a time series model prediction method (such as exponential smoothing, autoregression and moving average method, etc.). The difference between the predicted value and the actual number of IO requests Mn in the previous cycle is calculated to determine the weight correction parameter ΔTn,3 of each queue, where αn is the empirical value of the correction factor for different queues: ΔTn,3 = [Nn-Mn]*αn.
[0021] As a preferred solution of the present application, when a queue predicts that the number of IO requests entering the IO queue in the next cycle is greater than the number of IO requests in the previous cycle, it is necessary to perform a reward correction on the queue to increase the scheduling speed of the next cycle; when a queue predicts that the number of IO requests entering the IO queue in the next cycle is less than the number of IO requests in the previous cycle, it is necessary to perform a penalty correction on the queue to relatively reduce the scheduling speed of the next cycle.
[0022] As a preferred solution of the present application, it is finally concluded that the scheduling weight of each queue in the next cycle is updated to Tn+ΔTn,1+ΔTn,2+ΔTn,3.
[0023] A dynamic IO scheduling system, comprising:
[0024] IO queue grouping module, IO scheduling module and IO scheduling algorithm module;
[0025] The IO queue grouping module groups the IO requests received from the general block layer into IO queues of different priorities according to QoS levels;
[0026] The IO scheduling module performs queue polling IO scheduling based on the IO algorithm result;
[0027] The IO scheduling algorithm module calculates the scheduling weight of each queue through a dynamic IO scheduling algorithm.
[0028] Compared with the prior art, the present invention has the following advantages:
[0029] 1. In this application, after a scheduling cycle of the IO scheduling module ends, the IO scheduling algorithm module dynamically updates the queue scheduling weight based on the current system status and feeds the parameter results back to the IO scheduling module. Finally, the above steps S3-S5 are repeated. By using this solution, the IO scheduling strategy is modified based on the reward and punishment of the balance strategy, and multiple status indicators are integrated to ensure that the overall IO queue scheduling effect based on QoS reaches the optimal current state.
[0030] 2. In this application, the algorithm complexity and system implementation are relatively simple, which is suitable for high-density storage IO processing systems.
[0031] 3. In this application, by using this solution, the storage IO scheduling effect of QoS priority can be achieved, and various QoS priority IO requests can be efficiently processed in high-density IO processing scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.
[0033] FIG1 is a system logic structure diagram of the present application;
[0034] FIG2 is a flowchart of the scheduling algorithm of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0036] Example 1
[0037] Please refer to Figures 1 and 2. This application provides the following technical solutions:
[0038] A dynamic I / O scheduling method, comprising the following steps:
[0039] S1. Queue initialization: According to the I / O priority support level n (where the larger n is, the higher the priority), initialize n I / O queues, corresponding to the respective QoS levels. The maximum queue length is Lmax, and the system then allocates the corresponding memory resources;
[0040] S2. Queue scheduling weight initialization: Set the minimum time slice Ts (i.e., the time required to schedule one I / O), and the I / O scheduler initializes the basic scheduling time slice length parameter Tn for each I / O queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority I / Os can be scheduled as soon as possible;
[0041] S3. I / O request grouping: The I / O queue grouping module groups the received I / O requests according to the I / O request QoS level and places them at the tail of the corresponding priority FIFO I / O queue;
[0042] S4. I / O polling scheduling: The I / O scheduling module polls and schedules the I / O requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue;
[0043] S5. Dynamically update the queue scheduling weight: After an I / O scheduling module finishes a scheduling cycle, the I / O scheduling algorithm module dynamically updates the queue scheduling weight according to the current system state and feeds back the parameter results to the I / O scheduling module;
[0044] S6. Repeat the above steps S3 - S5.
[0045] In a specific embodiment of the present application, queue initialization: According to the IO priority support level n (where the larger n is, the higher the priority), n IO queues are initialized, corresponding to the respective QoS levels. The maximum queue length is Lmax, and the system then allocates the corresponding memory resources; Queue scheduling weight initialization: Set the minimum time slice Ts (i.e., the time required to schedule one IO). The IO scheduler initializes the basic scheduling time slice length parameter Tn for each IO queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority IOs can be scheduled as soon as possible; IO request grouping: The IO queue grouping module groups the received IO requests according to the IO request QoS level and places them at the tail of the FIFO IO queue with the corresponding priority; IO polling scheduling: The IO scheduling module polls and schedules the IO requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue; Dynamically update the queue scheduling weight: After an IO scheduling module finishes a scheduling cycle, the IO scheduling algorithm module dynamically updates the queue scheduling weight according to the current system state and feeds back the parameter results to the IO scheduling module; Repeat the above steps S3-S5; According to the IO priority support level n (where the larger n is, the higher the priority), n IO queues are initialized, corresponding to the respective QoS levels. The maximum queue length is Lmax, and the system then allocates the corresponding memory resources; Set the minimum time slice Ts (i.e., the time required to schedule one IO). The IO scheduler initializes the basic scheduling time slice length parameter Tn for each IO queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority IOs can be scheduled as soon as possible; The IO queue grouping module groups the received IO requests according to the IO request QoS level and places them at the tail of the FIFO IO queue with the corresponding priority; The IO scheduling module polls and schedules the IO requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue; After an IO scheduling module finishes a scheduling cycle, the IO scheduling algorithm module dynamically updates the queue scheduling weight according to the current system state and feeds back the parameter results to the IO scheduling module; Repeat the above steps S3-S5; The reward and punishment correction IO scheduling strategy based on the balance strategy synthesizes multiple state indicators to ensure that the overall IO queue scheduling effect based on QoS reaches the optimal state at the current state; The algorithm complexity and system implementation are relatively simple, suitable for high-density storage IO processing systems; By using this solution, the storage IO scheduling effect of QoS priority can be achieved, and various QoS priority IO requests can be efficiently processed in high-density IO processing scenarios.
[0046] For details, please refer to Figures 1 and 2. In step S5, the reward and penalty correction parameter ΔTn,1 of each queue is recalculated based on the current IO length Ln of each queue, where the ΔTn result is rounded down and αn is the empirical value of the correction factor for different queues: ΔTn,1 = [Ln-(L1+L2+…Ln) / n]*αn.
[0047] In this embodiment, dynamically updating queue scheduling weights: After a scheduling cycle of the IO scheduling module ends, the IO scheduling algorithm module dynamically updates the queue scheduling weights based on the current system status and feeds the parameter results back to the IO scheduling module. In step S5, the reward and penalty correction parameter ΔTn,1 for each queue is recalculated based on the current IO length Ln of each queue. The ΔTn result is rounded down, and αn is the empirical value of the correction factor for different queues: ΔTn,1 = [Ln - (L1 + L2 + ... Ln) / n] * αn.
[0048] For details, please refer to Figures 1 and 2. When the length of an IO queue is greater than the average queue length, it indicates that the remaining IO requests in the priority queue are too long. A reward correction is required to increase the scheduling speed of the queue and prevent IO requests from waiting too long. When the length of an IO queue is less than the average queue length, it indicates that the remaining IO requests in the priority queue are relatively few. A penalty correction is required to relatively reduce the scheduling speed of the queue and adjust the scheduling speed of the queue according to the IO queue length.
[0049] In this embodiment: Queue initialization: According to the IO priority support level n (where the larger n is, the higher the priority), n IO queues are initialized, corresponding to the respective QoS levels. The maximum queue length is Lmax, and the system then allocates the corresponding memory resources; Queue scheduling weight initialization: Set the minimum time slice Ts (i.e., the time required to schedule one IO). The IO scheduler initializes the basic scheduling time slice length parameter Tn for each IO queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority IOs can be scheduled as soon as possible; IO request grouping: The IO queue grouping module groups the received IO requests according to the IO request QoS level and places them at the tail of the FIFO IO queue with the corresponding priority; IO polling scheduling: The IO scheduling module polls and schedules the IO requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue; Dynamically update the queue scheduling weight: After an IO scheduling cycle ends, the IO scheduling algorithm module dynamically updates the queue scheduling weight according to the current system state and feeds back the parameter results to the IO scheduling module; Repeat the above steps S3 - S5; If the length of a certain IO queue is greater than the average queue length, it indicates that the remaining IO requests in this priority queue are too long and need to be rewarded and corrected to increase the scheduling speed of this queue and prevent IO requests from waiting too long; When the length of a certain IO queue is less than the average queue length, it indicates that the remaining IO requests in this priority queue are relatively few and need to be punished and corrected to relatively reduce the scheduling speed of this queue to ensure that the overall IO queue scheduling effect based on QoS reaches the optimal state at the current time.
[0050] Specifically, please refer to FIGS. 1 - 2. In step S5, according to the difference between the average access delay of the IO requests scheduled by each queue in the previous cycle and the QoS level delay target requirement, the weight correction parameter ΔTn,2 of each queue is calculated, where Delayavg,n is the average access delay of the IO requests scheduled by queue n in the previous cycle, Goaln is the QoS level delay target requirement of queue n, and αn is the empirical value of the correction factor for different queues: ΔTn,2 = [Delayavg,n - Goaln * 0.9] * αn.
[0051] In this embodiment: S5, dynamically updating queue scheduling weights: After a scheduling cycle of the IO scheduling module ends, the IO scheduling algorithm module dynamically updates the queue scheduling weights based on the current system status and feeds the parameter results back to the IO scheduling module. In step S5, the weight correction parameter ΔTn,2 for each queue is calculated based on the difference between the average access delay of IO requests scheduled by each queue in the previous cycle and the QoS level delay target requirement. Here, Delayavg,n is the average access delay of IO requests scheduled by queue n in the previous cycle, Goaln is the QoS level delay target requirement for queue n, and αn is the empirical value of the correction factor for different queues: ΔTn,2 = [Delayavg,n - Goaln*0.9]*αn. The scheduling speed of the queue is adjusted based on the average IO delay of the previous cycle.
[0052] For details, please refer to Figures 1 and 2. When the average IO latency of a queue in the previous cycle is greater than 0.9 times the expected latency, it indicates that the queue needs to be rewarded to increase its scheduling speed. When the average IO latency of a queue in the previous cycle is less than 0.9 times the expected latency, it indicates that the queue needs to be penalized to reduce its scheduling speed. The Goaln is multiplied by 0.9 to reserve a certain performance buffer for latency.
[0053] In this embodiment: Queue initialization: According to the IO priority support level n (where the larger n is, the higher the priority), n IO queues are initialized, corresponding to the respective QoS levels. The maximum queue length is Lmax, and the system then allocates the corresponding memory resources; Queue scheduling weight initialization: Set the minimum time slice Ts (i.e., the time required to schedule one IO). The IO scheduler initializes the basic scheduling time slice length parameters Tn for each IO queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority IOs can be scheduled as soon as possible; IO request grouping: The IO queue grouping module groups the received IO requests according to the QoS level of the IO requests and places them at the tail of the FIFO IO queue with the corresponding priority; IO polling scheduling: The IO scheduling module polls and schedules the IO requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue; Dynamically update the queue scheduling weight: After an IO scheduling module's scheduling cycle ends, the IO scheduling algorithm module dynamically updates the queue scheduling weight according to the current system state and feeds the parameter results back to the IO scheduling module; Repeat the above steps S3 - S5. If the average IO latency of a certain queue in the previous cycle is greater than 0.9 times the expected latency, it indicates that this queue needs to be rewarded and corrected to increase the scheduling speed of this queue; When the average IO latency of a certain queue in the previous cycle is less than 0.9 times the expected latency, it indicates that this queue needs to be punished and corrected to relatively reduce the scheduling speed of this queue. Multiplying Goaln by 0.9 times is to reserve a certain performance buffer for the latency to ensure that the overall IO queue scheduling effect based on QoS reaches the optimal state at the current time.
[0054] Specifically, please refer to FIGS. 1 - 2. In step S5, a sequence is formed based on the number of IO requests that entered the FIFO IO queue in the most recent N cycles for each queue. Through a time series model prediction method (such as exponential smoothing method, autoregressive and moving average method, etc.), the number of IO requests Nn that may enter this IO queue in the next cycle is predicted. The difference between the predicted value and the actual number of IO requests Mn in the previous cycle is calculated to determine the weight correction parameter ΔTn,3 for each queue, where αn is the empirical value of the correction factor for different queues: ΔTn,3 = [Nn - Mn] * αn.
[0055] In this embodiment: S5, dynamically updating queue scheduling weights: After a scheduling cycle of the IO scheduling module ends, the IO scheduling algorithm module dynamically updates the queue scheduling weights based on the current system status and feeds the parameter results back to the IO scheduling module. In step S5, a sequence is formed based on the number of IO requests that entered the FIFO IO queue of each queue in the last N cycles. The number of IO requests that may enter the IO queue in the next cycle is predicted using a time series model prediction method (such as exponential smoothing, autoregression, and moving average methods). The difference between the predicted value and the actual number of IO requests Mn in the previous cycle is calculated to determine the weight correction parameter ΔTn,3 for each queue, where αn is the empirical value of different queue correction factors: ΔTn,3 = [Nn-Mn]*αn. The scheduling speed of the next cycle is adjusted based on whether the number of IO requests entering the IO queue in the next cycle is greater than the number of IO requests in the previous cycle.
[0056] Please refer to Figures 1 and 2 for details. When a queue predicts that the number of IO requests entering the queue in the next cycle will be greater than the number of IO requests in the previous cycle, a reward adjustment will be made to the queue to increase the scheduling speed of the next cycle. When a queue predicts that the number of IO requests entering the queue in the next cycle will be less than the number of IO requests in the previous cycle, a penalty adjustment will be made to the queue to relatively reduce the scheduling speed of the next cycle.
[0057] In this embodiment: Queue initialization: According to the IO priority support level n (where the larger n is, the higher the priority), n IO queues are initialized, corresponding to the corresponding QoS levels respectively, where the maximum queue length is Lmax, and the system then allocates the corresponding memory resources; Queue scheduling weight initialization: Set the minimum time slice Ts (i.e., the time required to schedule one IO), and the IO scheduler initializes the basic scheduling time slice length parameter Tn of each IO queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority IOs can be scheduled as soon as possible; IO request grouping: The IO queue grouping module groups the received IO requests according to the QoS level of the IO requests and places them at the tail of the FIFO IO queue with the corresponding priority; IO polling scheduling: The IO scheduling module polls and schedules the IO requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue; Dynamically update the queue scheduling weight: After an IO scheduling module completes a scheduling cycle, the IO scheduling algorithm module dynamically updates the queue scheduling weight according to the current system state and feeds the parameter results back to the IO scheduling module; Repeat the above steps S3-S5; If it is predicted that the number of IO requests entering a certain queue in the next cycle is greater than the number of IO requests in the previous cycle, then the queue needs to be rewarded and corrected to increase the scheduling speed in the next cycle; When it is predicted that the number of IO requests entering a certain queue in the next cycle is less than the number of IO requests in the previous cycle, then the queue needs to be punished and corrected to relatively reduce the scheduling speed in the next cycle. The algorithm complexity and system implementation are relatively simple and suitable for high-density storage IO processing systems.
[0058] Specifically, please refer to FIGS. 1-2, and finally obtain that the scheduling weight updates of each queue in the next cycle are Tn + ΔTn,1 + ΔTn,2 + ΔTn,3.
[0059] In this embodiment: Empirical values of the correction factors: ΔTn,1 = [Ln - (L1 + L2 + … Ln) / n] * αn, ΔTn,2 = [Delayavg,n - Goaln * 0.9] * αn, and ΔTn,3 = [Nn - Mn] * αn. Finally, it is obtained that the scheduling weight updates of each queue in the next cycle are Tn + ΔTn,1 + ΔTn,2 + ΔTn,3.
[0060] Specifically, please refer to FIGS. 1-2. A dynamic IO scheduling system includes:
[0061] An IO queue grouping module, an IO scheduling module, and an IO scheduling algorithm module;
[0062] The IO queue grouping module groups the received IO requests from the general block layer into different-priority IO queues according to the QoS level.
[0063] The IO scheduling module performs queue polling IO scheduling based on the results of the IO algorithm;
[0064] The IO scheduling algorithm module calculates the scheduling weights of each queue through a dynamic IO scheduling algorithm.
[0065] In this embodiment: Multiple IO requests are input into the IO queue grouping module. The IO queue grouping module groups the received IO requests from the general block layer into different-priority IO queues according to the QoS level. The IO scheduling module performs queue polling IO scheduling based on the results of the IO algorithm. The IO scheduling algorithm module calculates the scheduling weights of each queue through a dynamic IO scheduling algorithm, modifies the IO scheduling policy based on the reward and punishment of the balance strategy, and synthesizes multiple status indicators to ensure that the overall IO queue scheduling effect based on QoS reaches the optimal state at the current state; The algorithm complexity and system implementation are relatively simple, which is suitable for high-density storage IO processing systems; By using this solution, the storage IO scheduling effect of QoS priority can be achieved, and various QoS priority IO requests can be efficiently processed in high-density IO processing scenarios.
[0066] The working principle and usage process of this application: When this solution is used, first, according to the IO priority support level n (where the larger n is, the higher the priority), n IO queues are initialized, corresponding to the corresponding QoS levels respectively, where the maximum queue length is Lmax, and the system then allocates corresponding memory resources; Then set the minimum time slice Ts (that is, the time required to schedule one IO), and the IO scheduler initializes the basic scheduling time slice length parameter Tn of each IO queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority IOs can be scheduled as soon as possible; IO request grouping: The IO queue grouping module groups the received IO requests according to the QoS level of the IO requests and places them at the end of the FIFO IO queue with the corresponding priority; The IO scheduling module polls and schedules the IO requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue; After an IO scheduling module's scheduling cycle ends, the IO scheduling algorithm module dynamically updates the queue scheduling weights according to the current system state and feeds the parameter results back to the IO scheduling module; Finally, repeat the above steps S3-S5; By using this solution, the IO scheduling policy is modified based on the reward and punishment of the balance strategy, and multiple status indicators are synthesized to ensure that the overall IO queue scheduling effect based on QoS reaches the optimal state at the current state.
[0067] Finally, it should be noted that the above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art may still modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
[0068] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0069] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A dynamic IO scheduling method, characterized in that: It includes the following steps: S1. Queue initialization: According to the IO priority support level n (where the larger n is, the higher the priority), n IO queues are initialized, corresponding to the corresponding QoS levels respectively. The maximum length of the queue is Lmax, and the system then allocates the corresponding memory resources; S2. Queue scheduling weight initialization: Set the minimum time slice Ts (i.e., the time required to schedule one IO). The IO scheduler initializes the basic scheduling time slice length parameters Tn of each IO queue: where T1 < T2 < T3... Tn-1 < Tn, that is, the higher the queue priority, the longer the scheduling time slice, so as to ensure that high-priority IOs can be scheduled as soon as possible; S3. IO request grouping: The IO queue grouping module groups the received IO requests according to the QoS level of the IO requests and places them at the tail of the FIFO IO queue with the corresponding priority; S4. IO polling scheduling: The IO scheduling module polls and schedules the IO requests of each queue in turn according to the latest scheduling weight parameter Tn of each queue; S5. Dynamically update the queue scheduling weight: After an IO scheduling cycle ends, the IO scheduling algorithm module dynamically updates the queue scheduling weight according to the current system state and feeds back the parameter results to the IO scheduling module; S6. Repeat the above steps S3 - S5.
2. A dynamic IO scheduling method according to claim 1, characterized in that: In step S5, the reward and punishment correction parameter ΔTn,1 of each queue is recalculated according to the current IO length Ln of each queue, where the result of ΔTn is rounded down, and αn is the empirical value of the correction factor for different queues: ΔTn,1 = [Ln - (L1 + L2 + … Ln) / n] * αn.
3. A dynamic IO scheduling method according to claim 2, characterized in that: When the length of a certain IO queue is greater than the average queue length, it indicates that the remaining IO requests in this priority queue are too long and need to be rewarded and corrected to improve the scheduling speed of this queue and prevent IO requests from waiting too long; when the length of a certain IO queue is less than the average queue length, it indicates that the remaining IO requests in this priority queue are relatively few and need to be punished and corrected to relatively reduce the scheduling speed of this queue.
4. A dynamic IO scheduling method according to claim 3, characterized in that: In step S5, the weight correction parameter ΔTn,2 of each queue is calculated according to the difference between the average access delay of the IO requests scheduled by each queue in the previous cycle and the QoS level delay target requirement. Where Delayavg,n is the average access delay of the IO requests scheduled by queue n in the previous cycle, Goaln is the QoS level delay target requirement of queue n, and αn is the empirical value of the correction factor for different queues: ΔTn,2 = [Delayavg,n - Goaln * 0.9] * αn.
5. A dynamic IO scheduling method according to claim 4, characterized in that: When the average IO delay of a certain queue in the previous cycle is greater than 0.9 times the expected delay, it indicates that this queue needs to be rewarded and corrected to improve the scheduling speed of this queue; when the average IO delay of a certain queue in the previous cycle is less than 0.9 times the expected delay, it indicates that this queue needs to be punished and corrected to relatively reduce the scheduling speed of this queue. Multiplying Goaln by 0.9 times is to reserve a certain performance buffer for the delay.
6. A dynamic IO scheduling method according to claim 5, characterized in that: In step S5, a sequence is formed based on the number of IO requests entering the FIFO IO queue of each queue in the latest N cycles, and the number of IO requests Nn that may enter the IO queue in the next cycle is predicted by a time series model prediction method (such as exponential smoothing, autoregression and moving average method, etc.), and the difference between the predicted value and the actual number of IO requests Mn in the previous cycle is calculated, so as to determine the weight correction parameter ΔTn,3 of each queue, where αn is the empirical value of the correction factor of different queues: ΔTn,3=[Nn-Mn]*αn.
7. A dynamic IO scheduling method according to claim 6, characterized in that: When a queue predicts that the number of IO requests entering the IO queue in the next cycle is greater than the number of IO requests in the previous cycle, a reward correction needs to be made to the queue to increase the scheduling speed of the next cycle; when a queue predicts that the number of IO requests entering the IO queue in the next cycle is less than the number of IO requests in the previous cycle, a penalty correction needs to be made to the queue to relatively reduce the scheduling speed of the next cycle.
8. A dynamic IO scheduling method according to claim 7, characterized in that: Finally, the scheduling weights of each queue in the next cycle are updated to Tn+ΔTn,1+ΔTn,2+ΔTn,3.
9. A dynamic IO scheduling system, using a dynamic IO scheduling method according to any one of claims 1 to 8, characterized in that: include: IO queue grouping module, IO scheduling module and IO scheduling algorithm module; The IO queue grouping module groups the IO requests received from the general block layer into IO queues of different priorities according to QoS levels; The IO scheduling module performs queue polling IO scheduling based on the IO algorithm result; The IO scheduling algorithm module calculates the scheduling weight of each queue through a dynamic IO scheduling algorithm.
Citation Information
Patent Citations
Quantum hash scheduling method based on service gradation protocol
CN101442495A
Dynamic weighted round robin scheduling policy method based on priorities
CN107733689A
Queue processing method, device and equipment
CN110941483A
Dynamic IO scheduling method and system
CN117873662A
Method and module of priority division and queue scheduling for communication services in smart substation
US20210367895A1