IO scheduling method, device and equipment

By grouping IO queues and dynamically adjusting CPU resource allocation, the contradiction between IO queue polling performance and CPU resource consumption in the existing technology is resolved, and efficient IO scheduling is achieved under different load conditions.

CN114924848BActive Publication Date: 2025-09-12ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210452210.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-27
Publication Date
2025-09-12
Estimated Expiration
2042-04-27

AI Technical Summary

Technical Problem

Existing technologies cannot achieve both efficient IO queue polling performance and low CPU resource consumption, resulting in resource waste and performance bottlenecks.

Method used

Multiple IO queues are grouped and CPU resources are allocated to the groups. The target queue is determined based on the status information of the IO queue. The polling task is performed using the CPU resources of the target group, and the CPU allocation is adjusted dynamically or statically.

Benefits of technology

By aggregating IO queue polling tasks, idle polling is reduced, CPU resources are saved, and system performance is optimized under low IO load conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114924848B_ABST
    Figure CN114924848B_ABST
Patent Text Reader

Abstract

The present application discloses an IO scheduling method, apparatus, and device. The method includes: grouping multiple IO queues of a computer system and allocating CPU resources to the groups; the IO device sets status information corresponding to the IO queues based on whether each IO queue has IO data; based on the status information, determining the target IO queue with IO data; and, based on the correspondence between the queues and the groups, executing the polling task of the target IO queue using the CPU resources of the target group corresponding to the target IO queue. This processing method reduces the execution of excessive idle polling by aggregating multiple IO queue polling tasks, effectively saving CPU resources for overall system polling when the IO load is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to an IO scheduling method and device, and an electronic device. Background Art

[0002] To support extreme application scenarios, cloud vendors are targeting increasingly demanding performance targets for network and storage. This often requires significant CPU resources to be allocated to polling I / O queues. This polling involves the CPU periodically checking the status of peripherals to determine if they require service.

[0003] A typical method for allocating CPU resources for I / O queue polling tasks is static allocation. To meet higher performance requirements, a higher percentage of CPU resources is typically allocated to I / O queue polling tasks. However, the I / O performance requirements of actual online production environments are far less stringent. The large number of I / O queues and the CPU resources used for I / O queue polling are actually a significant waste. For example, on the boards responsible for I / O device simulation in cloud servers, most of the CPU is monopolized by polling of network / storage queues, leaving other important tasks with only a few remaining CPU cores, resulting in a severe resource shortage.

[0004] Another typical approach is to use interrupts for I / O queues. Because interrupts save significant polling time, they can effectively reduce CPU resource consumption, leaving sufficient CPU resources available for other important tasks. However, interrupt response time increases I / O latency, making it difficult to meet higher performance requirements.

[0005] In summary, the existing solution has the problem of not being able to take into account both high polling performance and low CPU resource consumption. Summary of the Invention

[0006] The present application provides an IO scheduling method to solve the problem in the prior art that it is impossible to achieve both high polling performance and low CPU resource consumption. The present application also provides an IO scheduling device and an electronic device.

[0007] This application provides an IO scheduling method, including:

[0008] Grouping multiple IO queues and allocating CPU resources to the groups, wherein the CPU resources are used to execute polling tasks of the IO queues;

[0009] The IO device sets the status information of whether there is IO data corresponding to each IO queue according to whether there is IO data;

[0010] Determine the target IO queue having IO data according to the status information;

[0011] According to the correspondence between the queue and the group, the polling task of the target IO queue is executed by the CPU resource of the target group corresponding to the target IO queue.

[0012] Optionally, grouping multiple IO queues includes:

[0013] Multiple queues can be grouped dynamically or statically.

[0014] Optionally, the IO device sets the status information of whether there is IO data corresponding to each IO queue according to whether there is IO data, including:

[0015] The IO device sets the value of the bit corresponding to the IO queue in the bitmap register according to whether there is IO data in each IO queue and the correspondence between the bit and the queue;

[0016] Determining a target IO queue having IO data according to the status information includes:

[0017] The target IO queue having IO data is determined according to the value of each bit of the bitmap register.

[0018] Optionally, determining a target IO queue having IO data according to the status information includes:

[0019] Execute the IO queue status polling task to detect the status information corresponding to each IO queue;

[0020] According to the status detection result, the target IO queue with IO data is determined.

[0021] Optionally, executing the IO queue status polling task to detect the status information corresponding to each IO queue includes:

[0022] Execute the IO queue status polling task corresponding to the group to detect the status information corresponding to each IO queue in the group;

[0023] According to the status detection result, the target IO queue with IO data is determined.

[0024] Optionally, also include:

[0025] Get IO load;

[0026] If the IO load meets the preset conditions, the IO queue status polling task is executed to detect the status information corresponding to each IO queue;

[0027] If the IO load does not meet the preset condition, the IO queue status polling task corresponding to the group is executed to detect the status information corresponding to each IO queue in the group.

[0028] Optionally, also include:

[0029] Obtaining IO load change information of the group;

[0030] The number of CPUs corresponding to the group is adjusted according to the IO load change information.

[0031] Optionally, adjusting the number of CPUs corresponding to the group according to the IO load change information includes:

[0032] Determining, based on the IO load change information, whether the group continues to have IO data to be processed within a preset time period;

[0033] If the above judgment result is yes, the number of CPUs corresponding to the group is increased.

[0034] Optionally, adjusting the number of CPUs corresponding to the group according to the IO load change information includes:

[0035] Determining, based on the IO load change information, whether the group has no IO data to be processed within a preset time period;

[0036] If the above judgment result is yes, the number of CPUs corresponding to the group is reduced.

[0037] Optionally, executing the polling task of the target IO queue by using the CPU resources of the target group corresponding to the target IO queue according to the correspondence between the queue and the group includes:

[0038] For multiple target IO queues of the target group, according to the scheduling policy, the polling task of the target IO queue is executed through the CPU resources of the target group.

[0039] Optionally, the number of CPUs in the group is less than the number of IO queues in the group.

[0040] The present application also provides an IO scheduling device, comprising:

[0041] An IO queue and CPU grouping unit, configured to group multiple IO queues and allocate CPU resources to the groups;

[0042] An IO queue status setting unit is used for the IO device to set the status information of whether there is IO data corresponding to each IO queue according to whether there is IO data in each IO queue;

[0043] a target IO queue determining unit, configured to determine a target IO queue having IO data according to the status information;

[0044] The target IO queue polling task execution unit is used to execute the polling task of the target IO queue through the CPU resources of the target group corresponding to the target IO queue according to the corresponding relationship between the queue and the group

[0045] The present application also provides an electronic device, comprising:

[0046] A processor and a memory; the memory is used to store a program for implementing the above method, and the device is powered on and runs the program of the method through the processor.

[0047] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned various methods.

[0048] The present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to perform the above methods.

[0049] Compared with the prior art, this application has the following advantages:

[0050] The IO scheduling method provided by the embodiment of the present application is to group multiple IO queues of a computer system and allocate CPU resources to the groups; the IO device sets the status information of whether the IO queue has IO data according to whether each IO queue has IO data; based on the status information, the target IO queue with IO data is determined; based on the correspondence between the queue and the group, the CPU resources of the target group corresponding to the target IO queue are used to execute the polling task of the target IO queue. Using this processing method, the execution of excessive idle polling is reduced by aggregating the polling tasks of multiple IO queues, which can effectively save the CPU resources of the overall polling of the system under low IO load. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A flowchart of an embodiment of the IO scheduling method provided by this application;

[0052] Figure 2 A schematic diagram of a specific process of an embodiment of the IO scheduling method provided in this application;

[0053] Figure 3 A schematic diagram of IO queue polling task scheduling in an embodiment of the IO scheduling method provided in this application. DETAILED DESCRIPTION

[0054] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.

[0055] In this application, an IO scheduling method and apparatus, as well as an electronic device are provided. In the following embodiments, various solutions are described in detail one by one.

[0056] First embodiment

[0057] Please see Figure 1 , which is a flow chart of an embodiment of the IO scheduling method of the present application. In this embodiment, the method includes:

[0058] Step S101: multiple IO queues are grouped, and CPU resources are allocated to the groups.

[0059] Computer systems are equipped with a large number of peripheral devices, also known as input / output (IO) devices. IO devices are hardware that allows data to be transferred to and from the computer. IO devices include, but are not limited to, memory (such as hard drives, floppy disks, and optical disks), network cards, keyboards, and mice.

[0060] The computer system includes but is not limited to: terminal devices, servers, workstations and other devices.

[0061] In one example, the computer system can be a terminal device, such as a smartphone or tablet. For example, a smartphone includes peripherals such as a network card and memory. The IO device on the smartphone sets IO data availability status information corresponding to each IO queue based on whether the IO queue has IO data. Based on the status information, the smartphone determines a target IO queue with IO data. Based on the correspondence between queues and groups, the smartphone executes the polling task for the target IO queue using the CPU resources of the target group corresponding to the target IO queue.

[0062] In one example, the computer system may be a server that includes peripherals such as a network card and a memory. An I / O device on the server sets I / O data status information corresponding to each I / O queue based on whether the queue has I / O data. The server determines a target I / O queue with I / O data based on the status information. Based on the correspondence between queues and groups, the server executes a polling task for the target I / O queue using the CPU resources of the target group corresponding to the target I / O queue.

[0063] In this embodiment, the computer system is a server, which includes a physical machine and a virtualization processing device. The virtualization processing device includes multiple CPUs and may also include multiple physical IO devices (such as network cards, memory, etc.). The virtualization processing device virtualizes the physical IO devices into multiple virtual IO devices and allocates the multiple virtual IO devices to multiple virtual hosts built based on the physical machine. In this device virtualization scenario, the performance indicators of physical IO devices are much higher than those of IO devices in ordinary servers. Accordingly, the number of IO queues in the device virtualization scenario is much higher than that of ordinary servers. To support the extreme network / storage IO performance in the device virtualization scenario, a large amount of CPU resources is often required to poll the IO queues. The virtualization processing device uses its multiple CPUs to execute the polling task of the multiple IO queues corresponding to the physical IO devices. For example, the virtualization processing device can be a board with multiple CPUs integrated on it, and various physical IO devices are inserted into the board. The module responsible for IO device simulation is deployed on the virtualization processing device, and the IO scheduling device can also be deployed on the virtualization processing device.

[0064] Each IO device corresponds to at least one IO queue. The data in an IO queue requires a CPU response and is referred to as IO data in this embodiment. An IO queue can store multiple IO data items. For example, a high-performance network interface card (NIC) typically has dozens or even hundreds of queues. When each network packet arrives, the NIC enqueues it into a specific IO queue based on specific rules and configurations.

[0065] Each I / O queue corresponds to an I / O queue polling task. Polling involves the CPU periodically checking the status of peripheral devices to determine if they require service. The I / O queue polling process is responsible for processing I / O queue data, including reading, processing, and writing. The I / O queue polling process processes I / O data in the queue according to the scheduling policy.

[0066] In the prior art, even if the IO queue has no IO data to be processed, the polling task corresponding to the IO queue will continue to execute, that is, idle polling, which will always occupy CPU resources. A large number of IO queues and CPU resources used for IO queue polling are seriously wasted.

[0067] In the method provided in the embodiment of the present application, multiple IO queue polling tasks are grouped and aggregated to reduce the execution of excessive idle polling, thereby achieving the purpose of reducing resource waste in the overall system polling when the IO load is low. It should be noted that the method provided in the embodiment of the present application does not change the structure of the existing IO queue polling tasks. There is still one polling task corresponding to one IO queue. However, when an IO queue has no IO data to process, the polling task of this IO queue will not be executed.

[0068] The method provided in the embodiments of the present application can group multiple queues using either dynamic or static grouping. Static grouping means that the IO queue grouping is fixed and does not adjust in real time. Dynamic grouping means that the IO queue grouping can be dynamically adjusted, such as based on the IO load of a group.

[0069] Taking static grouping as an example, grouping can be performed based on IO devices, with multiple IO queues for the same IO device forming a single group. For example, if storage device A includes five block devices, corresponding to five IO queues, these five IO queues are grouped together; and if storage device B includes three block devices, corresponding to three IO queues, these three IO queues are grouped together. Alternatively, a preset number of IO queues can be grouped together, with each group containing the same number of IO queues. Other static grouping methods can also be used in specific implementations.

[0070] The method provided in the embodiment of the present application can divide all IO queues of a computer system into one group or multiple groups. Assuming that there are N IO queues in total, they are divided into m groups, each group contains 1 to Nm IO queues, and at the same time, CPU resources are allocated in groups. Each group can have one or more available CPU resources (CPU cores).

[0071] In one example, the number of CPUs assigned to a group can be smaller than the number of I / O queues in the group. For example, if a group has five I / O queues, three CPUs can be allocated to it. This configuration allows polling processes across multiple I / O queues to share the corresponding group's CPU resources, reducing CPU resources dedicated to polling. It is suitable for systems with medium or low I / O loads.

[0072] In one example, the number of CPUs assigned to a group is equal to the number of I / O queues in the group. For example, if a group has five I / O queues, five CPUs are allocated to the group. This way, each I / O queue corresponds to one CPU resource, and each I / O polling process continuously occupies one CPU core to poll one I / O queue, equivalent to the CPU resource usage of existing technologies. This configuration maximizes CPU usage and is suitable for systems with high I / O loads, or even systems that are frequently fully loaded.

[0073] In an extreme case, all IO queues of the computer system are grouped together and assigned to only one CPU, that is, there is only one group globally. This configuration is suitable for systems with very light IO loads.

[0074] After executing step S101 , the corresponding relationship between the IO queues, groups, and CPU resources can be obtained, as shown in Table 1.

[0075]

[0076]

[0077] Table 1. Correspondence between IO queues, groups, and CPU resources

[0078] Step S103: The IO device sets the status information of whether there is IO data corresponding to each IO queue according to whether there is IO data in each IO queue.

[0079] The status information refers to status information that marks whether an IO queue has IO data. Each IO queue corresponds to a status information. If an IO queue has IO data, the corresponding status information is "yes", and if the IO queue has no IO data, the status information is "no".

[0080] In this embodiment, the corresponding relationship between the IO queue and the status can be obtained, as shown in Table 2.

[0081] queue state Queue 1 yes Queue 2 no …

[0082] Table 2. Correspondence between queues and states

[0083] In one example, a set of global dedicated bitmap registers can be set to record the status information of whether each IO queue has IO data. The bitmap register may include 128 bits or even more bits, where each bit corresponds to an IO queue. Accordingly, step S103 can be implemented in the following manner: the IO device sets the value of the bit corresponding to the IO queue in the bitmap based on whether each IO queue has IO data and the correspondence between the bit and the queue. Accordingly, step S105 can be implemented in the following manner: based on the value of each bit of the bitmap register, the target IO queue with IO data is determined. This processing method uses a bitmap to record the status of whether each IO queue has IO data. Each position in the bitmap corresponds to an IO queue. If an IO queue has IO data, it can be recorded as 1, and if an IO queue does not have IO data, it can be recorded as 0. Using a bitmap can represent more data content with a limited data space.

[0084] In specific implementation, the hardware logic of the IO device can be responsible for setting and clearing the bit corresponding to the IO queue, and the bitmap register group can be read-only to the software. The IO device monitors its own queue status. When data (IO data) arrives and the queue is not empty, the hardware logic sets the position corresponding to the queue in the bitmap to 1, such as Figure 3 There is data in queue Q1, and the corresponding position in the bitmap is 1; when the IO device detects that all the data in the queue has been processed and the queue is empty, the hardware logic sets the position corresponding to the queue in the bitmap to 0, such as Figure 3 There is no data in queues Q0 and Qm, and the corresponding positions in the bitmap are 0.

[0085] Step S105: Determine the target IO queue having IO data according to the status information.

[0086] This step obtains a target IO queue with IO data based on the status information of each IO queue. For a target IO queue with IO data to be processed, it is necessary to schedule a polling task of the target IO queue to process the IO data.

[0087] In one example, step S105 can be implemented as follows: execute an IO queue status polling task to detect the status information corresponding to each IO queue; determine the target IO queue with IO data based on the status detection result. By adopting this processing method, an additional polling task is added on the basis of the polling task of the existing IO queue. For the sake of convenience of description, this embodiment calls the newly added polling task an IO queue status polling task, that is, the polling task polls (detects) the status information of each IO queue. If it is detected that the status of a certain IO queue indicates that the IO queue has IO data, the IO queue is used as the target IO queue. By adopting this processing method, CPU resources can be effectively saved by polling all groups through a single process. Polling all groups by a single process means that the status of the IO queues of all groups is polled by one IO queue status polling task.

[0088] In one example, step S105 can be implemented as follows: executing the IO queue status polling task corresponding to the group to detect the status information corresponding to each IO queue in the group. This processing method allows each group to have a separate polling process, and the status information of the relevant IO queues is polled by group. Figure 3 The given relationship between bits and groups can effectively improve the polling performance of each group, thereby improving I / O scheduling performance. Having a separate polling process for each group means creating an I / O queue status polling task for each group. The status of a group's I / O queue can only be polled by that group's I / O queue status polling task.

[0089] In one example, the method may further include the following steps: obtaining the IO load; accordingly, step S105 may be implemented as follows: if the IO load satisfies a preset condition, executing an IO queue status polling task to detect the status information corresponding to each IO queue; if the IO load does not meet the preset condition, executing the IO queue status polling task corresponding to the group to detect the status information corresponding to each IO queue in the group. The preset condition may be determined according to application requirements, such as setting a load threshold. This processing method allows a single process to poll all groups, or a separate polling process for each group, based on the actual IO load of the computer system; therefore, the IO scheduling performance and CPU resource usage can be effectively balanced.

[0090] In one example, the IO queue status polling task is always running, but when the load is high and all the IO queue polling tasks have separate CPUs to continuously execute, the IO queue status polling task can increase the polling interval to reduce overhead.

[0091] Step S107: According to the correspondence between the queue and the group, the polling task of the target IO queue is executed by using the CPU resources of the target group corresponding to the target IO queue.

[0092] This step obtains the target group corresponding to the target IO queue based on the correspondence between the queue and the group, and executes the polling task of the target IO queue through the CPU resources of the target group.

[0093] In one example, step S107 can be implemented as follows: for multiple target IO queues of a target group, according to the scheduling strategy, the polling task of the target IO queue is executed through the CPU resources of the target group. This embodiment realizes the aggregation of the polling processes of multiple IO queues into one group for polling. Aggregation refers to the process of content selection, analysis, and classification of related data. In this embodiment, the aggregation scheduling module can be responsible for polling the global bitmap and maintaining a scheduling queue by group. When data arrives at a certain IO queue, its polling process is placed in the scheduling queue, and the IO polling process is scheduled to execute according to a specific strategy (such as RR, etc.) to poll its corresponding IO queue.

[0094] In one example, the method may further include the following steps:

[0095] Step S201: Acquire the IO load change information of the group.

[0096] Step S203: adjusting the number of CPUs corresponding to the group according to the IO load change information.

[0097] In specific implementation, step S203 can be implemented as follows: based on the IO load change information, determine whether the group has IO data to be processed continuously within a preset time period; if the above determination result is yes, increase the number of CPUs corresponding to the group.

[0098] In specific implementation, step S203 can also be implemented in the following manner: based on the IO load change information, determine whether the group has no IO data to be processed within a preset time period; if the above determination result is yes, reduce the number of CPUs corresponding to the group.

[0099] To increase polling resources and improve I / O performance when I / O loads fluctuate, the system can be divided into initial configuration, configuration that maximizes I / O polling resources, and intermediate configurations between the first two. Initial system configuration involves grouping system I / O queues and CPU resources based on experience. Typically, the number of CPUs in a group can be smaller than the number of I / O queues in the group. In extreme cases, all I / O queues in the computer system can be grouped together and assigned to only one CPU. In the extreme case of a configuration that maximizes I / O polling resources, one queue is assigned to one CPU, meaning the number of CPU cores used for scheduling is the same as the number of I / O queues.

[0100] When the aggregate scheduling module detects an increase in system I / O load, such as when polling processes are continuously waiting in the scheduling queue and cannot be scheduled for execution, it can dynamically add CPU cores to the group until the group's CPU resources reach the maximum I / O polling resource configuration. Conversely, if CPUs within a group are continuously idling for a period of time, the group's CPU resources can be reduced until they return to the initial configuration.

[0101] By adopting the processing method of steps S201 and S203, the CPU resources of the group used to execute the IO queue polling task can be flexibly increased or decreased according to the actual load within the group; therefore, the IO scheduling performance and CPU resource usage can be effectively balanced.

[0102] like Figure 2 As shown in FIG, it is a software and hardware collaborative implementation of the method provided by this application. The left side is the software process and the right side is the hardware process of the IO device. The hardware process is as follows: the IO device monitors its own queue status; when data arrives and the queue is not empty, the hardware logic sets the position corresponding to the queue in the bitmap to 1, as shown in FIG. Figure 2 For example, in Q1, when all data is processed and the queue is empty, the hardware logic sets the corresponding position of the queue in the bitmap to 0. The software flow is as follows: Figure 2For example, when the aggregate scheduling module polls and discovers that queue Q1 is not empty, it adds the newly discovered non-empty queue polling process p1 to the scheduling queue. If the IO queue corresponding to the IO queue polling process currently executing on the CPU core is empty, the newly discovered non-empty queue polling process p1 is immediately scheduled for execution. If the queue corresponding to the polling process currently executing on the CPU core is not empty, the polling process is scheduled for execution according to a specific scheduling policy, such as FIFO or Round-Robin. When there are no new non-empty queues waiting for polling, the previously scheduled polling process will continue to execute on the CPU.

[0103] As can be seen from the above embodiments, the IO scheduling method provided by the embodiments of the present application is to group multiple IO queues of the computer system and allocate CPU resources to the groups; the IO device sets the status information of whether the IO queue has IO data according to whether each IO queue has IO data; based on the status information, the target IO queue with IO data is determined; based on the correspondence between the queue and the group, the CPU resources of the target group corresponding to the target IO queue are used to execute the polling task of the target IO queue. By adopting this processing method, the execution of excessive idle polling is reduced by aggregating multiple IO queue polling tasks, which can effectively save the CPU resources of the overall polling of the system under low IO load.

[0104] Second embodiment

[0105] In the above embodiment, an IO scheduling method is provided. Correspondingly, this application also provides an IO scheduling device. This device corresponds to the above scheduling method embodiment. Since the device embodiment is basically similar to the scheduling method embodiment, the description is relatively simple. For relevant details, please refer to the description of the scheduling method embodiment. The device embodiment described below is merely illustrative.

[0106] The present application further provides an IO scheduling device, comprising: an IO queue and CPU grouping unit, an IO queue state setting unit, a target IO queue determining unit, and a target IO queue polling task executing unit.

[0107] Among them, the IO queue and CPU grouping unit is used to group multiple IO queues of the computer system and allocate CPU resources to the groups; the IO queue status setting unit is used for the IO device to set the status information of whether the IO queue has IO data according to whether each IO queue has IO data; the target IO queue determination unit is used to determine the target IO queue with IO data based on the status information; the target IO queue polling task execution unit is used to execute the polling task of the target IO queue through the CPU resources of the target group corresponding to the target IO queue based on the correspondence between the queue and the group.

[0108] In one example, the IO queue and CPU grouping unit is specifically configured to group multiple queues in a dynamic grouping manner or a static grouping manner.

[0109] In one example, the IO queue status setting unit is specifically used by the IO device to set the value of the bit corresponding to the IO queue in the bitmap register according to whether each IO queue has IO data and the correspondence between the bit and the queue; accordingly, the target IO queue determination unit is specifically used to determine the target IO queue with IO data based on the value of each bit of the bitmap register.

[0110] In one example, the target IO queue determining unit is specifically configured to execute an IO queue status polling task to detect the status information corresponding to each IO queue; and determine the target IO queue having IO data according to the status detection result.

[0111] In an example, the target IO queue determining unit is specifically configured to detect the status information corresponding to each IO queue in the group through an IO queue status polling task corresponding to the group.

[0112] In one example, the apparatus further includes: an IO load change information acquisition unit, configured to acquire IO load change information of the group; and a CPU resource adjustment unit, configured to adjust the number of CPUs corresponding to the group based on the IO load change information.

[0113] In one example, the CPU resource adjustment unit is specifically configured to determine, based on the IO load change information, whether the group has IO data to be processed continuously within a preset time period; if the determination result is yes, increase the number of CPUs corresponding to the group.

[0114] In one example, the CPU resource adjustment unit is specifically configured to determine, based on the IO load change information, whether the group has no IO data to be processed within a preset time period; if so, reduce the number of CPUs corresponding to the group.

[0115] In an example, the target IO queue polling task execution unit is specifically configured to execute the polling tasks of the target IO queues for the multiple target IO queues of the target group according to the scheduling policy and by using the CPU resources of the target group.

[0116] Third embodiment

[0117] In the above embodiment, an IO scheduling method is provided. Accordingly, this application also provides an electronic device. This device corresponds to the above method embodiment. Since the device embodiment is substantially similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The device embodiment described below is merely illustrative.

[0118] The present application further provides an electronic device comprising: a processor and a memory, wherein the memory is used to store a program for implementing the IO scheduling method provided in the above method embodiment, and the terminal is powered on and runs the program of the method through the processor.

[0119] Although the present application is disclosed as above with the preferred embodiments, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.

[0120] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0121] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0122] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0123] 2. Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

Claims

1. An IO scheduling method, characterized in that: include: Grouping multiple IO queues and allocating CPU resources to the groups, wherein the CPU resources are used to execute polling tasks of the IO queues; The IO device sets the value of the bit corresponding to the IO queue in the bitmap register according to whether each IO queue has IO data and the corresponding relationship between the bit and the queue, so as to use the bitmap to record the status information of whether the IO queue has IO data. Execute the IO queue status polling task to detect the status information corresponding to each IO queue; Determine a target IO queue having IO data according to a detection result of the status information; According to the correspondence between the queue and the group, the polling task of the target IO queue is executed by the CPU resource of the target group corresponding to the target IO queue.

2. The method according to claim 1, characterized in that The grouping of multiple IO queues includes: Multiple queues can be grouped dynamically or statically.

3. The method according to claim 1, characterized in that The executing IO queue status polling task to detect the status information corresponding to each IO queue includes: Execute the IO queue status polling task corresponding to the group to detect the status information corresponding to each IO queue in the group; According to the status detection result, the target IO queue with IO data is determined.

4. The method according to claim 1, wherein Also includes: Get IO load; If the IO load meets the preset conditions, the IO queue status polling task is executed to detect the status information corresponding to each IO queue; If the IO load does not meet the preset condition, the IO queue status polling task corresponding to the group is executed to detect the status information corresponding to each IO queue in the group.

5. The method according to claim 1, wherein Also includes: Obtaining IO load change information of the group; The number of CPUs corresponding to the group is adjusted according to the IO load change information.

6. The method according to claim 5, characterized in that The adjusting the number of CPUs corresponding to the group according to the IO load change information includes: Determining, based on the IO load change information, whether the group continues to have IO data to be processed within a preset time period; If the above judgment result is yes, the number of CPUs corresponding to the group is increased.

7. The method according to claim 5, characterized in that The adjusting the number of CPUs corresponding to the group according to the IO load change information includes: Determining, based on the IO load change information, whether the group has no IO data to be processed within a preset time period; If the above judgment result is yes, the number of CPUs corresponding to the group is reduced.

8. The method according to claim 1, characterized in that The method of executing the polling task of the target IO queue by using the CPU resources of the target group corresponding to the target IO queue according to the correspondence between the queue and the group includes: For multiple target IO queues of the target group, according to the scheduling policy, the polling task of the target IO queue is executed through the CPU resources of the target group.

9. The method according to claim 1, characterized in that The number of CPUs of the group is less than the number of IO queues of the group.

10. An IO scheduling device, characterized in that: include: An IO queue and CPU grouping unit, configured to group multiple IO queues and allocate CPU resources to the groups; The IO queue status setting unit is used for the IO device to set the value of the bit corresponding to the IO queue in the bitmap register according to whether each IO queue has IO data and the corresponding relationship between the bit and the queue, so as to use the bitmap to record the status information of whether the IO queue has IO data; a target IO queue determining unit, configured to execute an IO queue status polling task to detect the status information corresponding to each IO queue; and determine a target IO queue having IO data based on the detection result of the status information; The target IO queue polling task execution unit is configured to execute the polling task of the target IO queue by using the CPU resources of the target group corresponding to the target IO queue according to the corresponding relationship between the queue and the group.

11. An electronic device, characterized in that: include: processor; as well as A memory is used to store a program for implementing the IO scheduling method according to any one of claims 1 to 9, and the device is powered on and runs the program of the method through the processor.

Citation Information

Patent Citations

  • I / O request processing method and device

    CN105511964A

  • IO request scheduling method and device, storage medium and electronic equipment

    CN111831436A