CN114924848A - IO (input/output) scheduling method, device and equipment - Google Patents

IO (input/output) scheduling method, device and equipment Download PDF

Info

Publication number
CN114924848A
CN114924848A CN202210452210.9A CN202210452210A CN114924848A CN 114924848 A CN114924848 A CN 114924848A CN 202210452210 A CN202210452210 A CN 202210452210A CN 114924848 A CN114924848 A CN 114924848A
Authority
CN
China
Prior art keywords
queue
target
group
data
polling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210452210.9A
Other languages
Chinese (zh)
Inventor
邹南海
严力科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Cloud Computing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Cloud Computing Ltd filed Critical Alibaba Cloud Computing Ltd
Priority to CN202210452210.9A priority Critical patent/CN114924848A/en
Publication of CN114924848A publication Critical patent/CN114924848A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses I O scheduling method, device and equipment. The method comprises the following steps: grouping a plurality I O of queues of a computer system and allocating CPU resources for the packets; i O equipment sets status information of I O data corresponding to I O queue according to whether each I O queue has I O data; determining I O target I O queues with data according to the state information; and executing the polling task of the target I O queue through the CPU resource of the target group corresponding to the target I O queue according to the corresponding relation between the queue and the group. By adopting the processing mode, the execution of excessive idle polling is reduced through the aggregation of a plurality of I O queue polling tasks, and the CPU resource of the system overall polling under the condition of low load I O can be effectively saved.

Description

IO scheduling method, device and equipment
Technical Field
The application relates to the technical field of cloud computing, in particular to an IO scheduling method and device and electronic equipment.
Background
In order to support extreme application scenarios, extreme performance indexes such as network/storage of cloud manufacturers are getting higher and higher. In order to support extreme IO performance such as network/storage, a large amount of CPU resources are often invested for polling the IO queue, and the polling of the IO queue is to regularly check the peripheral status by the CPU and determine whether service is needed.
A typical way to allocate CPU resources to IO queue polling tasks is static allocation, and in order to meet the requirement of higher performance index, more CPU resources are always fixedly allocated to IO queue polling tasks. However, the IO performance requirements of a real online production environment are much less high, and the large number of IO queues and CPU resources for IO queue polling are actually severely wasted. For example, most of the CPUs on the board that the cloud server is responsible for IO device simulation are exclusively polled by the network/storage queue, and other important tasks can only share a few remaining CPU cores, so that resources are very tight.
Another typical mode is that the IO queue uses an interrupt mode, and because the interrupt mode can save a large amount of polling time, CPU resource consumption can be effectively reduced, so that other important tasks have sufficient available CPU resources. However, the interrupt response time increases the IO delay, and thus the requirement for higher performance index cannot be met.
In summary, the existing solution has a problem that it cannot consider both the high polling performance and the low CPU resource consumption.
Disclosure of Invention
The application provides an IO scheduling method to solve the problem that the prior art cannot give consideration to both high polling performance and low CPU resource consumption. The application additionally provides an IO scheduling device and electronic equipment.
The application provides an IO scheduling method, which comprises the following steps:
grouping a plurality of IO queues, and allocating CPU resources for the grouping, wherein the CPU resources are used for executing polling tasks of the IO queues;
the IO equipment sets the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists in each IO queue or not;
determining a target IO queue with IO data according to the state information;
and executing the polling task of the target IO queue through the CPU resource of the target group corresponding to the target IO queue according to the corresponding relation between the queue and the group.
Optionally, the grouping the multiple IO queues includes:
and grouping the plurality of queues in a dynamic grouping mode or a static grouping mode.
Optionally, the IO device sets status information of whether there is IO data corresponding to the IO queue according to whether there is IO data in each IO queue, including:
the IO equipment sets the value of a bit corresponding to the IO queue in a bitmap register according to whether each IO queue has IO data and the corresponding relation between the bit and the queue;
the determining a target IO queue with IO data according to the state information includes:
and determining a target IO queue with IO data according to the value of each bit of the bitmap register.
Optionally, the determining, according to the state information, a target IO queue having IO data includes:
executing an IO queue status polling task to detect the status information corresponding to each IO queue;
and determining a target IO queue with IO data according to the state detection result.
Optionally, the executing the IO queue status polling task to detect the status information corresponding to each IO queue includes:
executing an IO queue status polling task corresponding to the group to detect the status information corresponding to each IO queue in the group;
and determining a target IO queue with IO data according to the state detection result.
Optionally, the method further includes:
obtaining IO load capacity;
if the IO load quantity meets a preset condition, executing an IO queue status polling task to detect the status information corresponding to each IO queue;
and if the IO load quantity does not meet the preset condition, executing an IO queue state polling task corresponding to the group to detect the state information corresponding to each IO queue in the group.
Optionally, the method further includes:
obtaining IO load change information of the group;
and adjusting the number of CPUs corresponding to the group according to the IO load change information.
Optionally, the adjusting, according to the IO load change information, the number of CPUs corresponding to the group includes:
judging whether the group continues to have IO data to be processed within a preset time length according to the IO load change information;
and if so, increasing the number of CPUs corresponding to the group.
Optionally, the adjusting, according to the IO load change information, the number of CPUs corresponding to the group includes:
judging whether the group has no IO data to be processed continuously within a preset time length according to the IO load change information;
and if so, reducing the number of CPUs corresponding to the group.
Optionally, the executing, according to the correspondence between the queues and the packets, the polling task of the target IO queue through the CPU resource of the target packet corresponding to the target IO queue includes:
and aiming at a plurality of target IO queues of the target groups, executing polling tasks of the target IO queues through the CPU resources of the target groups according to a scheduling strategy.
Optionally, the number of CPUs of the packet is smaller than the number of IO queues of the packet.
The present application further provides an IO scheduling apparatus, including:
the IO queue and CPU grouping unit is used for grouping the plurality of IO queues and distributing CPU resources for the grouping;
the IO queue state setting unit is used for the IO equipment to set the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists or not in each IO queue;
the target IO queue determining unit is used for determining a target IO queue with IO data according to the state information;
a target IO queue polling task execution unit, configured to execute, according to a correspondence between a queue and a packet, a polling task of a target IO queue through a target packet CPU resource corresponding to the target IO queue
The present application further provides an electronic device, comprising:
a processor and a memory; a memory for storing a program for implementing the above method, the device being powered on and the program for the method being run by the processor.
The present application also provides a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform the various methods described above.
The present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the various methods described above.
Compared with the prior art, the method has the following advantages:
according to the IO scheduling method provided by the embodiment of the application, a plurality of IO queues of a computer system are grouped, and CPU resources are distributed to the groups; the IO equipment sets the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists in each IO queue or not; determining a target IO queue with IO data according to the state information; and executing the polling task of the target IO queue through the CPU resource of the target group corresponding to the target IO queue according to the corresponding relation between the queue and the group. By adopting the processing mode, the execution of excessive idle polling is reduced by aggregating a plurality of IO queue polling tasks, and the CPU resource of the overall polling of the system under the condition of low IO load can be effectively saved.
Drawings
Fig. 1 is a schematic flowchart of an embodiment of an IO scheduling method provided in the present application;
fig. 2 is a schematic flowchart of an IO scheduling method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating scheduling of an IO queue polling task according to an embodiment of an IO scheduling method provided in the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
In the application, an IO scheduling method and device and an electronic device are provided. Each of the solutions is described in detail in the following examples.
First embodiment
Please refer to fig. 1, which is a flowchart illustrating an IO scheduling method according to an embodiment of the present disclosure. In this embodiment, the method includes:
step S101: grouping a plurality of IO queues and allocating CPU resources for the groups.
A large number of peripheral devices, i.e., input/output IO devices, are deployed in a computer system. The IO device refers to hardware that can perform data transmission with a computer. IO devices include, but are not limited to: memory (e.g., hard disk, floppy disk, optical disk, etc.), network card, keyboard, mouse, etc.
The computer system, including but not limited to: terminal equipment, servers, workstations and the like.
In one example, the computer system may be a terminal device, such as a smartphone, tablet, or the like. Take a smart phone as an example, which includes peripherals such as a network card and a memory. The method comprises the steps that IO equipment on the smart phone sets state information whether IO data exist or not corresponding to IO queues according to whether the IO queues have the IO data or not; the smart phone determines a target IO queue with IO data according to the state information; and executing the polling task of the target IO queue through the CPU resource of the target group corresponding to the target IO queue according to the corresponding relation between the queue and the group.
In one example, the computer system may be a server, which includes network cards, memory, and like peripherals. The IO equipment on the server sets the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO queue has the IO data or not; the server determines a target IO queue with IO data according to the state information; and executing the polling task of the target IO queue through the CPU resource of the target group corresponding to the target IO queue according to the corresponding relation between the queue and the group.
In this embodiment, the computer system is a server, and the server includes a physical machine and a virtualization processing device. The virtualization processing device virtualizes the physical IO devices into a plurality of virtual IO devices, and allocates the plurality of virtual IO devices to a plurality of virtual hosts constructed based on the physical machine. In the device virtualization scene, the magnitude of the performance index of the physical IO device is far greater than that of the IO device in the ordinary server, correspondingly, the number of the IO queues in the device virtualization scene is far greater than that of the IO queues in the ordinary server, and in order to support extreme IO performance such as network/storage in the device virtualization scene, a large amount of CPU resources are often invested for polling the IO queues. The virtualization processing apparatus executes polling tasks of a plurality of IO queues corresponding to the physical IO devices using a plurality of CPUs included therein. For example, the virtualization processing apparatus may be a board card, the board card integrates a plurality of CPUs, various physical IO devices are inserted into the board card, a module responsible for IO device simulation is deployed on the virtualization processing apparatus, and an IO scheduling apparatus may also be deployed on the virtualization processing apparatus.
One IO device corresponds to at least one IO queue, and data in the IO queue is data that needs a CPU to respond, which is referred to as IO data in this embodiment. For example, a high-performance network card generally has tens of or even hundreds of queues, and when each network packet arrives, the network card will queue the network packet to a specific IO queue according to specific rules and configurations.
Each IO queue corresponds to an IO queue polling task. Polling refers to periodically checking the state of the peripheral by the CPU to see if service is required. The polling process of the IO queue is responsible for processing of IO queue data, including reading/processing/writing out and the like. And the polling process of the IO queue processes the IO data in the IO queue according to the scheduling strategy.
In the prior art, even if there is no IO data to be processed in the IO queue, the polling task corresponding to the IO queue is continuously executed, that is, idle polling always occupies CPU resources, and a large amount of IO queues and CPU resources used for IO queue polling are seriously wasted.
In the method provided by the embodiment of the application, the plurality of IO queue polling tasks are grouped and aggregated to reduce the execution of excessive idle polling, so that the purpose of reducing the resource waste of the overall polling of the system under the condition of low IO load is achieved. It should be noted that, according to the method provided in the embodiment of the present application, a structure of an existing IO queue polling task is not changed, and one IO queue still corresponds to one polling task, and only when there is no IO data to be processed in the IO queue, the polling task of the IO queue is not executed.
The method provided by the embodiment of the application can group a plurality of queues in a dynamic grouping mode or a static grouping mode. Static grouping means that the IO queue grouping is fixed and not adjusted in real time. Dynamic grouping means that the grouping condition of the IO queue can be dynamically adjusted, for example, adjusted according to the IO load condition of one packet.
Taking static grouping as an example, grouping can be performed according to IO devices, and a plurality of IO queues of the same IO device form one group, for example, the memory a includes 5 block devices, corresponds to 5 IO queues, and takes the 5 IO queues as one group; memory B includes 3 block devices, corresponding to 3 IO queues, and treats these 3 IO queues as one packet. In addition, a preset number of IO queues may be grouped into one group, and the number of IO queues in each group is the same. In specific implementation, other static grouping modes can also be adopted.
According to the method provided by the embodiment of the application, all IO queues of the computer system can be divided into one group or a plurality of groups, assuming that N IO queues are total, the IO queues are divided into m groups, each group comprises 1 to Nm IO queues, meanwhile, CPU resources are distributed by taking the group as a unit, and each group can have one or more available CPU resources (CPU cores).
In one example, the number of CPUs for a packet may be less than the number of IO queues for the packet, e.g., there are 5 IO queues for a packet, and 3 CPUs are allocated for the packet. The configuration can use the corresponding grouped CPU resources in a polling process of a plurality of IO queues in a public way, reduces the CPU resources for polling and is suitable for systems with middle or lower IO loads.
In one example, the number of CPUs in a packet is equal to the number of IO queues in the packet, for example, a packet has 5 IO queues, and 5 CPUs are allocated to the packet, so that each IO queue corresponds to one CPU resource, and each IO polling process continuously occupies one CPU core to poll one IO queue, which is equivalent to the amount of CPU resources used in the prior art. The configuration occupies most CPU resources and is suitable for a system with high IO load and even full load.
In one extreme case, all IO queues of a computer system are grouped into one group, and only one CPU is allocated, i.e. there is only one group globally, this configuration is suitable for systems with very light IO load.
After step S101 is executed, the correspondence between the IO queue, the packet, and the CPU resource may be obtained, as shown in table 1.
Figure BDA0003619121710000061
Figure BDA0003619121710000071
TABLE 1 correspondence between IO queues, packets and CPU resources
Step S103: and the IO equipment sets the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists in each IO queue or not.
The status information is status information for marking whether the IO queue has IO data, each IO queue corresponds to one status information, if one IO queue has IO data, the corresponding status information is yes, and if the IO queue does not have IO data, the status information is no.
In this embodiment, the corresponding relationship between the IO queue and the state may be obtained, as shown in table 2.
Queue Status of state
Queue
1 Is that
Queue 2 Whether or not
TABLE 2 correspondences between queues and states
In one example, a set of global private bitmap (bitmap) registers may be set to record whether each IO queue has status information of IO data. The bitmap register may include 128 or more bits, with each bit corresponding to an IO queue. Accordingly, step S103 can be implemented as follows: and the IO equipment sets the value of the bit corresponding to the IO queue in the bitmap according to whether each IO queue has IO data and the corresponding relation between the bit and the queue. Accordingly, step S105 can be implemented as follows: and determining a target IO queue with IO data according to the value of each bit of the bitmap register. The processing mode uses a bitmap to record whether the state of IO data exists in each IO queue or not, each position in a bitmap corresponds to one IO queue, the IO queue has the IO data which can be recorded as 1, the IO queue has no IO data which can be recorded as 0, and more data contents can be represented by using the bitmap with a limited data space.
In specific implementation, hardware logic of the IO device can be responsible for setting and clearing bit corresponding to the IO queue, and the bitmap register group can be read only by software. The IO device monitors the queue status of itself, and when data (IO data) arrives and the queue is not empty, the hardware logic sets the position corresponding to the queue in bitmap to 1, such as the queue Q in fig. 3 1 The corresponding position in the bitmap is 1; when the IO equipment monitors that all data in the queue is processed and the queue is empty, the hardware logic will store the bitmapThe corresponding position of the queue is set to 0, such as queue Q in FIG. 3 0 And Qm has no data, and the corresponding position in the bitmap is 0.
Step S105: and determining a target IO queue with IO data according to the state information.
In the step, a target IO queue with IO data is obtained according to the state information of each IO queue, and for the target IO queue with IO data to be processed, a polling task of the target IO queue needs to be scheduled to process the IO data.
In one example, step S105 can be implemented as follows: executing an IO queue status polling task to detect the status information corresponding to each IO queue; and determining a target IO queue with IO data according to the state detection result. By adopting the processing mode, a polling task is additionally added on the basis of the polling task of the existing IO queue, for convenience of description, the newly added polling task is called an IO queue status polling task, that is, the polling task performs polling (detection) processing on status information of each IO queue, and if the status of a certain IO queue is detected to indicate that the IO queue has IO data, the IO queue is used as a target IO queue. By adopting the processing mode, all the groups are polled through a single process, and the CPU resource can be effectively saved. And the single-process polling of all the groups means that one IO queue state polling task polls the states of the IO queues of all the groups.
In one example, step S105 can be implemented as follows: and executing an IO queue status polling task corresponding to the group to detect the status information corresponding to each IO queue in the group. By adopting the processing mode, each group has an independent polling process, and the polling performance of each group can be effectively improved according to the relation between the status information of the IO queue related to group polling, such as the bit and the group given in figure 3, so that the IO scheduling performance is improved. The fact that each group has an independent polling process means that an IO queue state polling task is created for each group, and the state of the IO queue of one group can be polled only by the IO queue state polling task of the group.
In one example, the method may further include the steps of: obtaining IO load capacity; accordingly, step S105 can be implemented as follows: if the IO load quantity meets a preset condition, executing an IO queue status polling task to detect the status information corresponding to each IO queue; and if the IO load quantity does not meet the preset condition, executing an IO queue state polling task corresponding to the group to detect the state information corresponding to each IO queue in the group. The preset condition may be determined according to an application requirement, for example, a load threshold is set. By adopting the processing mode, all the groups can be polled in a single process or each group has a separate polling process according to the actual IO load of the computer system; therefore, IO scheduling performance and CPU resource occupation can be effectively balanced.
In an example, the IO queue status polling task is to be run all the time, and only when the load is high and the polling tasks of all the IO queues are continuously executed by the individual CPUs, the IO queue status polling task may increase the polling interval and reduce the overhead.
Step S107: and executing the polling task of the target IO queue through the CPU resource of the target group corresponding to the target IO queue according to the corresponding relation between the queue and the group.
According to the corresponding relation between the queues and the groups, the target groups corresponding to the target IO queues are obtained, and the polling tasks of the target IO queues are executed through the CPU resources of the target groups.
In one example, step S107 can be implemented as follows: and aiming at a plurality of target IO queues of the target groups, executing polling tasks of the target IO queues through CPU resources of the target groups according to a scheduling strategy. The embodiment realizes that the polling processes of a plurality of IO queues are aggregated 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 may be responsible for polling a global bitmap, and maintaining a scheduling queue according to a group, and when data arrives at a certain IO queue, putting a polling process into the scheduling queue, and performing a polling process on an IO queue corresponding to the IO queue according to a specific policy (e.g., RR).
In one example, the method may further comprise the steps of:
step S201: and obtaining the IO load change information of the group.
Step S203: and adjusting the number of CPUs corresponding to the group according to the IO load change information.
In specific implementation, step S203 may be implemented as follows: judging whether the group continues to be processed IO data within a preset time length according to the IO load change information; and if so, increasing the number of CPUs corresponding to the group.
In specific implementation, step S203 may also be implemented as follows: judging whether the group has no IO data to be processed continuously within a preset time length or not according to the IO load change information; and if so, reducing the number of CPUs corresponding to the group.
In order to increase polling resources and improve IO performance when IO load changes, a system may be divided into an initial configuration, a configuration in which IO polling resources are maximized, and an intermediate state configuration between the initial configuration and the intermediate state configuration. The system initial configuration refers to grouping configuration of system IO queues and CPU resources according to experience, generally, the number of CPU in a group can be smaller than that of IO queues in the group, and in an extreme case, all IO queues of a computer system can be divided into a group and only one CPU is allocated; the configuration of maximizing the IO polling resources may be an extreme case where one queue corresponds to one CPU, that is, the number of CPU cores used for scheduling is the same as the number of IO queues.
When detecting that the system IO load increases, for example, within a period of time, a polling process continues to wait in the scheduling queue and cannot be scheduled to be executed, the aggregation scheduling module may dynamically add the CPU cores to the groups until the CPU resources of the groups reach the configuration of the IO polling resources maximization. Conversely, if there is a continuous idle poll of CPUs within a packet for a period of time, then the CPU resources of the packet may be reduced until the initial configuration.
By adopting the processing mode of the steps S201 and S203, the CPU resources of the groups for executing the IO queue polling task can be flexibly increased or decreased according to the load in the actual group; therefore, IO scheduling performance and CPU resource occupation can be effectively balanced.
As shown in fig. 2, which is an implementation manner of software and hardware cooperation of the method provided by the present application, a left side is a software process, and a right side is a hardware process of an IO device. IO equipment monitors the queue state of the IO equipment; when data arrives and the queue is not empty, the hardware logic sets the position corresponding to the queue in bitmap to be 1, as in the example of Q1 in fig. 2; when the data is completely processed and the queue is empty, the hardware logic sets the position corresponding to the queue in bitmap to be 0. The software flow is as follows: taking fig. 2 as an example, when the aggregation scheduling module polls that the queue Q1 is not empty, add a newly found non-empty queue polling process p1 into the scheduling queue, if the IO queue corresponding to the IO queue polling process being executed on the current CPU core is empty, immediately schedule and execute a polling process p1 of the newly found non-empty queue; and if the queue corresponding to the polling process currently executed on the CPU core is not empty, scheduling to execute polling according to a specific scheduling strategy, such as FIFO or Round-Robin. When no new non-empty queue is waiting for the polling process, the last scheduled polling process will always be executed on the CPU.
As can be seen from the foregoing embodiments, in the IO scheduling method provided in the embodiments of the present application, a plurality of IO queues of a computer system are grouped, and a CPU resource is allocated to the group; the IO equipment sets the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists or not in each IO queue; determining a target IO queue with IO data according to the state information; and executing the polling task of the target IO queue through the CPU resource of the target group corresponding to the target IO queue according to the corresponding relation between the queue and the group. By adopting the processing mode, the execution of excessive idle polling is reduced by aggregating a plurality of IO queue polling tasks, and the CPU resource of the overall polling of the system under the condition of low IO load can be effectively saved.
Second embodiment
In the foregoing embodiment, an IO scheduling method is provided, and correspondingly, the present application further provides an IO scheduling apparatus. The apparatus corresponds to the above-described embodiment of the scheduling method. Since the device embodiment is basically similar to the scheduling method example, the description is relatively simple, and relevant points can be found in the partial description of the scheduling method example. The device embodiments described below are merely illustrative.
The present application additionally provides an IO scheduling apparatus, including: the system comprises an IO queue, a CPU grouping unit, an IO queue state setting unit, a target IO queue determining unit and a target IO queue polling task executing unit.
The system comprises an IO queue and a CPU grouping unit, wherein the IO queue and the CPU grouping unit are used for grouping a plurality of IO queues of a computer system and distributing CPU resources for the grouping; the IO queue state setting unit is used for the IO equipment to set the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists in each IO queue or not; the target IO queue determining unit is used for determining a target IO queue with IO data according to the state information; and the target IO queue polling task execution unit is used for executing the polling task of the target IO queue through the CPU resource of the target packet corresponding to the target IO queue according to the corresponding relation between the queue and the packet.
In one example, the IO queue and the CPU grouping unit are specifically configured to group a plurality of queues in a dynamic grouping manner or a static grouping manner.
In one example, the IO queue state setting unit is specifically configured to set, by the IO device, a value of a bit corresponding to an IO queue in a bitmap register according to whether each IO queue has IO data and a corresponding relationship between the bit and the queue; correspondingly, the target IO queue determining unit is specifically configured to determine the target IO queue having IO data according to the value of each bit of the bitmap register.
In an 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 determining a target IO queue with IO data according to the state detection result.
In an example, the target IO queue determining unit is specifically configured to detect the state information corresponding to each IO queue in a packet through an IO queue state polling task corresponding to the packet.
In one example, the apparatus further comprises: an IO load change information acquisition unit and a CPU resource adjustment unit. The IO load change information acquisition unit is used for acquiring the IO load change information of the group; and the CPU resource adjusting unit is used for adjusting the number of the CPUs corresponding to the group according to the IO load change information.
In an example, the CPU resource adjusting unit is specifically configured to determine, according to the IO load change information, whether the group continues with IO data to be processed within a preset time period; and if so, increasing the number of CPUs corresponding to the group.
In an example, the CPU resource adjusting unit is specifically configured to determine, according to the IO load change information, whether the packet has no IO data to be processed continuously within a preset time period; and if so, reducing the number of CPUs corresponding to the group.
In an example, the target IO queue polling task execution unit is specifically configured to execute, for multiple target IO queues of a target packet, a polling task of the target IO queue through a CPU resource of the target packet according to a scheduling policy.
Third embodiment
In the foregoing embodiment, an IO scheduling method is provided, and correspondingly, the present application further provides an electronic device. The apparatus corresponds to an embodiment of the method described above. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application additionally provides an electronic device comprising: a processor and a memory. The memory is used for storing a program for implementing the IO scheduling method provided by the above method embodiment, and the terminal is powered on and runs the program of the method through the processor.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the claims that follow.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
1. Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 technology, compact disc read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which 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 computer readable media (transient media), such as modulated data signals and carrier waves.
2. As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (13)

1. An IO scheduling method, comprising:
grouping a plurality of IO queues, and allocating CPU resources for the grouping, wherein the CPU resources are used for executing polling tasks of the IO queues;
the IO equipment sets the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists in each IO queue or not;
determining a target IO queue with IO data according to the state information;
and executing the polling task of the target IO queue through the CPU resource of the target group corresponding to the target IO queue according to the corresponding relation between the queue and the group.
2. The method of claim 1, wherein grouping the plurality of IO queues comprises:
and grouping the plurality of queues in a dynamic grouping mode or a static grouping mode.
3. The method of claim 1,
the IO equipment sets the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists in each IO queue or not, and the method comprises the following steps:
the IO equipment sets the value of a bit corresponding to the IO queue in a bitmap register according to whether each IO queue has IO data and the corresponding relation between the bit and the queue;
the determining a target IO queue with IO data according to the state information includes:
and determining a target IO queue with IO data according to the value of each bit of the bitmap register.
4. The method of claim 1, wherein determining the target IO queue with IO data according to the state information comprises:
executing an IO queue status polling task to detect the status information corresponding to each IO queue;
and determining a target IO queue with IO data according to the state detection result.
5. The method of claim 1, wherein the performing an IO queue status polling task to detect the status information corresponding to each IO queue comprises:
executing an IO queue status polling task corresponding to the group to detect the status information corresponding to each IO queue in the group;
and determining a target IO queue with IO data according to the state detection result.
6. The method of claim 1, further comprising:
obtaining IO load capacity;
if the IO load quantity meets a preset condition, executing an IO queue state polling task to detect the state information corresponding to each IO queue;
and if the IO load quantity does not meet the preset condition, executing an IO queue state polling task corresponding to the group to detect the state information corresponding to each IO queue in the group.
7. The method of claim 1, further comprising:
obtaining IO load change information of the group;
and adjusting the number of CPUs corresponding to the group according to the IO load change information.
8. The method of claim 7,
the adjusting the number of CPUs corresponding to the group according to the IO load change information includes:
judging whether the group continues to be processed IO data within a preset time length according to the IO load change information;
and if the judgment result is yes, increasing the number of the CPUs corresponding to the group.
9. The method of claim 7,
the adjusting the number of CPUs corresponding to the group according to the IO load change information includes:
judging whether the group has no IO data to be processed continuously within a preset time length according to the IO load change information;
and if so, reducing the number of CPUs corresponding to the group.
10. The method according to claim 1, wherein the performing, according to the correspondence between the queue and the packet, the polling task of the target IO queue through the CPU resource of the target packet corresponding to the target IO queue includes:
and aiming at a plurality of target IO queues of the target groups, executing polling tasks of the target IO queues through CPU resources of the target groups according to a scheduling strategy.
11. The method of claim 1, wherein the number of CPUs for the packet is less than the number of IO queues for the packet.
12. An IO scheduling apparatus, comprising:
the IO queue and CPU grouping unit is used for grouping the plurality of IO queues and distributing CPU resources for the grouping;
the IO queue state setting unit is used for the IO equipment to set the state information whether the IO data exists or not corresponding to the IO queue according to whether the IO data exists in each IO queue or not;
a target IO queue determining unit, configured to determine a target IO queue having IO data according to the state information;
and the target IO queue polling task execution unit is used for executing the polling task of the target IO queue through the CPU resource of the target group corresponding to the target IO queue according to the corresponding relation between the queue and the group.
13. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing the IO scheduling method according to any one of claims 1 to 11, the terminal being powered on and running the program of the method via the processor.
CN202210452210.9A 2022-04-27 2022-04-27 IO (input/output) scheduling method, device and equipment Pending CN114924848A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210452210.9A CN114924848A (en) 2022-04-27 2022-04-27 IO (input/output) scheduling method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210452210.9A CN114924848A (en) 2022-04-27 2022-04-27 IO (input/output) scheduling method, device and equipment

Publications (1)

Publication Number Publication Date
CN114924848A true CN114924848A (en) 2022-08-19

Family

ID=82806444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210452210.9A Pending CN114924848A (en) 2022-04-27 2022-04-27 IO (input/output) scheduling method, device and equipment

Country Status (1)

Country Link
CN (1) CN114924848A (en)

Similar Documents

Publication Publication Date Title
US9274844B2 (en) Priority-based management of system load level
US9454407B2 (en) Service resource allocation
US8190795B2 (en) Memory buffer allocation device and computer readable medium having stored thereon memory buffer allocation program
CN110413412B (en) GPU (graphics processing Unit) cluster resource allocation method and device
CN111984407B (en) Data block read-write performance optimization method, system, terminal and storage medium
CN113867644B (en) Disk array optimization method, disk array optimization device, computer equipment and storage medium
CN113590508B (en) Dynamic reconfigurable memory address mapping method and device
CN106598724B (en) Method for managing memory in a computing system
CN108932112B (en) Data read-write method, device, equipment and medium for solid particles
CN109766056A (en) A kind of storage array controllers IO array dispatching method and device
CN104679575A (en) Control system and control method for input and output flow
CN111338579B (en) Read-write cache optimization method, system, terminal and storage medium based on storage pool
CN115904671B (en) Task scheduling method, device, equipment and medium in edge computing environment
CN114924848A (en) IO (input/output) scheduling method, device and equipment
CN110209350A (en) It is a kind of to mix in storage architecture HPC system using the dynamic dispatching method of I/O request
US6732196B2 (en) Allowing slots belonging to a second slot category to receive I/O access requests belonging to a first and a second access request categories in a round robin fashion
US11586475B2 (en) Application aware resource allocation for deep learning job scheduling
CN116560560A (en) Method for storing data and related device
CN114327862A (en) Memory allocation method and device, electronic equipment and storage medium
CN108595367B (en) Server system based on computer cluster in local area network
CN109144231B (en) Virtualized power management method and device
CN110865768A (en) Write cache resource allocation method, device, equipment and storage medium
CN117539609A (en) IO flow control method, system and equipment
CN117827572A (en) Data processing method, device, equipment and storage medium
Zheng et al. CLIBE: Precise Cluster-Level I/O Bandwidth Enforcement in Distributed File System

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination