CN115454640B - Task processing system and self-adaptive task scheduling method - Google Patents

Task processing system and self-adaptive task scheduling method Download PDF

Info

Publication number
CN115454640B
CN115454640B CN202211150630.8A CN202211150630A CN115454640B CN 115454640 B CN115454640 B CN 115454640B CN 202211150630 A CN202211150630 A CN 202211150630A CN 115454640 B CN115454640 B CN 115454640B
Authority
CN
China
Prior art keywords
unit
cpu core
consumption weight
task
weight
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.)
Active
Application number
CN202211150630.8A
Other languages
Chinese (zh)
Other versions
CN115454640A (en
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.)
Suzhou Qiheng Rongzhi Information Technology Co ltd
Original Assignee
Suzhou Qiheng Rongzhi Information Technology Co 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 Suzhou Qiheng Rongzhi Information Technology Co ltd filed Critical Suzhou Qiheng Rongzhi Information Technology Co ltd
Priority to CN202211150630.8A priority Critical patent/CN115454640B/en
Publication of CN115454640A publication Critical patent/CN115454640A/en
Application granted granted Critical
Publication of CN115454640B publication Critical patent/CN115454640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/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
    • 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)
  • Multi Processors (AREA)

Abstract

The present application relates to the field of storage devices, and in particular, to a task processing system and a method for adaptive task scheduling, including: acquiring the workload of each CPU core; adjusting the consumption weight of each CPU core according to the workload of each CPU core; and scheduling operation requests provided by task processing units which are operated on each CPU core as producers according to the consumption weight of each CPU core. The method and the device can enable different CPU cores to have different use frequencies, so that workload of multitasking of the multiple CPU cores in different scenes is balanced.

Description

Task processing system and self-adaptive task scheduling method
Technical Field
The present disclosure relates to the field of storage devices, and in particular, to a task processing system and a method for adaptive task scheduling.
Background
In some applications, the processor needs to handle large-scale concurrent tasks. For example: an embedded processor for a network device, a storage device, needs to process multiple concurrent network packets or multiple concurrent IO commands.
Referring to fig. 1A, fig. 1A shows a schematic diagram of a prior art process for large-scale concurrent tasks.
The left-to-right direction is the direction of time lapse. FIG. 1A also shows a plurality of tasks being processed (task 1-1, task 2-1, task 3-1, task 1-2, task 2-2, and task 3-2), wherein in the reference numerals with structure "a-b", the former symbol a indicates a task, and the latter symbol b indicates a subtask included in the task. FIG. 1A shows that 3 tasks are processed in time sequence, each task comprising 2 subtasks.
Solid arrows indicate the time sequence of processing a plurality of tasks, and dashed arrows indicate the logical sequence of task processing. For example, taking task 1 as an example, task 1-1 is processed before task 1-2 is processed. Still by way of example, referring to FIG. 1A, task 1-2 cannot be processed immediately after task 1-1 is processed (due to the required resources not being ready, etc.), so task 2-1 and task 3-1 can be executed first by scheduling, and then task 1-2 can be scheduled for execution after task 3-1 is processed in response to task 1-2 (due to the required resources being ready, etc.).
On a processor, tasks are processed by executing code segments. A single CPU (or CPU core) handles only a single task at any one time. Illustratively, as shown in FIG. 1A, for a plurality of tasks to be processed, a code segment of processing task 1-1 is executed first, a code segment of processing task 2-1 is executed next, a code segment of processing task 3-1 is executed next, a code segment of processing task 1-2 is executed next, a code segment of processing task 2-2 is executed next, and a code segment of processing task 3-2 is executed next. The logical order of task processing is indicated in the code segments of the respective processing tasks. For example, the logical sequence includes tasks 1-2 to be processed after task 1-1. As yet another example, the code segment whose logical order is post-processed is indicated in the code segment of processing task 1-1 as the code segment of processing task 1-2.
Referring to FIG. 1B, FIG. 1B is a schematic diagram of a prior art task processing system.
The task processing system comprises software and hardware. The hardware includes, for example, one or more CPUs running software, other hardware resources (e.g., memory, codec, interface, accelerator, interrupt controller, etc.) that handle related tasks.
The code segments of the software running on the CPU are referred to as task processing units. The task processing system includes a plurality of task processing units, each of which processes the same or different tasks. For example, task processing unit 0 processes a first sub-task of a task (e.g., task 1-1, task 2-1, and task 3-1), while task processing unit 1, task processing unit 2, and task processing unit 3 process a second sub-task of a task (e.g., task 1-2, task 2-2, and task 3-2).
The resources required by the task processing unit include, for example, a CPU core, a memory space, data to be read, an indication of completion of a data write operation, and the like. In the example of the storage device, the task processing unit includes, for example, a DM (Data Manager) unit for receiving an IO command sent by the host, analyzing key information of the IO command, moving Data between the host and the storage device, an SM (Schedule Manager) unit, a GC (Garbage Collection) unit, and the like. For the write command, an operation request corresponding to the write command is also sent to the SM unit for further processing. The GC unit is used for performing garbage collection, including selection of the collected data, transmission of write requests generated according to the collected data to the SM unit, and the like. The SM unit is used for assembling data corresponding to operation requests of the DM unit and the GC unit, sending the assembled data to the flash memory controller, receiving a processing completion message provided by the flash memory controller, and taking charge of subsequent processes, such as updating of a flash memory conversion layer mapping table, log request generation, release of related resources and the like.
Referring to fig. 2A, fig. 2A is a schematic diagram illustrating a distribution of different task processing units on a CPU core in the prior art.
Taking a task processing system in which a storage device processes write commands as an example: to process the write command, the task processing system provides a DM unit, an SM unit, and a GC unit. To provide concurrency capability for handling write commands, there are 4 DM units, and 2 GC units and SM units each. These task processing units are scheduled and processed on, for example, 4 CPU cores. For example: one DM unit and one SM unit are scheduled and processed on CPU0, one DM unit and one SM unit are scheduled and processed on CPU1, one DM unit and one GC unit are invoked and processed on CPU2, and one DM unit and one GC unit are invoked and processed on CPU 3.
Referring to fig. 2B, fig. 2B is a schematic diagram illustrating interaction between a DM unit and an SM unit in the prior art.
Figure 2B shows 4 DM units and 2 SM units. The interaction between tasks in the pure write case is as follows, and each of the 4 DM units provides an operation request to any one SM unit. In such a task interaction structure, the DM unit generates and provides an operation request to the SM unit, and the SM unit processes the operation request generated by the DM unit, thereby constituting a producer and consumer model, the DM unit as a producer generates the operation request, and the SM unit as a consumer processes the operation request.
In fig. 2B, 4 CPU cores (CPU 0 to CPU 3) are also provided, 4 DM units are located at one of CPU0, CPU1, CPU2, CPU3, respectively, and two SM units are located at CPU0 and CPU1, respectively.
As can be seen from fig. 2B, it is obvious that the workload of CPU0 and CPU1 is heavier (because DM units and SM units are to be operated), while the workload of CPU2 and CPU3 is lighter (because only DM units are to be operated separately and SM units are not to be operated), if SM units treat each DM unit indiscriminately to process a write request, CPU2 and CPU3 are in an idle state, resulting in waste of CPU computation power and failure to exert the maximum computation power of the system.
In practice, the task processing system further includes other task processing units such as GC units, and there are also differences in the number of CPU cores, the number of each task processing unit, and the rate/type of IO commands provided by the host, which further aggravates the complexity of the task processing system and aggravates the load imbalance of each CPU core.
Disclosure of Invention
The application provides a task processing system and a self-adaptive task scheduling method, so that different CPU cores have different use frequencies, and the workload of multiple CPU cores under different scenes is balanced.
In order to solve the technical problems, the application provides the following technical scheme:
A method of adaptive task scheduling, comprising the steps of: acquiring the workload of each CPU core; adjusting the consumption weight of each CPU core according to the workload of each CPU core; and scheduling operation requests provided by task processing units which are operated on each CPU core as producers according to the consumption weight of each CPU core.
The method for adaptive task scheduling as described above, in one exemplary embodiment, adjusts the consumption weight of each CPU core according to the workload of each CPU core, including: when the workload of the CPU core is increased or is too high, the consumption weight of a task processing unit which is operated on the CPU core and serves as a producer is increased; when the workload of a CPU core is reduced or too low, the consumption weight of a task processing unit which is operated on the CPU core and is used as a producer is reduced.
The method for adaptive task scheduling as described above, in which an exemplary embodiment schedules an operation request provided by a task processing unit that is a producer running on each CPU core according to a consumption weight of each CPU core, includes: when the consumption weight of the CPU core is increased, the scheduling probability of operation requests provided by a task processing unit which is operated on the CPU core and serves as a producer is reduced; when the consumption weight of the CPU core is reduced, the scheduling probability of operation requests provided by a task processing unit which is operated on the CPU core and serves as a producer is improved.
In the method for adaptive task scheduling as described above, an exemplary embodiment of the present invention is to consume the available weight of the CPU core according to the adjusted consumption weight of the CPU core when scheduling an operation request provided by a task processing unit that is a producer and runs on each CPU core; judging the available weight and the consumption weight of the CPU core when the available weight of the CPU core is consumed according to the consumption weight of the CPU core after adjustment; if the available weight of the CPU core is smaller than the consumption weight of the CPU core, refusing to call an operation request provided by a task processing unit which is operated on the CPU core and serves as a producer; and if the available weight of the CPU core is not less than the consumption weight of the CPU core, calling an operation request provided by a task processing unit which is operated on the CPU core and serves as a producer.
In the method for adaptive task scheduling as described above, an exemplary embodiment is to maintain the same consumption weight and the same availability weight for two CPU cores if the scales of task processing units running on the two CPU cores are the same.
In the method for adaptive task scheduling as described above, an exemplary embodiment is to schedule operation requests provided from task processing units acting as producers on two CPU cores in the same manner if the same consumption weight and the same availability weight are maintained for the two CPU cores.
The method for adaptive task scheduling as described above, in one exemplary embodiment, adjusts the consumption weight of each CPU core according to the workload of each CPU core, including: obtaining the maximum workload and the minimum workload from the workload of each CPU core; comparing whether the difference between the maximum workload and the minimum workload is greater than a specified threshold; if the workload is larger than the specified threshold, the consumption weight of the CPU core with the largest workload is increased.
In the method for adaptive task scheduling as described above, in an exemplary embodiment, after increasing the consumption weight of a CPU core with a maximum workload, it is determined whether the consumption weight of the CPU core reaches the maximum value of the consumption weight; if the consumption weight of the CPU core is smaller than the maximum value of the consumption weight, continuing to increase the consumption weight of the CPU core; if the consumption weight of the CPU core is equal to or greater than the maximum value of the consumption weight, the consumption weight of the CPU core with the minimum workload is reduced.
In the method for adaptive task scheduling as described above, an exemplary embodiment is to reduce the consumption weight of a CPU core with a minimum workload, and then determine whether the consumption weight of the CPU core reaches the minimum value of the consumption weight; if the consumption weight of the CPU core is equal to or smaller than the minimum value of the consumption weight, the consumption weight of the CPU core is not reduced any more; if the consumption weight of the CPU core is larger than the minimum value of the consumption weight, the consumption weight of the CPU core is continuously reduced.
A task processing system, comprising: a task processing unit as a producer and a task processing unit as a consumer running on the CPU core, wherein the task processing unit as a consumer includes a task scheduling subunit; the task scheduling subunit performs the method of adaptive task scheduling described above.
Compared with the background art, the task processing system and the self-adaptive task scheduling method provided by the invention have the advantages that the SM unit is mainly used for adjusting the DM unit operation request processing of different CPU cores, so that different CPU cores have different use frequencies, and the workload of multiple CPU cores under different scenes can be balanced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1A shows a schematic diagram of a prior art process for large-scale concurrent tasks;
FIG. 1B illustrates a schematic diagram of a prior art task processing system;
FIG. 2A is a schematic diagram showing the distribution of different task processing units on a CPU core in the prior art;
figure 2B shows a schematic diagram of the interaction of a DM unit with an SM unit in the prior art;
FIG. 3A illustrates a schematic diagram of a task processing system according to one embodiment of the present application;
figure 3B illustrates a flow chart of the operation of the task scheduling subunit of the SM unit according to one embodiment of the present application;
FIG. 4A illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application;
FIG. 4B illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application
FIG. 5 illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application;
figure 6 illustrates a flow chart of the operation of a task scheduling subunit of an SM unit according to yet another embodiment of the present application;
FIG. 7 illustrates a flow chart of a task processing unit as a consumer processing an operation request according to an embodiment of the present application;
FIG. 8 illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of illustrating the present application and are not to be construed as limiting the present application.
Referring to fig. 3A, fig. 3A illustrates a schematic diagram of a task processing system according to one embodiment of the present application.
The task processing system includes a DM unit and an SM unit, and as shown in fig. 3A, the task processing system provided in the present application includes: a DM0 unit, a DM1 unit and a SM0 unit, wherein the DM0 unit and the DM1 unit serve as producers to provide operation requests for the SM0 unit, and the SM0 unit serves as consumers to process the operation requests provided for the DM0 unit and the DM1 unit. The task processing system includes 2 CPU cores (CPU 0 and CPU 1), CPU0 runs DM0 unit and SM0 unit, and CPU1 runs DM1 unit. According to an embodiment of the present application, the SM0 unit circularly processes operation requests generated from the DM0 unit and the DM1 unit, and the SM0 unit further includes a first task scheduling sub-unit (denoted by S0) for selecting whether to process the operation request from the DM0 unit or the operation request from the DM1 unit.
Referring to fig. 3B, fig. 3B illustrates an operational flow diagram of a task scheduling subunit of an SM unit according to one embodiment of the present application.
The task scheduling subunit of the SM unit performs scheduling on operation requests of the DM unit from the corresponding CPU core according to the workload F of the CPU core and the consumption weight W of the CPU core.
The consumption weight W is a statistical parameter based on the CPU core, and is not a parameter based on a task processing unit (e.g., DM unit, GC unit). If only one DM unit runs on one CPU core, the consumption weight of the CPU core is the consumption weight of the DM unit; if a DM unit and a DM 'unit are operated on a CPU core, the consumption weight of the CPU core is the sum of the consumption weight of the DM unit and the consumption weight of the DM' unit; if a DM unit and a GC unit are running on a CPU core, the consumption weight of the CPU core is the sum of the consumption weight of the DM unit and the consumption weight of the GC unit. For example: w0 represents the drain weight of the DM0 unit, and W1 represents the drain weight of the DM1 unit.
The workload F of the CPU core reflects the busyness of the CPU core. For example: f0 represents the workload of CPU0, F1 represents the workload of CPU1, the smaller the workload of the CPU core, the more idle the CPU core, and conversely, the larger the workload of the CPU core, the more busy the CPU core. As an example, the workload F is represented by the usage rate or power consumption of the CPU core, and for example, the ratio (loopCnt/loopCntInital 100) of the number of times loopCntInital that the CPU core completes a specified task cycle in a specified time in a certain state to the number of times loopCntInital that the CPU core completes a specified task cycle in the same specified time in the initial state (no task processing) is used as the workload F, and the number of times loopCntInital in the initial state is theoretically maximum. Then, if the busyness is 100, it indicates that the CPU core is completely idle.
When the SM unit dispatches and processes the operation request of the DM unit, taking the example that only one DM unit runs on the CPU core, the SM unit consumes the available weight according to the consumption weight of the adjusted CPU core. For the available weights, in other embodiments, the available weights of the DM units are recovered in time. Wherein the available weight T is a statistical parameter based on the CPU core, and is used to represent the processing capability currently available to the CPU core. As shown in fig. 3A, for example, when the consumption weight of the DM0 unit increases, the probability that the operation request provided by the DM0 unit running on the CPU0 is scheduled by the SM0 unit is reduced; similarly, when the consumption weight of the DM1 unit decreases, the probability that the operation request provided by the DM1 unit running on the CPU1 is scheduled by the SM0 unit is increased.
Taking the example shown in fig. 3B as an example, according to an embodiment of the present application, the operation flow includes: the first task scheduling subunit S0 of the SM0 unit obtains the workload F0 of the CPU0 and the workload F1 of the CPU1 (310), and adjusts the consumption weight W0 of the DM0 unit and the consumption weight W1 of the DM1 unit according to the workload F0 of the CPU0 unit and the workload F1 of the CPU1 unit (320). For example, when the workload of a certain CPU core (e.g., CPU 0) is raised or too high, the consumption weight of a task processing unit (e.g., DM0 unit) operating on the CPU core as a producer is raised. For another example, when the workload of a certain CPU core (e.g., CPU 0) is reduced or too low, the consumption weight of a task processing unit (e.g., DM0 unit) operating on the CPU core as a producer is reduced. The task scheduling subunit adjusts the consumption weight of each CPU core based on the condition of the workload of each CPU core, and the operation of improving/reducing the consumption weight W of different DM units can be implemented independently or simultaneously, so as to realize the load balancing of different CPU cores as soon as possible, improve the processing speed and avoid the waste of resources. Taking CPU0 as an example, the workload increase of CPU0 means that the current workload increases by more than a certain threshold compared with the previous workload, and the workload over-high of the CPU core means that the value of the current workload exceeds a certain threshold.
Taking the example shown in fig. 3B as an example, the operation flow further includes: the first task scheduling subunit S0 of the SM0 unit selects, according to the adjusted consumption weights W0 and W1, whether to process the operation request provided by the DM0 unit or the DM1 unit (330). By way of example, the respective available weights (denoted as T0 and T1) for the DM0 and DM1 units are 100, while the consumption weight values (denoted as W0 and W1) for the DM0 and DM1 units are, for example, 10. When the first task scheduling subunit S0 of the SM0 unit selects to obtain the operation request from the DM0 unit, the consumption weight value W0 is subtracted from the available weight T0 value of the DM0 unit accordingly to obtain the remaining available weight T0 '(T0' =t0-W0) of the DM0 unit. And when the available weight of the CPU core is consumed according to the consumption weight of the CPU core after adjustment, judging the available weight and the consumption weight of the CPU core. When the first task scheduling subunit S0 of the SM0 unit selects to obtain the operation request from the DM1 unit, the consumption weight value W1 is subtracted from the available weight T1 value of the DM1 unit accordingly to obtain the remaining available weight T1 '(T1' =t1-W1) of the DM1 unit. If the available weight T0 of the DM0 unit is smaller than the consumption weight W0 thereof, the first task scheduling subunit S0 of the SM0 unit refuses to invoke the operation request provided by the DM0 unit. If the available weight T1 of the DM1 unit is not less than the consumption weight W1 thereof, the first task scheduling subunit S0 of the SM0 unit invokes the operation request provided by the DM1 unit. Thus, a larger consumption weight W means less processing of operation requests generated for DM units having the consumption weight W within a specified time; while a smaller consumption weight W means more processing of operation requests generated for DM units having the consumption weight W within a specified time. Further, by increasing the consumption weight W, the probability that the DM unit corresponding to the consumption weight W is scheduled is reduced, and by decreasing the consumption weight W, the probability that the DM unit corresponding to the consumption weight W is scheduled is increased.
Referring to fig. 4A, fig. 4A illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application.
The task processing system includes a DM unit and an SM unit, and as shown in fig. 4A, the task processing system provided in the present application includes: DM0 unit, DM1 unit, DM2 unit, DM3 unit, SM0 unit, and SM1 unit. Wherein the DM0 unit-DM 3 unit serves as a producer to provide an operation request to the SM0 unit/SM 11 unit, and the SM0 unit/SM 1 unit serves as a consumer to process the operation request provided by the DM0 unit-DM 3 unit. The task processing system includes 4 CPU cores (CPU 0, CPU1, CPU2, and CPU 3), CPU0 being for running DM0 unit and SM0 unit, and CPU1 being for running DM1 unit and SM1 unit, CPU2 being for running DM2 unit, and CPU3 being for running DM3 unit.
According to an embodiment of the present application, the SM0 unit/SM 1 unit each circularly processes an operation request provided from the DM0 unit/DM 1 unit/DM 2 unit/DM 3 unit, the SM0 unit further includes a first task scheduling sub-unit (denoted by S0), and the SM1 unit further includes a second task scheduling sub-unit (denoted by S1) for executing the operation flow illustrated in fig. 3B. The first task scheduling subunit S0 and the second task scheduling subunit S1 each independently perform task scheduling without being affected by each other.
In other embodiments, the first task scheduling subunit S0 and the second task scheduling subunit S1 maintain independent consumption weights W for the DM0 unit-DM 3 unit, so that the adjustment of the consumption weights W of the DM0 unit-DM 3 unit by the first task scheduling subunit S0 does not affect the adjustment of the consumption weights W of the DM0 unit-DM 3 unit by the second task scheduling subunit S1, and similarly, the adjustment of the consumption weights W of the DM0 unit-DM 3 unit by the second task scheduling subunit S1 does not affect the adjustment of the consumption weights W of the DM0 unit-DM 3 unit by the first task scheduling subunit S0.
For example, the first task scheduling subunit S0 maintains the consumption weights W00, W01, W02 and W03, the second task scheduling subunit S1 maintains the consumption weights W10, W11, W12 and W13, wherein in the notation like "Wab," the first symbol a after "W" refers to the task scheduling subunit and the second symbol b refers to the DM unit, so that W01 indicates that the first task scheduling subunit S0 maintains the consumption weights for the DM1 unit, and similarly, W13 indicates that the second task scheduling subunit S1 maintains the consumption weights for the DM3 unit.
In other embodiments, the first task scheduling sub-unit S0 and the second task scheduling sub-unit S1 also each maintain an independent available weight T for the DM0 unit-DM 3 unit. For example, the first task scheduling subunit S0 maintains the available weights T00, T01, T02 and T03, the second task scheduling subunit S1 maintains the available weights T10, T11, T12 and T13, wherein in the notation like "Tab," the first symbol a after "T" refers to the task scheduling subunit and the second symbol b refers to the DM unit, so that T01 indicates that the first task scheduling subunit S0 maintains the available weights for the DM1 unit, and similarly, T13 indicates that the second task scheduling subunit S1 maintains the available weights for the DM3 unit.
To schedule operation requests from the DM0 unit-DM 3 unit, the workload of the CPU0-CPU3 acquired by the first task scheduling subunit S0 and the second task scheduling subunit S1 are identical, i.e., the workload of a certain CPU core acquired by each of the first task scheduling subunit S0 and the second task scheduling subunit S1 is the same.
As an example, when the second task scheduling subunit S1 acquires that the workload of the CPU2 is reduced or lower than that of the other CPU cores, the consumption weight of the DM2 unit as the producer operated by the CPU2 is reduced, so that the second task scheduling subunit S1 schedules the operation request of the DM2 unit to the SM1 unit more for processing.
In yet another embodiment, still referring to FIG. 4A, if the scale of the task processing units running on two CPU cores is the same, the same consumption weight and the same availability weight are maintained for the two CPU cores. The same scale means that the number of task processing units running on the CPU core is equal, since the DM0 unit and the DM1 unit are peer-to-peer (which share 1 CPU core with 1 SM unit), the DM2 unit and the DM3 unit are peer-to-peer (which each monopolize 1 CPU core), that is, the DM0 unit and the SM0 unit running on the CPU0, the DM1 unit and the SM1 unit running on the CPU1, the task processing units running on the CPU0 and the CPU1 are the same scale, the DM2 unit running on the CPU2, the DM3 unit running on the CPU3, and the task processing units running on the CPU2 and the CPU3 are the same scale, so that the first task scheduling subunit S0 and the second task scheduling subunit S1 schedule operation requests from the DM0 unit and the DM1 unit in the same manner, and also schedule operation requests from the DM2 unit and the DM3 unit in the same manner, thereby simplifying the complexity of the first task scheduling subunit S0/the second task scheduling subunit S1 to implement operation request scheduling. For example, the proportion of the consumption weight of DM0 unit-DM 3 unit is 10:10:1:1, this means that the weight consumed by the SM unit to process 10 times the operation request of the DM0 unit and the DM1 unit and the SM unit to process 1 time the operation request of the DM2 unit and the DM3 unit are the same. For another example, the first task scheduling subunit S0 maintains the same consumption weight W0b for DM0 units and DM1 units, and maintains the same consumption weight W0b 'for DM2 units and DM3 units, and the first task scheduling subunit S0 determines whether to acquire an operation request from DM0 units/DM 1 units according to the consumption weight W0b, and determines whether to acquire an operation request from DM2 units/DM 3 units according to the consumption weight W0 b'. Similarly, the second task scheduling sub-unit S1 maintains the same consumption weight W1b for the DM0 unit and the DM1 unit, and maintains the same consumption weight W1b 'for the DM2 unit and the DM3 unit, and the second task scheduling sub-unit S1 determines whether to acquire the operation request from the DM0 unit/DM 1 unit according to the consumption weight W1b, and determines whether to acquire the operation request from the DM2 unit/DM 3 unit according to the consumption weight W1 b'. "scheduling in the same manner" herein refers to scheduling operation requests provided by the task processing units while maintaining the same probability.
In other embodiments, the first task scheduling subunit S0 numbered 0 maintains the same available weight T0b for the DM0 unit and the DM1 unit, and maintains the same available weight T0b' for the DM2 unit and the DM3 unit; the second task scheduling subunit S1, numbered 1, maintains the same available weight T1b for DM0 units as DM1 units, and the same available weight T1b' for DM2 units as DM3 units.
Referring to fig. 4B, fig. 4B illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application.
The task processing system includes a DM unit and an SM unit, and as shown in fig. 4B, the task processing system provided in the present application includes: DM0 unit, DM1 unit, DM2 unit, DM3 unit, SM0 unit, and SM1 unit. Wherein the DM0 unit-DM 3 unit serves as a producer to provide an operation request to the SM0 unit/SM 11 unit, and the SM0 unit/SM 1 unit serves as a consumer to process the operation request provided by the DM0 unit-DM 3 unit. The task processing system includes 4 CPU cores (CPU 0, CPU1, CPU2, and CPU 3), CPU0 being for running DM0 unit and SM0 unit, and CPU1 being for running DM1 unit and SM1 unit, CPU2 being for running DM2 unit, and CPU3 being for running DM3 unit.
According to an embodiment of the present application, the SM0 unit/SM 1 unit each loops through operation requests provided from the DM0 unit/DM 1 unit/DM 2 unit/DM 3 unit. Other embodiments, only one of the two SM units (SM 0 unit and SM1 unit) includes a task scheduling subunit. For example: the SM0 unit includes a first task scheduling subunit (denoted by S0) for executing the operation flow illustrated in fig. 3B.
With continued reference to FIG. 4B, if the same consumption weight and the same availability weight are maintained for two CPU cores, operation requests provided from task processing units on both CPU cores as producers are scheduled in the same manner. Since the DM0 unit is peer to peer with the DM1 unit (which shares 1 CPU core with 1 SM unit), the DM2 unit is peer to peer with the DM3 unit (which each monopolizes 1 CPU core), i.e., the DM0 unit and the SM0 unit are running on CPU0, the DM1 unit and the SM1 unit are running on CPU1, the task processing units running on CPU0 and CPU1 are the same scale, the DM2 unit is running on CPU2, the DM3 unit is running on CPU3, the task processing units running on CPU2 and CPU3 are the same scale, so that the first task scheduling subunit S0 schedules operation requests from the DM0 unit and the DM1 unit in the same manner, and also schedules operation requests from the DM2 unit and the DM3 unit in the same manner, thereby simplifying the complexity of the first task scheduling subunit S0 to implement operation request scheduling. For example, the proportion of the consumption weight of DM0 unit-DM 3 unit is 10:10:1:1, this means that the weight consumed by the SM unit to process 10 times the operation request of the DM0 unit and the DM1 unit and the SM unit to process 1 time the operation request of the DM2 unit and the DM3 unit are the same. For another example, the first task scheduling subunit S0 maintains the same consumption weight W0b for DM0 units and DM1 units, and maintains the same consumption weight W0b 'for DM2 units and DM3 units, and the first task scheduling subunit S0 determines whether to acquire an operation request from DM0 units/DM 1 units according to the consumption weight W0b, and determines whether to acquire an operation request from DM2 units/DM 3 units according to the consumption weight W0 b'.
In other embodiments, the first task scheduling subunit S0 maintains the same available weight T0b for DM0 units as DM1 units, and the same available weight T0b' for DM2 units as DM3 units.
Referring to fig. 5, fig. 5 illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application.
The task processing system includes a DM unit, an SM unit, and a GC unit, and fig. 5 is an example, where the task processing system provided in the present application includes: DM0 unit, DM1 unit, DM2 unit, DM3 unit, GC0 unit, GC1 unit, SM0 unit, and SM1 unit, wherein DM0 unit-DM 3 unit and GC0 unit and GC1 unit are used as producers to provide operation requests to SM0 unit/SM 1 unit, and SM0 unit/SM 1 unit is used as consumer to process operation requests. The task processing system includes 4 CPU cores (CPU 0, CPU1, CPU2, and CPU 3), CPU0 is used to run DM0 unit and SM0 unit, CPU1 is used to run DM1 unit and SM0 unit, CPU2 is used to run DM2 unit and GC0 unit, and CPU3 is used to run DM3 unit and GC1 unit. So that the task processing units running on the respective CPU cores are identical to or different from each other.
According to an embodiment of the present application, the SM0 unit/SM 1 unit respectively processes the operation requests from the DM0 unit/DM 1 unit/DM 2 unit/DM 3 unit and the GC0 unit/GC 1 unit in a cyclic manner, and the SM0 unit further includes a first task scheduling subunit (denoted by S0), and the SM1 unit further includes a second task scheduling subunit (denoted by S1) for executing the operation procedure illustrated in fig. 3B. The first task scheduling subunit S0 and the second task scheduling subunit S1 each independently perform task scheduling without being affected by each other.
In other embodiments, the first task scheduling subunit S0 and the second task scheduling subunit S1 each maintain independent consumption weights W for DM0 units-DM 3 units and GC0 units GC1 units. The adjustment of the consumption weight depends on the judgment of the busyness of different CPU cores, that is, the workload of the CPU cores, and the adjustment of the consumption weight mainly adjusts the weight of the SM unit for processing the operation request of the DM unit running on the different CPU cores. The GC units and the SM units are bound, that is, the operation request of the GC unit is generally processed by the SM unit corresponding to the GC unit, and the consumption weight is not generally adjusted.
For example, a first task scheduling subunit S0 numbered 0 maintains consumption weights W0D0, W0D1, W0D2, W0D3, W0G0 and W0G1, a second task scheduling subunit S1 numbered 1 maintains consumption weights W1D0, W1D1, W1D2, W1D3, W1G0, W1G1, wherein in a symbol like "Waxb," the first symbol follows "W" refers to a task scheduling subunit, while the second symbol refers to a task processing unit (D stands for DM unit, and G stands for GC unit) as a producer, and the third symbol refers to a number of a producer task processing unit, such that W0D1 represents the consumption weight maintained by the first task scheduling subunit S0 numbered 0 for DM1 unit, and similarly, W1G1 represents the consumption weight maintained by the second task scheduling subunit S1 numbered 1 for GC1 unit.
In other embodiments, the first task scheduling subunit S0 and the second task scheduling subunit S1 also maintain independent available weights T for DM0 unit-DM 3 unit and GC0 unit-GC 1 unit, respectively.
For example, a first task scheduling subunit S0 numbered 0 maintains the available weights T0D0, T0D1, T0D2, T0D3, T0G0 and T0G1, a second task scheduling subunit S1 numbered 1 maintains the available weights T1D0, T1D1, T1D2, T1D3, T1G0 and T1G1, wherein in a symbol like "tax", the first symbol following "T" refers to the number of task scheduling subunits, while the second symbol refers to the task processing unit (D stands for DM unit, and G stands for GC unit) as producer, and the third symbol refers to the number of producer task processing units, such that T0D1 indicates the first task scheduling subunit S0 numbered 0 is the available weight maintained by DM1 unit, and similarly, T1G1 indicates the second task scheduling subunit S1 numbered 1 is the available weight maintained by GC1 unit.
In order to schedule operation requests from the DM0 unit-DM 3 unit and the GC0 unit-GC 1 unit, the first task scheduling subunit S0 and the second task scheduling subunit S1 acquire the workload of the CPU0-CPU3, and adjust the consumption weight of the task processing unit serving as a producer on the CPU core corresponding to the workload according to the workload condition.
As an example, when the second task scheduling subunit S1 obtains that the workload of the CPU2 is reduced or lower than that of the other CPU cores, the consumption weight W of the producer DM2 unit and/or GC0 unit (based on the statistical parameters of the CPU cores) that is run by the CPU2 is reduced, so that the second task scheduling subunit S1 schedules the operation request of the DM2 unit and/or GC0 unit to the SM1 unit for processing more, and since the GC0 unit is bound to the SM unit, the reduction of the consumption weight W (based on the statistical parameters of the CPU cores) is mainly to reduce the consumption weight of the DM2 unit.
Although the task scheduling method of the embodiment of the present application is described in the above example by taking the DM unit, the GC unit, and the SM unit as examples, it is understood that the task scheduling method of the present application can be applied to a task processing system including other numbers/kinds of task processing units and other numbers of CPU cores.
According to a further embodiment of the present application, the task processing unit (DM 0 unit-DM 3 unit, GC0 unit-GC 1 unit) as the producer sends the operation request to the task processing unit (e.g., SM unit) as the consumer through the queue. The task processing unit as a consumer obtains and processes the operation request from the queue corresponding to the task processing unit as a producer selected by the task scheduling subunit. Thus, if a task processing unit as a producer is not scheduled by a task processing unit as a consumer for a long time, its queue will be filled with operation requests, and the task processing unit as a producer will respond to the queue being filled without generating operation requests. Therefore, the task scheduling subunit can further reduce the operation request generated by the task scheduling subunit by reducing or stopping scheduling of a certain task processing unit serving as a producer, and even enable the task processing unit serving as the producer to stop working, so that the consumption of the task processing unit serving as the producer to the CPU core resource is further reduced, and the workload of the CPU core is further reduced.
It should be noted that, the queues in the task processing units in the above embodiment are examples of caching operation requests, and other manners may be used to cache operation requests.
Still referring to fig. 5, as a further embodiment, the scheduling performed by the first task scheduling subunit S0/the second task scheduling subunit S1 on the DM2 unit and the DM3 unit does not affect the processing of the operation request generated by the GC0 unit/the GC1 unit. Although there is a GC0 unit/GC 1 unit, the operation request generated by the GC0 unit/GC 1 unit is controlled in other ways, for example, the proportion of the write data amount of the operation request generated by each of the DM unit and the GC unit is controlled, without controlling the processing of the operation request generated by the GC0 unit/GC 1 unit based on the consumption weight W.
Referring to fig. 6, fig. 6 illustrates an operation flowchart of a task scheduling subunit of an SM unit according to yet another embodiment of the present application.
The task scheduling subunit executes the operation flow of fig. 6 periodically (for example, 1 time per second) or in a specified case according to fig. 6 to update the consumption weight W of each task processing unit as a producer.
As shown in the operation flow in fig. 6, the task scheduling subunit of the SM unit obtains the workload F of each CPU core (610), and marks the workload of the CPU un as Fn, where n is the number of CPU cores and is an integer.
From the workloads F of the CPU cores (n CPU cores), a maximum workload fi_max and a minimum workload fj_min are obtained (620), that is, the workload Fi of the CPU i is the maximum workload of all the workloads of the CPU cores, the workload Fj of the CPU j is the minimum workload of all the workloads of the CPU cores, i and j are integers, and whether the difference between fi_max and fj_min is excessive (for example, whether the difference is greater than a specified threshold, and the specified threshold may be 5) is compared (630). If the difference between fi_max and fj_min is too large, it indicates that the workload of each CPU core is unbalanced, and the workload F of each CPU core needs to be adjusted by updating the consumption weight W. For example, the CPU core (CPU i) that acquires the maximum workload (Fi_max) increases its consumption weight W (640) for the task processing unit (e.g., DM0 unit) that is the producer running thereon. It will be appreciated that when the flow of fig. 6 is performed by a task processing unit (e.g., SM1 unit) that is a consumer, the adjusted consumption weight is the consumption weight (e.g., W1D 0) corresponding to the task processing unit (SM 1 unit). As an example, each time the consumption weight W is increased, it is updated with a specified step size, for example, w=w+1. If the difference is not too large (e.g., if the difference is not greater than a specified threshold), then it is indicated that, of course, the workload of each CPU core is balanced, and the workload of each CPU core need not be adjusted by updating the consumption weight W, at which point the workload F of each CPU core may continue to be acquired periodically or under specified circumstances (610).
The consumption weight of the task processing unit has a maximum value (denoted Wmax, for example, may be 16, which may be adaptively selected according to circumstances), and it is also necessary to determine whether the consumption weight Wi of the task processing unit (for example, DM0 unit) as a producer running on the CPU core (CPU ui) reaches the maximum value Wmax of the consumption weight (650). When the consumption weight Wi does not reach the maximum value Wmax of the consumption weight (i.e., wi is smaller than Wmax), the consumption weight Wi of the task processing unit (e.g., DM0 unit) as the producer may also continue to be increased (660), and the workload F of each CPU core may continue to be acquired periodically or in a specified case back (610), and the above steps may be repeated.
When the consumption weight Wi of the task processing unit (e.g., DM0 unit) as the producer running on the CPU core (CPU i) has reached the maximum value Wmax of the consumption weight (i.e., wi is greater than or equal to Wmax), the consumption weight Wi is not increased any more, but the consumption weight Wj (670) of the task processing unit (e.g., DM 3) as the producer running on the CPU core (CPU j) of the minimum workload (fj_min) is decreased. As an example, each time the consumption weight W is reduced, it is updated with a specified step size, e.g., w=w-1.
The task processing unit's consumption weight also has a minimum value (denoted Wmin), and it is also necessary to determine whether the consumption weight Wj of the task processing unit (e.g., DM 3) as a producer running on the CPU core (CPU uj) reaches the minimum value Wmin of the consumption weight (680). When the consumption weight Wj has reached the minimum value Wmin of the consumption weight (i.e., wj is greater than or equal to Wmin), the consumption weight Wj is no longer reduced (e.g., wj is not updated). When the consumption weight Wj has not reached the minimum value Wmin of the consumption weight (i.e., wj is less than Wmin), the consumption weight Wj of the task processing unit (e.g., DM 3) as the producer may continue to be reduced (690), and the workload F of each CPU core may continue to be acquired periodically or in a specified case back (610), repeating the above steps.
Regardless of how the consumption weights are adjusted, the operational flow illustrated in FIG. 6 requires a return to the step of acquiring the workload of the CPU core for the next execution of the operational flow illustrated in FIG. 6.
In other embodiments, when the SM unit runs for the first time after power-up, the task scheduling subunit may initialize the consumption weights of the task processing units.
In other embodiments, the task scheduling subunit belongs to a task processing unit as a consumer, and only adjusts the consumption weights of the task processing units as producers (both have a production-consumption relationship) corresponding to the task processing unit as a consumer, where the task processing unit as a producer provides operation requests to the task processing unit as a consumer, without adjusting the consumption weights of the task processing units as producers that do not correspond to the task processing units as consumers.
In other embodiments, the task scheduling subunit updates its consumption weights for one or more of its corresponding task processing units as producers, and/or for one or more of its corresponding task processing units as the producer, as the task scheduling subunit executes the operational flow of FIG. 6. In other embodiments, the task scheduling subunit updates its consumption weights for the designated task processing units that are producers, as needed or indicated by the user.
Referring to FIG. 7, FIG. 7 illustrates a flow chart of a task processing unit as a consumer processing an operation request according to an embodiment of the present application.
Taking the SM unit as an example, the task processing unit as a consumer acquires the task processing unit i as a producer to be scheduled (710). In case there are a plurality of task processing units as producers (e.g. DM0 unit-DM 3 unit, GC0 unit-GC 1 unit), the task processing units i as producers to be scheduled are selected in a round-robin or weighted round-robin manner, for example.
It is determined whether the task processing unit i as the producer can be scheduled, for example, whether its available weight Ti is equal to or greater than its current consumption weight Wi (720). If the available weight Ti is not greater than the consumption weight Wi, the task processing unit i serving as a producer cannot be scheduled, and other task processing units to be scheduled are acquired in a returning mode. If its available weight Ti is greater than or equal to its consumption weight Wi, the task processing unit i as the producer may be scheduled, and accordingly its consumption weight Wi is subtracted from its available weight Ti to indicate the consumption of the available weight Ti (730), and an operation message from the task processing unit i as the producer is acquired for processing (740).
In other embodiments, the available weights are restored, e.g., a specified amount, automatically in response to a specified time lapse or in response to a user instruction, in order to schedule and manage the processing of the operation message.
Referring to fig. 8, fig. 8 illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application.
The task processing system includes a DM unit, an SM unit, and a GC unit, and fig. 8 is an example, where the task processing system provided in the present application includes: a DM0 unit-DM 3 unit, a SM0 unit-SM 1 unit, and a GC0 unit-GC 1 unit, wherein the DM0 unit-DM 3 unit serves as a producer to provide an operation request to the SM0 unit-SM 1 unit, and the SM0 unit-SM 1 unit serves as a consumer to process the operation request. The task processing system further includes 4 CPU cores (CPU 0, CPU1, CPU2, and CPU 3), CPU0 being for operating DM0 unit, GC0 unit, and SM0 unit, and CPU1 being for operating DM1 unit, GC1 unit, and SM1 unit, CPU2 being for operating DM2 unit, and CPU3 being for operating DM3 unit.
According to the embodiment of the application, the SM0 unit/SM 1 unit respectively and circularly processes operation requests from the DM0 unit/DM 1 unit/DM 2 unit/DM 3 unit and the GC0 unit/GC 1 unit, the SM0 unit further comprises a first task scheduling subunit S0, the SM1 unit further comprises a second task scheduling subunit S1, and the first task scheduling subunit S0 and the second task scheduling subunit S1 respectively and independently perform task scheduling without being affected by each other.
In other embodiments, the first task scheduling subunit S0 and the second task scheduling subunit S1 maintain independent consumption weights for the CPU0, the CPU1, the CPU2 and the CPU3, respectively. So that a single consumption weight is maintained for a CPU core even if a plurality of task processing units such as a DM unit, a GC unit, an SM unit, etc. are run on the CPU core.
For example, the first task scheduling subunit S0 maintains the consumption weights W00, W01, W02 and W03, the second task scheduling subunit S1 maintains the consumption weights W10, W11, W12 and W13, wherein in the notation like "Wab," the first symbol behind "W" refers to the task scheduling subunit and the second symbol refers to the CPU core, so that W01 represents the consumption weight maintained by the first task scheduling subunit S0 numbered 0 for the CPU1, and similarly, W13 represents the consumption weight maintained by the second task scheduling subunit S1 numbered 1 for the CPU 3. In other embodiments, the first task scheduling subunit S0 numbered 0 maintains independent available weights T01, T02 and T03 for CPU0-CPU3, the second task scheduling subunit S1 numbered 1 maintains independent available weights T10, T11, T12 and T13 for CPU0-CPU3, wherein the first symbol following the "T" in the symbol shaped as "Tab" refers to the task scheduling subunit and the second symbol refers to the CPU core, such that T01 represents the available weight maintained by the first task scheduling subunit S0 numbered 0 for CPU1, and similarly T13 represents the available weight maintained by the second task scheduling subunit S1 numbered 1 for CPU 3.
The first task scheduling subunit S0 and the second task scheduling subunit S1 each schedule and process operation requests from DM units and/or GC units of different CPU cores according to the consumption weights and the available weights. Taking the first task scheduling subunit S0 as an example, when the available weight T00 is greater than the consumption weight W00, the operation request from the DM0 unit/GC unit may be scheduled by the SM0 unit.
The first task scheduling subunit S0 and the second task scheduling subunit S1 also adjust the consumption weights maintained by the CPU cores according to the obtained workload of the CPU0-CPU 3. For example, when the workload of a certain CPU core is significantly higher than other CPU cores, the consumption weight of the CPU core is increased; when the workload of a certain CPU core is significantly lower than that of other CPU cores, the consumption weight of the CPU core is reduced. Referring also to fig. 6, for example, the difference between the maximum workload fi_max and the minimum workload fj_min in CPU0-CPU3 is greater than a specified threshold, the consumption weight is raised for CPU i with the maximum workload, and/or the consumption weight is lowered for CPU j with the minimum workload.
The consumption weight of the CPU core changes, so that the probability of the operation request of the DM unit or the GC unit running on the CPU core being scheduled and processed correspondingly changes.
In other embodiments, the first task scheduling subunit S0/second task scheduling subunit S1 schedules operation requests from DM0 units/DM 1 units in the same manner, schedules operation requests from GC0 units/GC 1 units in the same manner, and schedules operation requests from DM2 units/DM 3 units in the same manner, so that the first task scheduling subunit S0/second task scheduling subunit S1 maintains a single consumption weight for DM0 units/DM 1 units and a single consumption weight for DM2/DM3, to simplify the complexity of the first task scheduling subunit S0/second task scheduling subunit S1 in performing operation request scheduling, while GC0 units and GC1 units and SM units are bundled, their consumption weights cannot be adjusted. For example, the first task scheduling subunit S0 maintains the same consumption weight W0b for CPU0 running DM0 unit as CPU1 running DM1 unit, and the same consumption weight W0b' for CPU2 running DM2 unit as CPU3 running DM3 unit. Similarly, the second task scheduling subunit maintains the same consumption weight W1b for CPU0 running the DM0 unit as CPU1 running the DM1 unit, and the same consumption weight W1b' for CPU2 running the DM2 unit as CPU3 running the DM3 unit.
In other embodiments, the first task scheduling subunit S0 maintains the same available weight T0b for the CPU0 running the DM0 unit and the CPU1 running the DM1 unit, and maintains the same available weight T0b' for the CPU2 running the DM2 unit and the CPU3 running the DM3 unit; the second task scheduling subunit maintains the same available weight T1b for CPU0 running DM0 units as CPU1 running DM1 units, and the same available weight T1b' for CPU2 running DM2 units as CPU3 running DM3 units.
In other embodiments, only one of the two SM units includes a task scheduling subunit.
According to the method and the device, based on task division weight and scheduling weight, the DM unit operation request processing of different CPU cores is regulated mainly through regulating the SM unit, so that different use frequencies of different CPU cores can be regulated in a self-adaptive mode under different application scenes, the workload of multiple CPU cores and multiple tasks under different scenes can be balanced, and different CPUs have the same use frequency.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present disclosure describes embodiments, not every embodiment is provided with a separate embodiment, and that this description is provided for clarity only, and that the disclosure is not limited to the embodiments described in detail below, and that the embodiments described in the examples may be combined as appropriate to form other embodiments that will be apparent to those skilled in the art.

Claims (8)

1. A method for adaptive task scheduling, comprising the steps of:
acquiring the workload of each CPU core;
adjusting the consumption weight of each CPU core according to the workload of each CPU core;
adjusting the consumption weight of each CPU core according to the workload of each CPU core, including:
when the workload of the CPU core is increased or is too high, the consumption weight of a task processing unit which is operated on the CPU core and serves as a producer is increased;
when the workload of the CPU core is reduced or is too low, reducing the consumption weight of a task processing unit which is operated on the CPU core and is used as a producer;
scheduling operation requests provided by task processing units which are operated on each CPU core as producers according to the consumption weight of each CPU core;
when scheduling operation requests provided by task processing units which are operated on each CPU core and serve as producers, the available weights of the CPU cores are consumed according to the consumption weights of the CPU cores after adjustment;
Judging the available weight and the consumption weight of the CPU core when the available weight of the CPU core is consumed according to the consumption weight of the CPU core after adjustment;
if the available weight of the CPU core is smaller than the consumption weight of the CPU core, refusing to call an operation request provided by a task processing unit which is operated on the CPU core and serves as a producer;
and if the available weight of the CPU core is not less than the consumption weight of the CPU core, calling an operation request provided by a task processing unit which is operated on the CPU core and serves as a producer.
2. The method of adaptive task scheduling according to claim 1, wherein scheduling operation requests provided by a task processing unit operating as a producer on each CPU core according to a consumption weight of each CPU core, comprises:
when the consumption weight of the CPU core is increased, the scheduling probability of operation requests provided by a task processing unit which is operated on the CPU core and serves as a producer is reduced;
when the consumption weight of the CPU core is reduced, the scheduling probability of operation requests provided by a task processing unit which is operated on the CPU core and serves as a producer is improved.
3. A method of adaptive task scheduling according to claim 1 or 2, wherein the same consumption weight and the same availability weight are maintained for two CPU cores if the scale of the task processing units running on the two CPU cores is the same.
4. A method of adaptive task scheduling according to claim 3, wherein if the same consumption weight and the same availability weight are maintained for two CPU cores, operation requests provided from task processing units on both CPU cores as producers are scheduled in the same way.
5. The method of adaptive task scheduling according to claim 1 or 2, wherein adjusting the consumption weight of each CPU core according to the workload of each CPU core comprises:
obtaining the maximum workload and the minimum workload from the workload of each CPU core;
comparing whether the difference between the maximum workload and the minimum workload is greater than a specified threshold;
if the workload is larger than the specified threshold, the consumption weight of the CPU core with the largest workload is increased.
6. The method of adaptive task scheduling according to claim 5, wherein after increasing the consumption weight of the CPU core with the largest workload, determining whether the consumption weight of the CPU core reaches the maximum value of the consumption weight;
if the consumption weight of the CPU core is smaller than the maximum value of the consumption weight, continuing to increase the consumption weight of the CPU core;
if the consumption weight of the CPU core is equal to or greater than the maximum value of the consumption weight, the consumption weight of the CPU core with the minimum workload is reduced.
7. The method of adaptive task scheduling according to claim 6, wherein after reducing the consumption weight of the CPU core with the smallest workload, determining whether the consumption weight of the CPU core reaches the minimum value of the consumption weight;
if the consumption weight of the CPU core is equal to or smaller than the minimum value of the consumption weight, the consumption weight of the CPU core is not reduced any more;
if the consumption weight of the CPU core is larger than the minimum value of the consumption weight, the consumption weight of the CPU core is continuously reduced.
8. A task processing system, comprising: a task processing unit as a producer and a task processing unit as a consumer running on the CPU core, wherein the task processing unit as a consumer includes a task scheduling subunit; a task scheduling subunit performs the method of adaptive task scheduling of any one of claims 1-7.
CN202211150630.8A 2022-09-21 2022-09-21 Task processing system and self-adaptive task scheduling method Active CN115454640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211150630.8A CN115454640B (en) 2022-09-21 2022-09-21 Task processing system and self-adaptive task scheduling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211150630.8A CN115454640B (en) 2022-09-21 2022-09-21 Task processing system and self-adaptive task scheduling method

Publications (2)

Publication Number Publication Date
CN115454640A CN115454640A (en) 2022-12-09
CN115454640B true CN115454640B (en) 2024-01-19

Family

ID=84304658

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211150630.8A Active CN115454640B (en) 2022-09-21 2022-09-21 Task processing system and self-adaptive task scheduling method

Country Status (1)

Country Link
CN (1) CN115454640B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239153A (en) * 2014-09-29 2014-12-24 三星电子(中国)研发中心 Method and device for balancing multi-core CPU load
CN107797853A (en) * 2016-09-07 2018-03-13 深圳市中兴微电子技术有限公司 A kind of method for scheduling task, device and polycaryon processor
CN110995614A (en) * 2019-11-05 2020-04-10 华为技术有限公司 Computing power resource allocation method and device
CN112395055A (en) * 2019-08-15 2021-02-23 英特尔公司 Method and apparatus for implementing dynamic processing of predefined workloads
CN112988344A (en) * 2021-02-09 2021-06-18 中国建设银行股份有限公司 Distributed batch task scheduling method, device, equipment and storage medium
CN113608878A (en) * 2021-08-18 2021-11-05 上海德拓信息技术股份有限公司 Task distributed scheduling method and system based on resource weight calculation
CN114077481A (en) * 2020-08-12 2022-02-22 浙江宇视科技有限公司 Task scheduling method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3805924A1 (en) * 2019-10-11 2021-04-14 Unify Patente GmbH & Co. KG Method of scheduling an additional new processing task to be executed by a processor, scheduler, and central processing unit

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239153A (en) * 2014-09-29 2014-12-24 三星电子(中国)研发中心 Method and device for balancing multi-core CPU load
CN107797853A (en) * 2016-09-07 2018-03-13 深圳市中兴微电子技术有限公司 A kind of method for scheduling task, device and polycaryon processor
CN112395055A (en) * 2019-08-15 2021-02-23 英特尔公司 Method and apparatus for implementing dynamic processing of predefined workloads
CN110995614A (en) * 2019-11-05 2020-04-10 华为技术有限公司 Computing power resource allocation method and device
CN114077481A (en) * 2020-08-12 2022-02-22 浙江宇视科技有限公司 Task scheduling method, device, equipment and storage medium
CN112988344A (en) * 2021-02-09 2021-06-18 中国建设银行股份有限公司 Distributed batch task scheduling method, device, equipment and storage medium
CN113608878A (en) * 2021-08-18 2021-11-05 上海德拓信息技术股份有限公司 Task distributed scheduling method and system based on resource weight calculation

Also Published As

Publication number Publication date
CN115454640A (en) 2022-12-09

Similar Documents

Publication Publication Date Title
CN111176828B (en) System on chip comprising multi-core processor and task scheduling method thereof
Zhang et al. Dynamic cloud task scheduling based on a two-stage strategy
JP5324934B2 (en) Information processing apparatus and information processing method
CN109324875B (en) Data center server power consumption management and optimization method based on reinforcement learning
US8332862B2 (en) Scheduling ready tasks by generating network flow graph using information receive from root task having affinities between ready task and computers for execution
Xu et al. Adaptive task scheduling strategy based on dynamic workload adjustment for heterogeneous Hadoop clusters
US20080066070A1 (en) Method and system for the dynamic scheduling of jobs in a computing system
JPH0659906A (en) Method for controlling execution of parallel
CN111767134A (en) Multitask dynamic resource scheduling method
WO2016115000A1 (en) Hybrid scheduler and power manager
US20120254822A1 (en) Processing optimization load adjustment
CN110795238A (en) Load calculation method and device, storage medium and electronic equipment
Stavrinides et al. Orchestrating bag-of-tasks applications with dynamically spawned tasks in a distributed environment
CN109189581B (en) Job scheduling method and device
Peri et al. Orchestrating the execution of serverless functions in hybrid clouds
CN111367645B (en) Real-time task scheduling control method, system, equipment and readable storage medium
US11954518B2 (en) User-defined metered priority queues
CN115454640B (en) Task processing system and self-adaptive task scheduling method
CN113407313B (en) Resource demand-aware multi-queue scheduling method, system and server
Kalogeraki et al. Dynamic migration algorithms for distributed object systems
CN114116220A (en) GPU (graphics processing Unit) sharing control method, GPU sharing control device and storage medium
CN111858013A (en) Workflow job scheduling control method
CN114443262A (en) Computing resource management method, device, equipment and system
Dokulil et al. Adaptive scheduling of collocated applications using a task-based runtime system
Singla et al. Task Scheduling Algorithms for Grid Computing with Static Jobs: A Review

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
GR01 Patent grant
GR01 Patent grant