CN115454640A - 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
CN115454640A
CN115454640A CN202211150630.8A CN202211150630A CN115454640A CN 115454640 A CN115454640 A CN 115454640A CN 202211150630 A CN202211150630 A CN 202211150630A CN 115454640 A CN115454640 A CN 115454640A
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.)
Granted
Application number
CN202211150630.8A
Other languages
Chinese (zh)
Other versions
CN115454640B (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

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/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 application relates to the field of storage equipment, in particular to a task processing system and a method for self-adaptive task scheduling, which comprises the following steps: 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 the operation request provided by the task processing unit which runs on each CPU core and is used as a producer according to the consumption weight of each CPU core. According to the method and the device, different CPU cores can have different use frequencies, so that the workload of multiple CPU cores and multiple tasks under different scenes is balanced.

Description

Task processing system and self-adaptive task scheduling method
Technical Field
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.
Background
In some applications, the processor needs to handle large-scale concurrent tasks. For example: an embedded processor for a network device or a storage device needs to process multiple network packets or multiple IO commands concurrently.
Referring to fig. 1A, fig. 1A is a schematic diagram illustrating a process for processing concurrent tasks in a large scale in the prior art.
The left-to-right direction is a direction in which time elapses. Fig. 1A also shows a plurality of tasks (task 1-1, task 2-1, task 3-1, task 1-2, task 2-2, and task 3-2) being processed, wherein in the reference numerals structured "a-b", a former symbol a indicates a task, and a latter symbol b indicates a subtask included in the task. FIG. 1A illustrates that 3 tasks are processed in a time sequence, each task comprising 2 subtasks.
The solid arrows indicate the temporal order of processing a plurality of tasks, and the dashed arrows indicate the logical order of processing the tasks. For example, taking task 1 as an example, task 1-1 is processed first, and then task 1-2 is processed. Still by way of example, referring to FIG. 1A, after processing task 1-1, task 1-2 (for reasons such as required resources not being ready) cannot be processed immediately, and thus task 1-2 is scheduled to be executed after processing task 3-1 by scheduling task 2-1 and task 3-1 to be executed first, and then in response to task 1-2 (for reasons such as required resources being ready) being able to be processed.
On a processor, tasks are processed by executing code segments. A single CPU (or CPU core), only processing a single task at any one time. Illustratively, as shown in FIG. 1A, for multiple tasks to be processed, the code segment for processing task 1-1 is executed first, followed by the code segment for processing task 2-1, followed by the code segment for processing task 3-1, followed by the code segment for processing task 1-2, followed by the code segment for processing task 2-2, and followed by the code segment for processing task 3-2. The logical order of processing of the tasks is indicated in the code segments of the respective processing tasks. For example, the logical sequence includes tasks 1-2 to be processed after tasks 1-1. As yet another example, a code segment whose logical order post-processing is indicated in the code segments of processing task 1-1 should be the code segment of processing task 1-2.
Referring to fig. 1B, fig. 1B is a schematic diagram of a task processing system in the prior art.
The task processing system comprises a software part and a hardware part. The hardware includes, for example, one or more CPUs running software, other hardware resources (e.g., memory, codecs, interfaces, accelerators, interrupt controllers, etc.) associated with processing related tasks.
A code segment of software running on the CPU is referred to as a task processing unit. 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), and task processing unit 1, task processing unit 2, and task processing unit 3 processes 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 an example of the storage device, the task processing unit includes, for example, a Data Manager (DM) unit, a Scheduling Manager (SM) unit, a Garbage Collection (GC) unit, and the like, and the DM unit is configured to receive an IO command sent by a host, analyze key information of the IO command, and move Data between the host and the storage device. 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 implementing garbage collection, and the garbage collection comprises selection of collected data, generation of a write request according to the collected data, sending of the write request to the SM unit and the like. The SM unit is configured to assemble data corresponding to the operation requests of the DM unit and the GC unit, send the assembled data to the flash memory controller, receive a processing completion message provided by the flash memory controller, and take charge of subsequent processes, such as updating a mapping table of a flash memory translation layer, generating a log request, and releasing related resources.
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 of the storage device for processing the write command as an example: in order 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 processing write commands, there are 4 DM units and 2 GC units and SM units. 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 the CPU0, one DM unit and one SM unit are scheduled and processed on the CPU1, one DM unit and one GC unit are called and processed on the CPU2, and one DM unit and one GC unit are called and processed on the CPU 3.
Referring to fig. 2B, fig. 2B is a schematic diagram illustrating an interaction between a DM unit and an SM unit in the prior art.
Fig. 2B shows 4 DM units and 2 SM units. In the case of an interaction between tasks in the write-only case, 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 produces the operation request as a producer, and the SM unit processes the operation request as a consumer.
In fig. 2B, 4 CPU cores (CPU 0-CPU 3) are also provided, 4 DM units are located at one of CPU0, CPU1, CPU2, and 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 the DM unit and SM unit are run), while the workload of CPU2 and CPU3 is lighter (because only the DM unit is run separately, but not the SM unit is run), and if the SM unit treats each DM unit indiscriminately to process the write request, CPU2 and CPU3 will be in an idle state, which results in a waste of CPU power and failure to exert the maximum power of the system.
In practice, the task processing system also includes other task processing units such as GC units, and the number of CPU cores, the number of task processing units, and the rate/type of IO commands provided by the host are also different, which further increases the complexity of the task processing system and increases the load imbalance of the CPU cores.
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 multi-CPU core multitask under different scenes is balanced.
In order to solve the technical problem, the application provides the following technical scheme:
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; and scheduling the operation request provided by the task processing unit which is operated on each CPU core and is used as a producer according to the consumption weight of each CPU core.
The method for adaptive task scheduling as described above, in which an exemplary embodiment is to adjust the consumption weight of each CPU core according to the workload of each CPU core, includes: when the workload of the CPU core is increased or overhigh, the consumption weight of the task processing unit which is operated on the CPU core and is used as a producer is increased; when the workload of a CPU core decreases or is too low, the consumption weight of the task processing unit as a producer running on the CPU core is decreased.
An exemplary embodiment of the method for adaptive task scheduling as described above is that, the scheduling operation requests provided by the task processing units running on the CPU cores as producers according to the consumption weights of the CPU cores includes: when the consumption weight of the CPU core is increased, the probability that the operation request provided by the task processing unit which is operated on the CPU core and serves as a producer is dispatched is reduced; when the consumption weight of the CPU core is reduced, the probability that the operation request provided by the task processing unit which is operated on the CPU core and is used as a producer is scheduled is improved.
In an exemplary embodiment of the method for adaptive task scheduling as described above, when scheduling an operation request provided by a task processing unit that is running on each CPU core and is a producer, an available weight of the CPU core is consumed according to an adjusted consumption weight of the CPU core; when the available weight of the CPU core is consumed according to the adjusted consumption weight of the CPU core, judging the available weight and the consumption weight of the CPU core; if the available weight of the CPU core is smaller than the consumption weight, refusing to call the operation request provided by the 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, calling an operation request provided by a task processing unit which is operated on the CPU core and is used as a producer.
In the method for adaptive task scheduling as described above, in an exemplary embodiment, if the sizes of the task processing units running on the two CPU cores are the same, the same consumption weight and the same available weight are maintained for the two CPU cores.
In the method for adaptive task scheduling as described above, an exemplary embodiment is that if the same consumption weight and the same available weight are maintained for two CPU cores, operation requests provided from task processing units as producers on the two CPU cores are scheduled in the same manner.
The method for adaptive task scheduling as described above, in which an exemplary embodiment is to adjust the consumption weight of each CPU core according to the workload of each CPU core, includes: acquiring the maximum workload and the minimum workload from the workloads of the CPU cores; comparing whether the difference between the maximum workload and the minimum workload is greater than a specified threshold; and if the workload is larger than the specified threshold, increasing the consumption weight of the CPU core with the largest workload.
In the method for adaptive task scheduling as described above, in an exemplary embodiment, after the consumption weight of the CPU core with the largest workload is increased, 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, the consumption weight of the CPU core is continuously increased; and if the consumption weight of the CPU core is equal to or larger than the maximum value of the consumption weight, reducing the consumption weight of the CPU core with the minimum workload.
In the method for adaptive task scheduling as described above, in an exemplary embodiment, after the consumption weight of the CPU core with the smallest workload is reduced, it is determined whether the consumption weight of the CPU core reaches the minimum value of the consumption weights; if the consumption weight of the CPU core is equal to or less than the minimum value of the consumption weight, the consumption weight of the CPU core is not reduced; and if the consumption weight of the CPU core is larger than the minimum value of the consumption weight, continuously reducing the consumption weight of the CPU core.
A task processing system comprising: the system comprises a task processing unit as a producer and a task processing unit as a consumer which run on a CPU core, wherein the task processing unit as the consumer comprises a task scheduling subunit; the task scheduling subunit performs the above-described method of adaptive task scheduling.
Compared with the background art, the task processing system and the self-adaptive task scheduling method provided by the invention have the advantages that different CPU cores have different use frequencies by mainly adjusting the adjustment of the SM unit on the DM unit operation request processing of different CPU cores, so that the workload of multiple CPU cores and multiple tasks 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 description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1A shows a schematic diagram of processing large-scale concurrent tasks in the prior art;
FIG. 1B illustrates a schematic diagram of a prior art task processing system;
FIG. 2A is a diagram illustrating the distribution of different task processing units on a CPU core in the prior art;
FIG. 2B is a diagram illustrating the interaction between a DM unit and 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;
FIG. 3B illustrates a flowchart of the operation of a 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 is a diagram illustrating 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;
FIG. 6 illustrates an operational flow diagram of a task scheduling subunit of an SM unit according to yet another embodiment of the present application;
FIG. 7 illustrates a flow diagram of a task processing unit as a consumer processing an operation request according to an embodiment of the application;
FIG. 8 illustrates a schematic diagram of a task processing system according to yet another embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are exemplary only for explaining the present application and are not construed as limiting the present application.
Referring to fig. 3A, fig. 3A is a schematic diagram illustrating a task processing system according to an embodiment of the present application.
The task processing system includes a DM unit and an SM unit, and taking fig. 3A as an example, the task processing system provided in the present application includes: the device comprises a DM0 unit, a DM1 unit and an SM0 unit, wherein the DM0 unit and the DM1 unit are used as producers to provide operation requests to the SM0 unit, and the SM0 unit is used as a consumer to process the operation requests provided by the DM0 unit and the DM1 unit. The task processing system includes 2 CPU cores (CPU 0 and CPU 1), with CPU0 running DM0 and SM0 units, and CPU1 running DM1 unit. According to an embodiment of the present application, the SM0 unit processes operation requests generated from the DM0 unit and the DM1 unit in a loop, 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 is a flowchart illustrating the operation of the task scheduling subunit of the SM unit according to an embodiment of the present application.
And the task scheduling subunit of the SM unit schedules the operation request from the DM unit of the corresponding CPU core according to the workload F of the CPU core and the consumption weight W of the CPU core.
Wherein, the consumption weight W is a statistical parameter based on the CPU core, and is not a parameter based on the task processing unit (such as DM unit, GC unit). If only one DM unit is operated on one CPU core, the consumption weight of the CPU core is the consumption weight of the DM unit; if a CPU core runs a DM unit and a DM 'unit, 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 consumption weight of the DM0 unit, and W1 represents the consumption 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 the CPU0, F1 represents the workload of the CPU1, the smaller the workload of the CPU core is, the more idle the CPU core is, otherwise, the larger the workload of the CPU core is, the more busy the CPU core is. For example, the workload F is represented by the usage rate or power consumption of the CPU core, and the theoretical maximum cycle count loppcntlnitial in the initial state is the ratio (lopcnt/loppcntlnitial 100) of the number of times lopcntnitial that the CPU core completes a specified task cycle in a specified time in a specified state to the number of times lopcntinginal that the CPU core completes a specified task cycle in the same specified time in the initial state (no task processing). Then if busy is 100, it indicates that the CPU core is completely idle.
When the SM unit schedules 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 adjusted consumption weight of the CPU core. With respect to the available weights, in other embodiments, the available weights for the DM units are restored over time. The available weight T is a statistical parameter based on the CPU core, and is used to indicate the processing capacity currently available to the CPU core. As shown in FIG. 3A, for example, when the consumption weight of a DM0 unit is increased, the probability that an operation request provided by the DM0 unit running on CPU0 is scheduled by the SM0 unit is reduced; similarly, when the consumption weight of the DM1 unit is decreased, the probability that the operation request provided by the DM1 unit running on CPU1 is scheduled by the SM0 unit is increased.
According to an embodiment of the present application, taking fig. 3B as an example, 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 CPU core (e.g., CPU 0) is increased or too high, the consumption weight of the task processing unit (e.g., DM0 unit) as the producer running on the CPU core is increased. As another example, when the workload of a CPU core (e.g., CPU 0) is reduced or too low, the consumption weight of the task processing unit (e.g., DM0 unit) as the producer running on the CPU core is reduced. The task scheduling subunit adjusts the consumption weight of each CPU core based on the workload condition of each CPU core, and the operation of increasing/decreasing the consumption weight W of different DM units can be implemented individually or simultaneously, so as to achieve load balancing of different CPU cores as soon as possible, increase the processing speed, and avoid resource waste. Taking the CPU0 as an example, the increase of the workload of the CPU0 means that the current workload is increased by more than a certain threshold compared with the previous workload, and the over-high workload of the CPU core means that the value of the current workload exceeds a certain threshold.
Taking fig. 3B as an example, the operation flow further includes: the first task scheduling subunit S0 of the SM0 unit selects whether to process the operation request provided by the DM0 unit or the DM1 unit according to the adjusted consumption weight W0 and the consumption weight W1 (330). By way of example, the available weights (denoted as T0 and T1) for the DM0 and DM1 cells, respectively, are 100, while the consumption weight values (denoted as W0 and W1) for the DM0 and DM1 cells are, for example, 10. When the first task scheduling subunit S0 of the SM0 unit selects to obtain an operation request from the DM0 unit, the remaining available weight T0 'of the DM0 unit is obtained by subtracting the consumption weight value W0 from the available weight T0 value of the DM0 unit accordingly (T0' = T0-W0). And when the available weight of the CPU core is consumed according to the adjusted consumption weight of the CPU core, 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 an 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 less than the consumption weight W0, the first task scheduling subunit S0 of the SM0 unit rejects the operation request provided by the calling DM0 unit. If the available weight T1 of the DM1 unit is not less than the consumption weight W1, 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 that there is less operation request processing generated for the DM unit having the consumption weight W within a specified time; and a smaller consumption weight W means that more operation request processing is generated for the DM unit 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 decreased, 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 is a schematic diagram illustrating a task processing system according to another embodiment of the present application.
The task processing system includes a DM unit and an SM unit, and taking fig. 4A as an example, 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 is used as a producer to provide the operation request to the SM0 unit/SM 11 unit, and the SM0 unit/SM 1 unit is used 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), where CPU0 is used to run DM0 units and SM0 units, CPU1 is used to run DM1 units and SM1 units, CPU2 is used to run DM2 units, and CPU3 is used to run DM3 units.
According to the embodiment of the present application, each of the SM0 unit/SM 1 unit circularly processes the operation request provided by the DM0 unit/DM 1 unit/DM 2 unit/DM 3 unit, 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), which is configured to execute the operation flow illustrated in fig. 3B. The first task scheduling subunit S0 and the second task scheduling subunit S1 perform task scheduling independently from each other without being affected by each other.
In other embodiments, the first task scheduling subunit S0 and the second task scheduling subunit S1 each maintain an independent consumption weight W for the DM0 unit to the DM3 unit, so that the adjustment of the consumption weight W of the DM0 unit to the DM3 unit by the first task scheduling subunit S0 does not affect the adjustment of the consumption weight W of the DM0 unit to the DM3 unit by the second task scheduling subunit S1, and similarly, the adjustment of the consumption weight W of the DM0 unit to the DM3 unit by the second task scheduling subunit S1 does not affect the adjustment of the consumption weight W of the DM0 unit to the DM3 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, and 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 following "W" refers to the task scheduling subunit, and the second symbol b refers to the DM unit, such that W01 denotes the consumption weight that the first task scheduling subunit S0 maintains for the DM1 unit, and similarly, W13 denotes the consumption weight that the second task scheduling subunit S1 maintains for the DM3 unit.
In other embodiments, the first task scheduling subunit S0 and the second task scheduling subunit S1 also each maintain an independent available weight T for DM0 units-DM 3 units. 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 following "T" refers to the task scheduling subunit and the second symbol b refers to the DM unit, such that T01 indicates the available weights that the first task scheduling subunit S0 maintains for the DM1 unit, and similarly, T13 indicates the available weights that the second task scheduling subunit S1 maintains for the DM3 unit.
To schedule the operation requests from the DM0 unit to the DM3 unit, the workloads of the CPUs 0 to 3 acquired by the first task scheduling subunit S0 and the second task scheduling subunit S1 are the same, that is, the workloads of certain CPU cores acquired by the first task scheduling subunit S0 and the second task scheduling subunit S1 are the same.
For example, when the second task scheduling subunit S1 acquires that the workload of the CPU2 is reduced or lower than the workload of other CPU cores, the consumption weight of the DM2 unit as a producer run 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 for processing more.
In yet another embodiment, still referring to FIG. 4A, if the size of the task processing units running on two CPU cores is the same, the same consumption weight and the same available weight are maintained for the two CPU cores. The same size means that the number of task processing units running on the CPU cores 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 exclusively own 1 CPU core), that is, the DM0 unit and the SM0 unit are run on the CPU0, the DM1 unit and the SM1 unit are run on the CPU1, the sizes of the task processing units run on the CPU0 and the CPU1 are the same, the DM2 unit is run on the CPU2, the DM3 unit is run on the CPU3, and the sizes of the task processing units run on the CPU2 and the CPU3 are the same, so that the first task scheduling subunit S0 and the second task scheduling subunit S1 schedule the operation requests from the DM0 unit and the DM1 unit in the same manner, and the operation requests from the DM2 unit and the DM3 unit are also scheduled in the same manner, thereby simplifying the complexity of implementing the operation request scheduling by the first task scheduling subunit S0/the second task scheduling subunit S1. For example, the ratio of the consumption weights for DM0 units to DM3 units is 10:10:1:1, which means that the weight consumed by the SM unit to process the operation requests of the DM0 unit and the DM1 unit 10 times and the operation requests of the DM2 unit and the DM3 unit 1 time is the same. As another example, the first task scheduling subunit S0 maintains the same consumption weight W0b for DM0 units and DM1 units, and the same consumption weight W0b 'for DM2 units and DM3 units, and the first task scheduling subunit S0 determines whether to obtain operation requests from DM0 units/DM 1 units based on the consumption weight W0b, and whether to obtain operation requests from DM2 units/DM 3 units based on the consumption weight W0b'. Similarly, the second task scheduling subunit S1 maintains the same consumption weight W1b for DM0 units and DM1 units, and the same consumption weight W1b 'for DM2 units and DM3 units, and the second task scheduling subunit S1 determines whether to obtain an operation request from a DM0 unit/DM 1 unit according to the consumption weight W1b, and whether to obtain an operation request from a DM2 unit/DM 3 unit according to the consumption weight W1b'. Here, "scheduling in the same manner" means that the operation requests provided by the task processing units are scheduled keeping the same probability.
In other embodiments, the first task scheduling subunit S0 with the number 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 and DM1 units, and the same available weight T1b' for DM2 units and DM3 units.
Referring to fig. 4B, fig. 4B is a diagram illustrating 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 taking fig. 4B as an example, the task processing system provided by the present application includes: DM0 unit, DM1 unit, DM2 unit, DM3 unit, SM0 unit, and SM1 unit. Wherein, the DM0 unit-DM 3 unit is used as a producer to provide the operation request to the SM0 unit/SM 11 unit, and the SM0 unit/SM 1 unit is used 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), where CPU0 is used to run DM0 units and SM0 units, CPU1 is used to run DM1 units and SM1 units, CPU2 is used to run DM2 units, and CPU3 is used to run DM3 units.
According to an embodiment of the present application, the SM0 unit/SM 1 unit each loop processes operation requests provided from the DM0 unit/DM 1 unit/DM 2 unit/DM 3 unit. In 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 performing the operation flow illustrated in fig. 3B.
With continued reference to FIG. 4B, if the same consumption weight and the same available weight are maintained for both CPU cores, then operation requests provided from the task processing units that are producers on both CPU cores are scheduled in the same manner. Since the DM0 unit and the DM1 unit are peer-to-peer (they share 1 CPU core with 1 SM unit), the DM2 unit and the DM3 unit are peer-to-peer (they are exclusive of 1 CPU core each), that is, the DM0 unit and the SM0 unit are run on the CPU0, the DM1 unit and the SM1 unit are run on the CPU1, the sizes of the task processing units run on the CPU0 and the CPU1 are the same, the DM2 unit is run on the CPU2, the DM3 unit is run on the CPU3, and the sizes of the task processing units run on the CPU2 and the CPU3 are the same, so that the first task scheduling subunit S0 schedules the operation requests from the DM0 unit and the DM1 unit in the same way, and also schedules the operation requests from the DM2 unit and the DM3 unit in the same way, thereby simplifying the complexity of the first task scheduling subunit S0 in implementing the operation request scheduling. For example, the ratio of the consumption weights for DM0 units to DM3 units is 10:10:1:1, which means that the weight consumed by the SM unit to process the operation requests of the DM0 unit and the DM1 unit 10 times and the operation requests of the DM2 unit and the DM3 unit 1 time is the same. As another example, the first task scheduling subunit S0 maintains the same consumption weight W0b for DM0 units and DM1 units, and the same consumption weight W0b 'for DM2 units and DM3 units, and the first task scheduling subunit S0 determines whether to obtain operation requests from DM0 units/DM 1 units based on the consumption weight W0b, and whether to obtain operation requests from DM2 units/DM 3 units based on the consumption weight W0b'.
In other embodiments, the first task scheduling subunit S0 maintains the same available weight T0b for DM0 units and DM1 units, and the same available weight T0b' for DM2 units and DM3 units.
Referring to fig. 5, fig. 5 is a diagram illustrating 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 with reference to fig. 5 as an example, the task processing system provided in the present application includes: the system comprises a DM0 unit, a DM1 unit, a DM2 unit, a DM3 unit, a GC0 unit, a GC1 unit, an SM0 unit and an SM1 unit, wherein the DM0 unit-the DM3 unit and the GC0 unit and the GC1 unit are used as producers to provide operation requests to the SM0 unit/SM 1 unit, and the SM0 unit/SM 1 unit is used as a consumer to process the operation requests. The task processing system comprises 4 CPU cores (CPU 0, CPU1, CPU2 and CPU 3), wherein the CPU0 is used for operating the DM0 unit and the SM0 unit, the CPU1 is used for operating the DM1 unit and the SM0 unit, the CPU2 is used for operating the DM2 unit and the GC0 unit, and the CPU3 is used for operating the DM3 unit and the GC1 unit. So that the task processing units running on the respective CPU cores are the same as or different from each other.
According to the embodiment of the present application, each of the SM0 unit/SM 1 unit circularly processes the 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 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 flow illustrated in fig. 3B. The first task scheduling subunit S0 and the second task scheduling subunit S1 perform task scheduling independently 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 the DM0 unit to the DM3 unit and the GC0 unit to the GC1 unit. The adjustment of the consumption weight depends on the judgment of the busy degree of different CPU cores, that is, depends on 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 requests of the DM units running on different CPU cores. Wherein, the GC unit and the SM unit are bound, that is, the operation request of the GC unit is generally processed by the fixed corresponding SM unit, and the consumption weight thereof is not adjusted.
For example, the first task scheduling subunit S0, numbered 0, maintains the consumption weights W0D0, W0D1, W0D2, W0D3, W0G0, and W0G1, the second task scheduling subunit S1, numbered 1, maintains the consumption weights W1D0, W1D1, W1D2, W1D3, W1G0, W1G1, wherein the symbol shaped as "Waxb" wherein the first symbol after "W" refers to the task scheduling subunit, the second symbol refers to the task processing unit as the producer (D represents the DM unit and G represents the GC unit), the third symbol refers to the number of the producer task processing unit, such that W0D1 represents the consumption weight maintained by the first task scheduling subunit S0, numbered 0, DM1, and similarly W1G1 represents the consumption weight maintained by the second task scheduling subunit S1, numbered 1, GC 1.
In other embodiments, the first task scheduling subunit S0 and the second task scheduling subunit S1 also maintain independent available weights T for the DM0 unit-DM 3 unit and the GC0 unit-GC 1 unit, respectively.
For example, the first task scheduling subunit S0, numbered 0, maintains the available weights T0D0, T0D1, T0D2, T0D3, T0G0, and T0G1, the second task scheduling subunit S1, numbered 1, maintains the available weights T1D0, T1D1, T1D2, T1D3, T1G0, and T1G1, wherein in the notation like "Taxb," the first symbol after "T" refers to the number of the task scheduling subunit, while the second symbol refers to the task processing unit as the producer (D represents a DM unit, and G represents a GC unit), the third symbol refers to the number of the producer task processing unit, such that T0D1 indicates that the first task scheduling subunit S0, numbered 0, is the available weight maintained by the DM1 unit, and similarly, T1G1 indicates that the second task scheduling subunit S1, numbered 1, is the available weight maintained by the GC1 unit.
In order to schedule the 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 work loads of the CPUs 0-CPU3, and adjust the consumption weight of the task processing unit as a producer on the CPU core corresponding to the work load according to the work load condition.
For example, when the second task scheduling subunit S1 obtains that the workload of the CPU2 is reduced or lower than the workload of other CPU cores, the consumption weight W (based on the statistical parameters of the CPU cores) of the DM2 unit and/or the GC0 unit of the producer run by the CPU2 is reduced, so that the second task scheduling subunit S1 schedules the operation requests of the DM2 unit and/or the GC0 unit to the SM1 unit for processing more, and since the GC0 unit and the SM unit are bound, 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 examples by taking the DM unit, the GC unit, and the SM unit as examples, it can be 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, a task processing unit (DM 0 unit-DM 3 unit, GC0 unit-GC 1 unit) as a producer sends an operation request to a task processing unit (e.g., SM unit) as a consumer through a queue. And the task processing unit as the consumer acquires and processes the operation request according to the queue corresponding to the task processing unit as the producer selected by the task scheduling subunit. Therefore, if a certain task processing unit as a producer is not scheduled by a task processing unit as a consumer for a long time, the queue of the certain task processing unit as the producer is filled with the operation request, and the task processing unit as the producer responds to the queue to be filled, so that the operation request is not generated. Therefore, the task scheduling subunit can further reduce the operation request generated by the task processing unit as the producer by reducing or stopping the scheduling of the certain task processing unit as the producer, and even make the task processing unit as the producer suspend working, thereby further reducing the consumption of the CPU core resource by the task processing unit as the producer and further reducing the workload of the CPU core.
It should be noted that the queue in the task processing unit in the foregoing embodiment is an example of buffering the operation request, and other manners may also be used to buffer the operation request.
Still referring to FIG. 5, as yet another embodiment, the scheduling performed by the first task scheduling subunit S0/second task scheduling subunit S1 for the DM2 unit and the DM3 unit does not affect the processing of the operation requests generated by the GC0 unit/GC 1 unit. Although there are GC0 unit/GC 1 units, the operation requests generated by the GC0 unit/GC 1 unit are controlled in other ways, for example, the proportion of the write data amount of the operation requests generated by each of the DM unit and the GC unit is controlled, without controlling the processing of the operation requests generated by the GC0 unit/GC 1 unit based on the consumption weight W.
Referring to fig. 6, fig. 6 is a flowchart illustrating an operation of a task scheduling subunit of an SM unit according to 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 fig. 6, the task scheduling subunit of the SM unit obtains a workload F (610) of each CPU core, and records the workload of the CPUn as Fn, where n is the number of CPU cores and is an integer.
Obtaining a maximum workload Fi _ max and a minimum workload Fj _ min from the workloads F of each CPU core (n CPU cores) (620), namely the workload Fi of the CPUi is the maximum workload of the workloads of all the CPU cores, the workload Fj of the CPUj is the minimum workload of the workloads of all the CPU cores, i and j are integers, and comparing whether the difference value of the Fi _ max and the Fj _ min is too large (for example, whether the difference value is larger than a specified threshold value, and the specified threshold value can be 5) (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 (CPUi) with the largest workload (Fi _ max) is obtained, and the consumption weight W of the CPU Core (CPUi) is increased for the task processing unit (such as DM0 unit) which is operated as the producer on the CPU Core (CPUi) (640). It is understood that when the flow of FIG. 6 is executed 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 in a specified step, for example, W = W +1. If the difference between the two is not too large (for example, if the difference is not greater than the specified threshold), it indicates that the workloads of the CPU cores are balanced, and the workloads of the CPU cores do not need to be adjusted by updating the consumption weight W, and at this time, the workloads F of the CPU cores may be continuously obtained periodically or under the specified condition (610).
The consumption weight of the task processing unit has a maximum value (denoted as Wmax, which may be 16, for example, which may be adaptively selected according to the situation), 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 (CPUi) 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 (610), and the above steps may be repeated.
When the consumption weight Wi of the task processing unit (e.g., DM0 unit) as a producer running on the CPU Core (CPUi) 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, but the consumption weight Wj of the task processing unit (e.g., DM 3) as a producer running on the CPU core (CPUj) with the smallest workload (Fj _ min) is decreased (670). As an example, each time the consumption weight W is decreased, it is updated in a specified step, e.g., W = W-1.
The consumption weight of the task processing unit also has a minimum value (denoted as 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 (CPUj) 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 smaller than Wmin), the consumption weight Wj (690) of the task processing unit (e.g., DM 3) as the producer may be continuously decreased, and the acquisition of the workload F (610) of each CPU core may be continuously returned periodically or in a specified case, and the above steps may be repeated.
Regardless of how the consumption weight is adjusted, the operation flow as shown in fig. 6 needs to return to the step of acquiring the workload of the CPU core for the next execution of the operation flow as shown in fig. 6.
In other embodiments, when the SM unit is first run after power-on, the task scheduling subunit may also initialize the consumption weight of each task processing unit.
In other embodiments, the task scheduling subunit belongs to the task processing unit as the consumer, and only adjusts the consumption weight of the task processing unit as the producer corresponding to the task processing unit as the consumer (the task processing unit as the producer provides the operation request to the task processing unit as the consumer) where the task scheduling subunit is located, without adjusting the consumption weight of the task processing unit as the producer not corresponding to the task processing unit as the consumer.
In other embodiments, the task scheduling subunit, when executing the operational flow of fig. 6, updates its consumption weight for one or more, and/or one or more, of its corresponding task processing units that are producers. In other embodiments, the task scheduling subunit updates its consumption weight for the designated task processing unit that is the producer, as needed or as directed by the user.
Referring to fig. 7, fig. 7 is a flowchart illustrating 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 a task processing unit i as a producer to be scheduled (710). In the case where 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 unit i as a producer to be scheduled is selected in a round-robin or weighted round-robin manner, for example.
It is determined whether a task processing unit i as a producer can be scheduled, e.g., whether its available weight Ti is greater than or equal to its current consumption weight Wi (720). And if the available weight Ti is not larger than the consumption weight Wi, the task processing unit i as the producer can not be scheduled, and returning to obtain other task processing units to be scheduled. If its available weight Ti is greater than or equal to its consumption weight Wi, then 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 obtained for processing (740).
In other embodiments, a specified amount of available weights, for example, are restored automatically in response to a specified time elapsing 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 is a schematic diagram illustrating 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 taking fig. 8 as an example, the task processing system provided in the present application includes: a DM0 unit-DM 3 unit, an SM0 unit-SM 1 unit, and a GC0 unit-GC 1 unit, wherein the DM0 unit-DM 3 unit provides the operation request to the SM0 unit-SM 1 unit as a producer, and the SM0 unit-SM 1 unit processes the operation request as a consumer. The task processing system further includes 4 CPU cores (CPU 0, CPU1, CPU2, and CPU 3), where CPU0 is used to run DM0, GC0, and SM0 units, and CPU1 is used to run DM1, GC1, and SM1 units, CPU2 is used to run DM2 units, and CPU3 is used to run DM3 units.
According to an embodiment of the application, each of the SM0 unit/SM 1 unit 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 includes a first task scheduling subunit S0, the SM1 unit further includes a second task scheduling subunit S1, and the first task scheduling subunit S0 and the second task scheduling subunit S1 each independently perform task scheduling without being influenced by each other.
In other embodiments, the first task scheduling subunit S0 and the second task scheduling subunit S1 maintain independent consumption weights for CPU0, CPU1, CPU2, and CPU3, respectively. Thereby maintaining a single consumption weight for a CPU core even if multiple task processing units, such as DM units, GC units, SM units, etc., are running on the CPU core.
For example, the first task scheduling subunit S0 maintains the consumption weights W00, W01, W02, and W03, and the second task scheduling subunit S1 maintains the consumption weights W10, W11, W12, and W13, wherein the first symbol after "W" in the symbol shaped as "Wab" refers to the task scheduling subunit, and the second symbol refers to the CPU core, such that W01 denotes that the first task scheduling subunit S0 numbered 0 is the consumption weight maintained by the CPU1, and similarly, W13 denotes that the second task scheduling subunit S1 numbered 1 is the consumption weight maintained by the CPU 3. In other embodiments, the first task scheduling subunit S0, numbered 0, maintains independent available weights T01, T02, and T03 for the CPUs 0-3, and the second task scheduling subunit S1, numbered 1, maintains independent available weights T10, T11, T12, and T13 for the CPUs 0-3, where the symbol like "Tab" has the first symbol after "T" referring to the task scheduling subunit and the second symbol referring to the CPU core, such that T01 refers to the first task scheduling subunit S0, numbered 0, as the available weight maintained by the CPU1, and similarly, T13 refers to the available weight maintained by the second task scheduling subunit S1, numbered 1, as the CPU 3.
The first task scheduling subunit S0 and the second task scheduling subunit S1 each schedule processing of operation requests from DM units and/or GC units of different CPU cores according to the consumption weight and the available weight. 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 can be scheduled by the SM0 unit.
The first task scheduling subunit S0 and the second task scheduling subunit S1 each further adjust the consumption weight maintained by each CPU core according to the acquired workload of the CPUs 0 to 3. For example, when the workload of a CPU core is significantly higher than that of other CPU cores, the consumption weight of the CPU core is increased; when the workload of a CPU core is significantly lower than that of other CPU cores, the consumption weight of the CPU core is reduced. Also referring to fig. 6, for example, the difference between the maximum workload Fi _ max and the minimum workload Fj _ min in the CPUi 0-CPU3 is greater than a specified threshold, the consumption weight is raised for the CPUi with the maximum workload, and/or the consumption weight is lowered for the CPUj with the minimum workload.
Since the consumption weight of the CPU core changes, the probability that the operation request of the DM unit or the GC unit running on the CPU core is scheduled to be processed changes accordingly.
In other embodiments, the first task scheduling subunit S0/second task scheduling subunit S1 schedules operation requests from the DM0 unit/DM 1 unit in the same manner, schedules operation requests from the GC0 unit/GC 1 unit in the same manner, and schedules operation requests from the DM2 unit/DM 3 unit in the same manner, such that the first task scheduling subunit S0/second task scheduling subunit S1 each maintains a single consumption weight for the DM0 unit/DM 1 unit and a single consumption weight for the DM2/DM3 unit to simplify the complexity of the first task scheduling subunit S0/second task scheduling subunit S1 in performing operation request scheduling, and the GC0 unit and the GC1 unit and the SM unit are bound and their consumption weights are not adjustable. For example, the first task scheduling subunit S0 maintains the same consumption weight W0b for CPU0 running the DM0 unit and CPU1 running the DM1 unit, and maintains the same consumption weight W0b' for CPU2 running the DM2 unit and CPU3 running the DM3 unit. Similarly, the second task scheduling subunit maintains the same consumption weight W1b for CPU0 running the DM0 unit and CPU1 running the DM1 unit, and maintains the same consumption weight W1b' for CPU2 running the DM2 unit and 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 the DM0 unit as CPU1 running the DM1 unit, and maintains the same available weight T1b' for CPU2 running the DM2 unit as CPU3 running the DM3 unit.
In other embodiments, only one of the two SM units comprises a task scheduling subunit.
According to the method and the device, based on the task division weight and the scheduling weight, different use frequencies of different CPU cores can be adjusted in a self-adaptive manner under different application scenes mainly by adjusting the adjustment of the SM unit on the DM unit operation request processing of the different CPU cores, so that the workload of multi-CPU-core multitask 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 attributes 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 description refers to embodiments, not every embodiment may contain only a single embodiment, and such description is for clarity only, and those skilled in the art should integrate the description, and the embodiments may be combined as appropriate to form other embodiments understood by those skilled in the art.

Claims (10)

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;
and scheduling the operation request provided by the task processing unit which runs on each CPU core and is used as a producer according to the consumption weight of each CPU core.
2. The method of adaptive task scheduling according to claim 1, wherein adjusting the consumption weight of each CPU core according to the workload of each CPU core comprises:
when the workload of the CPU core is increased or overhigh, the consumption weight of the task processing unit which is operated on the CPU core and is used as a producer is increased;
when the workload of a CPU core decreases or is too low, the consumption weight of the task processing unit as a producer running on the CPU core is decreased.
3. The method according to claim 1 or 2, wherein the scheduling the operation request provided by the task processing unit as the producer running on each CPU core according to the consumption weight of each CPU core comprises:
when the consumption weight of the CPU core is increased, the probability that the operation request provided by the task processing unit which is operated on the CPU core and serves as a producer is dispatched is reduced;
when the consumption weight of the CPU core is reduced, the probability that the operation request provided by the task processing unit which is operated on the CPU core and is used as a producer is scheduled is improved.
4. The method according to claim 1 or 2, wherein when scheduling the operation request provided by the task processing unit as a producer running on each CPU core, the available weight of the CPU core is consumed according to the adjusted consumption weight of the CPU core;
when the available weight of the CPU core is consumed according to the adjusted consumption weight of the CPU core, judging the available weight and the consumption weight of the CPU core;
if the available weight of the CPU core is smaller than the consumption weight, refusing to call the operation request provided by the 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, calling an operation request provided by a task processing unit which is operated on the CPU core and is used as a producer.
5. A method of adaptive task scheduling according to claim 1 or 2, characterized in that if the size of the task processing units running on two CPU cores is the same, the same consumption weight and the same available weight are maintained for both CPU cores.
6. The method of adaptive task scheduling according to claim 5, wherein if the same consumption weight and the same available weight are maintained for two CPU cores, then operation requests provided from task processing units that are producers on the two CPU cores are scheduled in the same manner.
7. 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:
acquiring the maximum workload and the minimum workload from the workloads of the CPU cores;
comparing whether the difference between the maximum workload and the minimum workload is greater than a specified threshold;
and if the workload is greater than the specified threshold, increasing the consumption weight of the CPU core with the largest workload.
8. The method according to claim 7, 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, the consumption weight of the CPU core is continuously increased;
and if the consumption weight of the CPU core is equal to or larger than the maximum value of the consumption weight, reducing the consumption weight of the CPU core with the minimum workload.
9. The method according to claim 8, 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 weights;
if the consumption weight of the CPU core is equal to or less than the minimum value of the consumption weight, the consumption weight of the CPU core is not reduced;
and if the consumption weight of the CPU core is larger than the minimum value of the consumption weight, continuously reducing the consumption weight of the CPU core.
10. A task processing system, comprising: the task processing unit as a producer and the task processing unit as a consumer run on the CPU core, wherein the task processing unit as the consumer comprises a task scheduling subunit; a task scheduling subunit performing the method of adaptive task scheduling according to any of claims 1-9.
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 true CN115454640A (en) 2022-12-09
CN115454640B 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 (8)

* 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
US20210109784A1 (en) * 2019-10-11 2021-04-15 Unify Patente Gmbh & Co. Kg Method of scheduling an additional new processing task to be executed by a processor, scheduler, and central processing unit
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

Patent Citations (8)

* 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
US20210109784A1 (en) * 2019-10-11 2021-04-15 Unify Patente Gmbh & Co. Kg Method of scheduling an additional new processing task to be executed by a processor, scheduler, and central processing unit
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
CN115454640B (en) 2024-01-19

Similar Documents

Publication Publication Date Title
JP5324934B2 (en) Information processing apparatus and information processing method
Prabhakaran et al. A batch system with efficient adaptive scheduling for malleable and evolving applications
CN111176828B (en) System on chip comprising multi-core processor and task scheduling method thereof
JP5433837B2 (en) Virtual computer system, virtual computer control method, and program
KR101629155B1 (en) Power-aware thread scheduling and dynamic use of processors
US7694158B2 (en) Parallel processing method and system, for instance for supporting embedded cluster platforms, computer program product therefor
US20080066070A1 (en) Method and system for the dynamic scheduling of jobs in a computing system
Xu et al. Adaptive task scheduling strategy based on dynamic workload adjustment for heterogeneous Hadoop clusters
EP2012233A2 (en) System and method to optimize OS scheduling decisions for power savings based on temporal charcteristics of the scheduled entity and system workload
CN112465129A (en) On-chip heterogeneous artificial intelligence processor
CN109564528B (en) System and method for computing resource allocation in distributed computing
KR20050030871A (en) Method and system for performing real-time operation
US9652027B2 (en) Thread scheduling based on performance state and idle state of processing units
JP2012048545A (en) Method and computer for processing specific process in short time
Wang et al. A smart semipartitioned real-time scheduling strategy for mixed-criticality systems in 6G-based edge computing
US11954518B2 (en) User-defined metered priority queues
Cheng et al. Dynamic resource provisioning for iterative workloads on Apache Spark
Nicodemus et al. Managing vertical memory elasticity in containers
CN115454640A (en) Task processing system and self-adaptive task scheduling method
Khemaissia et al. New Reconfigurable Middleware for Feasible Adaptive RT-Linux.
CN114035926A (en) Application thread scheduling method and device, storage medium and electronic equipment
Dokulil et al. Adaptive scheduling of collocated applications using a task-based runtime system
Walters et al. Enabling interactive jobs in virtualized data centers
CN113407313A (en) Resource demand-aware multi-queue scheduling method, system and server
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