US20180074857A1 - Multi-core processor systems and methods for assigning tasks in a multi-core processor system - Google Patents

Multi-core processor systems and methods for assigning tasks in a multi-core processor system Download PDF

Info

Publication number
US20180074857A1
US20180074857A1 US15/817,819 US201715817819A US2018074857A1 US 20180074857 A1 US20180074857 A1 US 20180074857A1 US 201715817819 A US201715817819 A US 201715817819A US 2018074857 A1 US2018074857 A1 US 2018074857A1
Authority
US
United States
Prior art keywords
task
tasks
scheduling
assigned
processor cores
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.)
Abandoned
Application number
US15/817,819
Inventor
Ya-Ting Chang
Yu-Ting Chen
Yu-Ming Lin
Jia-Ming Chen
Hung-Lin Chou
Tzu-Jen Lo
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.)
MediaTek Inc
Original Assignee
MediaTek Inc
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 MediaTek Inc filed Critical MediaTek Inc
Priority to US15/817,819 priority Critical patent/US20180074857A1/en
Assigned to MEDIATEK INC. reassignment MEDIATEK INC. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: CHANG, YA-TING, CHEN, JIA-MING, CHEN, YU-TING, CHOU, HUNG-LIN, LIN, YU-MING, LO, TZU-JEN
Publication of US20180074857A1 publication Critical patent/US20180074857A1/en
Abandoned legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/483Multiproc

Definitions

  • the invention generally relates to task assignment in a multi-core processor system, and more particularly, to task assignment that cross refers to task assignment information corresponding to multiple scheduling classes at the same time.
  • a task scheduler is configured to schedule or assign tasks a multi-core processor system including a plurality of processor cores.
  • the tasks can be scheduled according to different scheduling algorithms, which for example, can include RT (real-time) scheduler, and/or a Completely Fair Scheduler (CFS), and/or any specific scheduling algorithm.
  • Tasks can be referred to according to their corresponding scheduling algorithms.
  • RT scheduler can be referred to as RT tasks
  • CFS Completely Fair Scheduler
  • the task scheduler assigns tasks to the processor cores, it refers to task assignment information about tasks currently assigned to the processor cores.
  • the task scheduler assigns RT tasks and CFS tasks independently. Specifically, when the task scheduler assigns a RT task, it refers to only task assignment information about RT tasks currently assigned to the processor cores, without considering CFS tasks or any other tasks different from RT tasks currently assigned to the processor cores.
  • the task scheduler assigns a CFS task, it does not refer to task assignment information about tasks other than CFS tasks assigned to the processor cores.
  • the task scheduler assigns a task scheduled by a specific scheduling algorithm, it does not consider tasks scheduled by any other scheduling algorithms different from the specific scheduling algorithm.
  • Multi-core processor system and method for assigning tasks are provided to overcome the problems mentioned above.
  • An embodiment of the invention provides a method for assigning tasks in a multi-core processor system.
  • the method comprises operations to assign tasks in a multi-core processor system, wherein the multi-core processor system comprises a plurality of processor cores, and each of the tasks is in a respective one of a plurality of scheduling classes.
  • the operations comprises obtaining first task assignment information about tasks which are in a first scheduling class from the plurality of scheduling classes and assigned to the plurality of processor cores, wherein the first task assignment information indicates current assignments of processor cores from the plurality of processor cores for the first scheduling class; obtaining second task assignment information about tasks which are in one or more other scheduling classes and assigned to the plurality of processor cores, wherein each of the one or more other scheduling classes is different from the first scheduling class, wherein the second task assignment information indicates current assignments of processor cores from the plurality of processor cores for the one or more other scheduling classes; and referring to the first task assignment information and the second task assignment information to assign a runnable task in the first scheduling class to one of the plurality of processor cores, wherein prior to the assigning the runnable task in the first scheduling class, the runnable task in the first scheduling class has been assigned to one of the plurality of processor cores
  • the multi-core processor system includes a plurality of processor cores and a task scheduler.
  • the plurality of processor cores is configured to perform a plurality of tasks, wherein each of the tasks is in a respective one of a plurality of scheduling classes.
  • the task scheduler is configured to obtain first task assignment information about tasks which are in a first scheduling class from the plurality of scheduling classes and assigned to the plurality of processor cores, obtain second task assignment information about tasks which are in one or more other scheduling classes and assigned to the plurality of processor cores, wherein each of the one or more other scheduling classes is different from the first scheduling class, and refer to the first task assignment information and the second task assignment information to assign a runnable task in the first scheduling class to one of the plurality of processor cores. Prior to the assigning the runnable task in the first scheduling class, the runnable task in the first scheduling class has been assigned to one of the plurality of processor cores.
  • the embodiments refer to more task assignment information. That is, to assign a runnable task, information about tasks in other one or more scheduling classes different from the scheduling class of the runnable task can be taken into consideration. Due to considering more task assignment information, load can be more balanced on the processor cores, and the performance of the multi-core processor system can be improved.
  • FIG. 1 is a block diagram of a multi-core processor system 100 according to an embodiment of the invention.
  • FIG. 2 is a schematic diagram illustrating priority ranges according to an embodiment of the invention.
  • FIG. 3 is a schematic diagram for explaining task assignment in a first case according to an embodiment of the invention.
  • FIG. 4 is a schematic diagram for explaining task assignment in a second case according to another embodiment of the invention.
  • FIG. 5 is a schematic diagram for explaining task assignment in a third case according to further another embodiment of the invention.
  • FIG. 6 is a schematic diagram for explaining task assignment in a fourth case according to still further another embodiment of the invention.
  • FIG. 7 is a schematic diagram for explaining task assignment in a fifth case according to yet further another embodiment of the invention.
  • FIG. 8 is a flow chart illustrating a method for assigning tasks according to an embodiment of the invention.
  • multi-core processor system may mean a multi-core system or a multi-processor system, depending upon the actual design.
  • the proposed task scheduling method may be employed by any of the multi-core system and the multi-processor system.
  • all of the processor cores may be disposed in one processor core.
  • each of the processor cores may be disposed in one processor core.
  • each of the clusters may be implemented as a group of processors.
  • FIG. 1 is a block diagram of a multi-core processor system 100 according to an embodiment of the invention.
  • the multi-core processor system 100 comprises a task scheduler 110 , and a plurality of processor cores 120 A- 120 N.
  • FIG. 1 presents a simplified block diagram in which only the elements relevant to the invention are shown. However, the invention should not be limited to what is shown in FIG. 1 .
  • the processor cores 120 A- 120 N are configured to perform or execute the tasks and instructions, wherein the processor cores 120 A- 120 N may be Central Processing Units (CPUs), or other processing elements.
  • the multi-core processor system 100 may be a Symmetric multi-processing (SMP) type, or a Heterogeneous Multi-Processing (HMP) type, or any other type of multi-core processor system.
  • the task scheduler 110 may be implemented in a kernel of an operation system (i.e. Linux, Windows, Mac OS X, Linux, etc.) of the multi-core processor system 100 .
  • the task scheduler 110 is configured to assign the tasks to the processor cores 120 A- 120 N.
  • FIG. 2 is a schematic diagram illustrating priority ranges according to an embodiment of the invention.
  • there are a plurality of scheduling classes which are associated with a plurality of priority ranges, respectively.
  • a scheduling class 0 covering a first priority range (e.g., 0 - 99 ) and another scheduling class 1 covering a second priority range (e.g., 100 - 139 ).
  • Tasks assigned by the task scheduler 110 can be defined to be in any of the scheduling classes.
  • each task can be given a respective task priority, which is in the priority range associated with the scheduling class of the task. For example, a task given a task priority 50 is in the scheduling class 0 , and a task given a task priority 110 is in the scheduling class 1 .
  • tasks in class 0 can have task priorities ranging from 0 - 99
  • tasks in class 1 can have task priorities ranging from 100 - 139
  • a task with a smaller value of task priority means the task has higher priority to be executed. That is, when there are a task with task priority m and another task with task priority n (m ⁇ n) both assigned to a processor core, task with task priority m may be given higher priority to be executed than task with task priority n.
  • tasks in scheduling class 0 may be given higher priority to be executed than tasks in the scheduling class 1 on the same processor.
  • a task in a scheduling class can be scheduled according to the scheduling algorithm corresponding to the scheduling class.
  • the scheduling algorithms comprise at least one of a real-time (RT) scheduler, a Completely Fair Scheduler (CFS; a Shortest Job First (SJF), a First-In First-Out (FIFO) scheduler, a Brain fuck Scheduler (BFS), a Stop scheduler class, a Deadline scheduler, and any other scheduling algorithms.
  • RT real-time
  • CFS Completely Fair Scheduler
  • SJF Shortest Job First
  • FIFO First-In First-Out
  • BFS Brain fuck Scheduler
  • Stop scheduler class a Deadline scheduler
  • the scheduling class 0 can correspond to RT scheduler
  • the scheduling class 1 can correspond to CFS. Therefore, tasks scheduled according to RT scheduler, hereafter referred to as RT tasks, are in the scheduling class 0 and can have higher task priorities ranging from 0 to 99 . Similarly, tasks scheduled according to CFS, hereafter referred to as CFS tasks, are in the scheduling class 1 and have lower task priorities ranging from 100 - 139 .
  • the task scheduler 110 may consider not only tasks in a scheduling class of the runnable task (hereafter referred to as a first scheduling class) that are currently assigned to the processor cores but also tasks in one or more scheduling classes different from the first scheduling class currently assigned to the processor cores 120 A- 120 N.
  • a scheduling class of the runnable task hereafter referred to as a first scheduling class
  • first task assignment information information about tasks in the first scheduling class assigned to the processor cores 120 A- 120 N
  • second task assignment information information about tasks in the other one or more scheduling classes assigned to the processor cores 120 A- 120 N.
  • the task scheduler 110 may consider both the first task assignment information and the second task assignment information.
  • the task scheduler 110 can know task(s) currently running and/or waiting in a queue to be run by the processor core 120 A, task(s) currently running and/or waiting in a queue to be run by the processor core 120 B, . . . , and task(s) currently running and/or waiting in a queue to be run by the processor core 120 N, wherein the tasks known and considered by the task scheduler 110 are not limited to being in the same scheduling class of the runnable task. With the knowledge of the tasks currently assigned to the processor cores 120 A- 120 N, the task scheduler 110 can therefore assign the runnable task in the first scheduling class to an appropriate one of the processor cores 120 A- 120 N.
  • the method for assigning tasks in the embodiment is in contrast to the conventional method, which considers only the first task assignment information and neglects the second task assignment information.
  • the embodiment refers to more complete information by considering assigned tasks in more different scheduling classes. Consequently, the embodiment can have more balanced loading for the processor cores and better performance of the multi-core processor system, as will be demonstrated in the following disclosure.
  • the cross-referring to task information about tasks in different scheduling classes can be applied to any specific tasks/scheduling classes/scheduling algorithms and any numbers thereof.
  • the tasks to be assigned are not limited to having task priorities or being performed in sequence according to their task priorities.
  • the tasks can be scheduled according to their respective deadlines, which can be implemented in the Deadline scheduler, for example.
  • the runnable task may have been or not been assigned to any of the processor cores prior. Specifically, in some embodiments illustrated with FIGS. 3-5 , prior to the assigning the runnable task, the runnable task has not been assigned to any of the processor cores. In other embodiments, exemplarily illustrated with FIG. 7 , prior to the assigning the runnable task in the first scheduling class to the one of the processor cores, the runnable task in the first scheduling class is currently assigned to one of the processor cores but may be reassigned to another one of the processor cores.
  • the task scheduler 110 may wake up the runnable task, and then determines which one of the processor cores 120 A- 120 N is appropriate to be assigned with the runnable task by referring to the first task assignment information and the second task assignment information.
  • the task scheduler 110 can determine to whether to reassign the runnable task in the first scheduling class for better load balance according to the first task assignment information and the second task assignment information. If the determination result is positive, the task scheduler 110 may move the runnable task in the first scheduling class to another processor core of the processor cores 120 A- 120 N according to the first task assignment information and the second task assignment information.
  • One advantage of referring to more task assignment information is to prevent non-discrimination between a processor core not assigned with task(s) in the first scheduling class but assigned with task(s) in other different scheduling class(es) and a processor core not assigned with any tasks in any scheduling classes. More specifically, by referring to the first task assignment information, the task scheduler 110 can know that whether at least one processor core is not assigned with any tasks in the first scheduling class. And by referring to the second task assignment information, the task scheduler 110 can further know that whether the at least one of the other processor cores is not assigned with any task in any scheduling class different from the first scheduling class or not.
  • the task scheduler 110 can know whether at least one processor core is not assigned with any tasks or none of the processor cores is not assigned with any tasks, by referring to both the first task assignment information and second task assignment information. Due to a fuller consideration of assigned tasks in different scheduling classes, the task scheduler 110 can assign tasks in a more balanced way, as will be explained more by following embodiments.
  • FIG. 3 is a schematic diagram for explaining task assignment in a first case according to an embodiment of the invention.
  • CPU 0 is assigned with a CFS task
  • CPU 1 is not assigned with any tasks
  • CPU 2 and CPU 3 are assigned with RT tasks, respectively.
  • a RT task can have higher task priority than a CFS task.
  • the task scheduler 110 can refers to the task assignment information corresponding to the CFS tasks and RT tasks (i.e. the first task assignment information and the second task assignment information). Knowing that CPU 1 is not assigned with any tasks, the task scheduler 110 can assign the RT task to the processor CPU 1 .
  • a conventional task scheduler may refer to the first task assignment information about RT tasks without referring to the second task assignment information about the CFS tasks, and the conventional task scheduler sees CPU 0 and CPU 1 equally. Consequently, the conventional task scheduler may assign the RT task to CPU 0 rather than to CPU 1 . In other words, the conventional task scheduler treats the idle CPU 1 and the non-idle CPU 0 indifferently, and it may therefore arrange CPU 0 to undertake more tasks while leaving CPU 1 to remain unassigned with any tasks.
  • FIG. 4 is a schematic diagram for explaining task assignment in a second case according to another embodiment of the invention.
  • FIG. 4 is similar to FIG.
  • a RT task is awaked and is to be assigned by the task scheduler 110 to one of the four processor cores CPU 0 -CPU 3 in the multi-core processor system 100 , where CPU 0 is assigned with a RT task, CPU 1 is not assigned with any tasks, and CPU 2 and CPU 3 are assigned with CFS tasks, respectively.
  • a conventional task scheduler in the second case may refer to the first task assignment information about CFS tasks without referring to the second task assignment information about the RT tasks, and may therefore assign the CFS task to CPU 0 rather than to CPU 1 .
  • the task scheduler 110 in the embodiment can discriminate between CPU 0 and CPU 1 , and can therefore assign the RT task to CPU 1 that is not assigned with any tasks. Consequently, the task scheduler 110 in the embodiment can make a more balanced-loading system.
  • FIGS. 3 and 4 are similar in that at least one processor core is not assigned with any tasks in any scheduling classes. More specifically, when the runnable task (RT task in FIG. 3 ; CFS task in FIG. 4 ) in the first scheduling class (scheduling class 0 in FIG. 3 ; scheduling class 1 in FIG.
  • the first task assignment information and the second task assignment information indicate that at least one CPU 1 is not assigned with any tasks in any scheduling class, and the second task assignment information further indicate that one or more of the other processor cores, i.e., CPU 0 is assigned with one or more tasks in one or more different scheduling classes than the first scheduling class (CFS task in FIG. 3 ; RT task in FIG. 4 ).
  • the at least one of the one or more tasks i.e., CFS task assigned to CPU 0
  • RT task runnable task
  • the at least one of the one or more tasks i.e., RT task assigned to CPU 0
  • the runnable task in the first scheduling class can be assigned to one of the at least one processor core not assigned with any tasks, i.e. CPU 1 .
  • the advantages of referring more complete task information rest not only in cases where at least one processor core is not assigned with any tasks (e.g., cases in FIGS. 3 and 4 ) but also in cases where none of the processor cores is not assigned with any tasks.
  • the task scheduler 110 can further consider task priorities of tasks in scheduling classes different from the first scheduling class of the runnable task to be assigned.
  • One of the advantages is to prevent non-discrimination between a processor core not assigned with task(s) in the first scheduling class but assigned with task(s) in other different scheduling class(es) with higher task priorities and a processor core not assigned with task(s) in the first scheduling class but assigned with task(s) in other different scheduling class(es) with lower task priorities.
  • the details will be explained by embodiments illustrated with FIGS. 5 and 6 .
  • FIG. 5 is a schematic diagram for explaining task assignment in a third case according to further another embodiment of the invention.
  • processor cores CPU 0 -CPU 3
  • CPU 0 is assigned with a CFS task
  • CPU 1 is assigned with another CFS task
  • CPU 2 and CPU 3 are assigned with respective RT tasks, wherein each of the RT tasks has higher priority than the CFS task, and the CFS task assigned to CPU 0 has higher priority than the CFS task assigned to CPU 1 .
  • the task scheduler 110 can assign the RT task to CPU 1 because the CFS task assigned to CPU 1 has the lowest priority of the four tasks assigned to the four processor cores CPU 0 -CPU 3 .
  • a conventional task scheduler in the third case only refers to the first task assignment information, that is, the task assignment about the RT tasks, it may not be able to discriminate CPU 0 and CPU 1 and may therefore assign the RT task to any of CPU 0 and CPU 1 . That is, the conventional task scheduler might undesirably, assign the RT task to CPU 0 rather than CPU 1 .
  • the task scheduler 110 in the can obtain the second task assignment information about the CFS tasks, and therefore the task scheduler 110 can assign the RT task to CPU 1 with a lower task priority.
  • FIG. 6 is a schematic diagram for explaining task assignment in a fourth case according to still further another embodiment of the invention.
  • processor cores CPU 0 -CPU 3
  • CPU 0 is assigned with an RT task
  • CPU 1 -CPU 3 are assigned with respective CFS tasks.
  • the task scheduler 110 can refer to task assignment information about CFS tasks and task assignment information about RT tasks. Since the RT task has a higher priority than all of the CFS tasks, the task scheduler 110 may schedule the CFS task to be run on one of CPU 1 -CPU 3 , according to a scheduling method of the CFS.
  • a conventional task scheduler in this case only refers to the first task assignment information, i.e., information about CFS tasks, so it assigns the CFS task to CPU 0 as a result of not considering that an RT task is assigned to CPU 0 . This causes an undesired situation that the CFS task may not be executed until the RT task has been completed.
  • the task scheduler 110 in this embodiment can fully consider the CFS tasks and RT tasks and task priorities thereof, so it is able to appropriately assign the CFS task to CPU 1 , CPU 2 , or CPU 3 according to the CFS.
  • FIGS. 5 and 6 are similar in that when the runnable task in the first scheduling class (RT task in FIG. 5 and CFS task in FIG. 6 ) is wakened up and is to be assigned to one of the processor cores CPU 0 -CPU 1 , none of the processor cores is not assigned with any tasks in any scheduling classes. In other words, each processor core is assigned with at least one task.
  • FIGS. 5 and 6 differ mainly in that in task priorities of tasks currently assigned to CPU 0 -CPU 4 compared to that the task priority of the runnable task. More specifically, in FIG. 5 , two or more of the processor cores, i.e.
  • CPU 0 and CPU 1 are assigned with tasks (CFS tasks) having task priorities each lower than the task priority of the runnable task (RT task).
  • CFS tasks tasks
  • at least one of the processor cores (CPU 0 ) is assigned with at least one task each having a respective task priority higher than the task priority of the runnable task (i.e., CPU 0 is assigned with at least one RT task)
  • the at least one processor core (CPU 1 -CPU 3 ) is not assigned with any tasks in the first scheduling class (RT tasks).
  • task priorities of the tasks in the scheduling class lower than (in FIG. 5 ) or equal to (in FIG. 6 ) the first scheduling class are taken into consideration in the assigning process.
  • the runnable task in the first scheduling class (the RT task) can be preferably assigned to one of the two or more processor cores (CPU 0 or CPU 1 ), and more preferably, the processor core taking the runnable task can be one of the tasks that has a lowest task priority (i.e., CPU 1 ).
  • CPU 0 or CPU 1 the processor core taking the runnable task
  • the runnable task in the first scheduling class can be assigned to one of the processor cores (CUP 1 -CPU 3 ) other than the at least one processor core (CPU 0 ) according to a scheduling algorithm corresponding to the first scheduling class (CFS) which takes task priorities of the CFS tasks on CPU 1 -CPU 3 into consideration.
  • a plurality of candidate processor cores i.e., CPU 0 and CPU 1 in FIG. 5 ; and CPU 1 -CPU 3 in FIG. 6
  • CPU 0 and CPU 1 in FIG. 5 can be selected from CPU 0 -CPU 4
  • an most appropriate processor core can be further determined among the one or more processor core according to the task priorities of the tasks on the candidate processor cores.
  • the additional reference to task assignment information about tasks different from the runnable task to be assigned can mitigate the problem of load imbalance and therefore improve performance of the multi-core processor system.
  • the runnable task in FIG. 7 has been assigned to one of the processor cores prior to the assigning the runnable task. That is, the additional reference to task assignment information about tasks different from the runnable task can be also applied to determining whether to reassign the runnable task to another one of the processor cores.
  • FIG. 7 is a schematic diagram for explaining task assignment in a fifth case according to yet further another embodiment of the invention.
  • processor cores CPU 0 -CPU 3
  • CPU 0 is assigned with a CFS task
  • CPU 1 is not assigned with any tasks
  • CPU 2 is assigned with an RT task and a CFS task
  • CPU 3 is assigned with an RT task, wherein the RT task has a higher priority than the CFS task.
  • the task scheduler 110 can determine the CFS task can be reassigned to the processor core CPU 1 that is not assigned with any tasks.
  • a conventional task scheduler refers to the task assignment information only about CFS tasks, it does not consider the RT task on CPU 2 during a loading-balancing progress for CFS task, and therefore it might not considers it necessary to reassign the CFS task on CPU 2 to any other processor core.
  • the task scheduler 110 refers to both the first task assignment information about the CFS tasks and the second task assignment information about the RT tasks, so it considers it necessary to reassign the CFS task on CPU 2 to another processor core.
  • the task scheduler 110 is also able to discriminate the processor cores CPU 1 and CPU 3 and determine the more appropriate processor core CPU 1 not assigned with any tasks to accept the reassigned CFS task.
  • the more complete consideration of task assignment information about tasks in more than one scheduling class can be applied to determining whether to reassign tasks if there is an idle processor core (i.e., without being assigned any tasks).
  • a specific scheduling class i.e., the first scheduling class, which is class 1 in FIG. 7
  • the first task assignment information and the second task assignment information indicate (1) one of the processor cores is not assigned with any tasks in any scheduling class (CPU 1 in FIGS. 7 ); and (2) at least one processor core of the processor cores (CPU 2 in FIG.
  • FIGS. 1-7 present cases with only the CFS tasks, RT tasks, and four processor cores (CPU 0 -CPU 3 ).
  • the invention should not be limited to what is shown in FIGS. 1-7 .
  • the discussions for the above embodiments can be readily analogized to other embodiments with different numbers and/or scheduling classes of tasks and other different numbers of processor cores.
  • FIG. 8 is a flow chart illustrating the method 300 for assigning tasks according to an embodiment of the invention.
  • the method for assigning tasks may be applied to a multi-core processor system and by a task scheduler for scheduling tasks to a plurality of processor cores. It is noted that the shown sequence of the steps is not for limiting purpose, but for explanation purpose.
  • step S 310 first task assignment information about tasks in a first scheduling class assigned to the processor cores can be obtained.
  • step S 320 second task assignment information about tasks in one or more other scheduling classes assigned to the processor cores can be obtained. Each of the one or more other scheduling classes is different from the first scheduling class.
  • both the first task assignment information and the second task assignment information can be referred to assign a runnable task in the first scheduling class to one of the processor cores. More other details can be analogized from the discussions for embodiments illustrated with FIGS. 1-7 so are omitted here for brevity.
  • a software module e.g., including executable instructions and related data
  • other data may reside in a data memory such as RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of computer-readable storage medium known in the art.
  • a sample storage medium may be coupled to a machine such as, for example, a computer/processor (which may be referred to herein, for convenience, as a “processor”) such that the processor can read information (e.g., code) from and write information to the storage medium.
  • a sample storage medium may be integral to the processor.
  • the processor and the storage medium may reside in an ASIC.
  • the ASIC may reside in user equipment.
  • the processor and the storage medium may reside as discrete components in user equipment.
  • any suitable computer-program product may comprise a computer-readable medium comprising codes relating to one or more of the aspects of the disclosure.
  • a computer software product may comprise packaging materials.
  • any task is assigned (newly assigned or reassigned) according to only task assignment information of tasks in the same scheduling class as the task to be assigned, and information of tasks of different scheduling class(es) are not considered.
  • the conventional scheduling method considers different scheduling classes completely irrelevant to each other in assigning tasks.
  • the incomplete reference to task assignment information causes many problems such as load imbalance and degraded system performance.
  • the embodiments consider fuller information, including not only task assignment information of tasks in the same scheduling class as the task to be assigned, but also information of tasks of scheduling class(es) different from the scheduling class of the task to be assigned.
  • the method in the embodiments can schedule a task according to a scheduling algorithm corresponding to the scheduling class of the task, and it can also assign the task to the processor cores according to information about a plurality of scheduling classes. Consequently, the embodiment can enhance load balance among processor cores and improve system performance.

Abstract

A multi-core processor system and method are provided. The multi-core processor system includes a plurality of processor cores and a task scheduler. The processor cores perform a plurality of tasks, wherein each of the tasks is in a respective one of a plurality of scheduling classes. The task scheduler obtains first task assignment information about tasks which are in a first scheduling class from the scheduling classes and assigned to the processor cores, obtains second task assignment information about tasks in one or more other scheduling classes and assigned to the processor cores, and refers to the first task assignment information and the second task assignment information to assign a runnable task in the first scheduling class to one of the processor cores. Prior to the assigning the runnable task, the runnable task has been assigned to one of the processor cores.

Description

    CROSS REFERENCE TO RELATED APPLICATIONS
  • This Application is a Continuation of pending U.S. application Ser. No. 14/799,921, filed on Jul. 15, 2015, which claims priority of U.S. Provisional Patent Application No. 62/058,846, filed on Oct. 2, 2014, the entirety of which is incorporated by reference herein.
  • BACKGROUND OF THE INVENTION Field of the Invention
  • The invention generally relates to task assignment in a multi-core processor system, and more particularly, to task assignment that cross refers to task assignment information corresponding to multiple scheduling classes at the same time.
  • Description of the Related Art
  • In electronic devices such as smartphones, notebooks, and tablet computers, a task scheduler is configured to schedule or assign tasks a multi-core processor system including a plurality of processor cores. The tasks can be scheduled according to different scheduling algorithms, which for example, can include RT (real-time) scheduler, and/or a Completely Fair Scheduler (CFS), and/or any specific scheduling algorithm. Tasks can be referred to according to their corresponding scheduling algorithms. For example, tasks scheduled according to RT scheduler can be referred to as RT tasks, and tasks scheduled according to CFS can be referred to as CFS tasks.
  • When the task scheduler assigns tasks to the processor cores, it refers to task assignment information about tasks currently assigned to the processor cores. In addition, the task scheduler assigns RT tasks and CFS tasks independently. Specifically, when the task scheduler assigns a RT task, it refers to only task assignment information about RT tasks currently assigned to the processor cores, without considering CFS tasks or any other tasks different from RT tasks currently assigned to the processor cores. Similarly, when the task scheduler assigns a CFS task, it does not refer to task assignment information about tasks other than CFS tasks assigned to the processor cores. In summary, when the task scheduler assigns a task scheduled by a specific scheduling algorithm, it does not consider tasks scheduled by any other scheduling algorithms different from the specific scheduling algorithm.
  • However, load imbalance often occurs and the performance of the processor cores is not optimal. Solving the problems to improve task assignment and system performance in a multi-core processor system is therefore a subject worthy of discussion.
  • BRIEF SUMMARY OF THE INVENTION
  • Multi-core processor system and method for assigning tasks are provided to overcome the problems mentioned above.
  • An embodiment of the invention provides a method for assigning tasks in a multi-core processor system. The method comprises operations to assign tasks in a multi-core processor system, wherein the multi-core processor system comprises a plurality of processor cores, and each of the tasks is in a respective one of a plurality of scheduling classes. The operations comprises obtaining first task assignment information about tasks which are in a first scheduling class from the plurality of scheduling classes and assigned to the plurality of processor cores, wherein the first task assignment information indicates current assignments of processor cores from the plurality of processor cores for the first scheduling class; obtaining second task assignment information about tasks which are in one or more other scheduling classes and assigned to the plurality of processor cores, wherein each of the one or more other scheduling classes is different from the first scheduling class, wherein the second task assignment information indicates current assignments of processor cores from the plurality of processor cores for the one or more other scheduling classes; and referring to the first task assignment information and the second task assignment information to assign a runnable task in the first scheduling class to one of the plurality of processor cores, wherein prior to the assigning the runnable task in the first scheduling class, the runnable task in the first scheduling class has been assigned to one of the plurality of processor cores
  • Another embodiment of the invention provides a multi-core processor system. The multi-core processor system includes a plurality of processor cores and a task scheduler. The plurality of processor cores is configured to perform a plurality of tasks, wherein each of the tasks is in a respective one of a plurality of scheduling classes. The task scheduler is configured to obtain first task assignment information about tasks which are in a first scheduling class from the plurality of scheduling classes and assigned to the plurality of processor cores, obtain second task assignment information about tasks which are in one or more other scheduling classes and assigned to the plurality of processor cores, wherein each of the one or more other scheduling classes is different from the first scheduling class, and refer to the first task assignment information and the second task assignment information to assign a runnable task in the first scheduling class to one of the plurality of processor cores. Prior to the assigning the runnable task in the first scheduling class, the runnable task in the first scheduling class has been assigned to one of the plurality of processor cores.
  • Compared to the conventional method that considers insufficient task assignment information in assign tasks, the embodiments refer to more task assignment information. That is, to assign a runnable task, information about tasks in other one or more scheduling classes different from the scheduling class of the runnable task can be taken into consideration. Due to considering more task assignment information, load can be more balanced on the processor cores, and the performance of the multi-core processor system can be improved.
  • Other aspects and features of the invention will become apparent to those with ordinary skill in the art upon review of the following descriptions of specific embodiments of communication transmission methods and systems.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • The invention will become more fully understood by referring to the following detailed description with reference to the accompanying drawings, wherein:
  • FIG. 1 is a block diagram of a multi-core processor system 100 according to an embodiment of the invention;
  • FIG. 2 is a schematic diagram illustrating priority ranges according to an embodiment of the invention;
  • FIG. 3 is a schematic diagram for explaining task assignment in a first case according to an embodiment of the invention;
  • FIG. 4 is a schematic diagram for explaining task assignment in a second case according to another embodiment of the invention;
  • FIG. 5 is a schematic diagram for explaining task assignment in a third case according to further another embodiment of the invention;
  • FIG. 6 is a schematic diagram for explaining task assignment in a fourth case according to still further another embodiment of the invention;
  • FIG. 7 is a schematic diagram for explaining task assignment in a fifth case according to yet further another embodiment of the invention;
  • FIG. 8 is a flow chart illustrating a method for assigning tasks according to an embodiment of the invention.
  • DETAILED DESCRIPTION OF THE INVENTION
  • The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
  • It should be noted that the term “multi-core processor system” may mean a multi-core system or a multi-processor system, depending upon the actual design. In other words, the proposed task scheduling method may be employed by any of the multi-core system and the multi-processor system. For example, concerning the multi-core system, all of the processor cores may be disposed in one processor core. For another example, concerning the multi-processor system, each of the processor cores may be disposed in one processor core. Hence, each of the clusters may be implemented as a group of processors.
  • FIG. 1 is a block diagram of a multi-core processor system 100 according to an embodiment of the invention. The multi-core processor system 100 comprises a task scheduler 110, and a plurality of processor cores 120A-120N. FIG. 1 presents a simplified block diagram in which only the elements relevant to the invention are shown. However, the invention should not be limited to what is shown in FIG. 1.
  • The processor cores 120A-120N are configured to perform or execute the tasks and instructions, wherein the processor cores 120A-120N may be Central Processing Units (CPUs), or other processing elements. The multi-core processor system 100 may be a Symmetric multi-processing (SMP) type, or a Heterogeneous Multi-Processing (HMP) type, or any other type of multi-core processor system. The task scheduler 110 may be implemented in a kernel of an operation system (i.e. Linux, Windows, Mac OS X, Linux, etc.) of the multi-core processor system 100. The task scheduler 110 is configured to assign the tasks to the processor cores 120A-120N.
  • FIG. 2 is a schematic diagram illustrating priority ranges according to an embodiment of the invention. As shown, there are a plurality of scheduling classes, which are associated with a plurality of priority ranges, respectively. For example, a scheduling class 0 covering a first priority range (e.g., 0-99) and another scheduling class 1 covering a second priority range (e.g., 100-139). Tasks assigned by the task scheduler 110 can be defined to be in any of the scheduling classes. In addition, each task can be given a respective task priority, which is in the priority range associated with the scheduling class of the task. For example, a task given a task priority 50 is in the scheduling class 0, and a task given a task priority 110 is in the scheduling class 1. Therefore, tasks in class 0 can have task priorities ranging from 0-99, and tasks in class 1 can have task priorities ranging from 100-139. A task with a smaller value of task priority means the task has higher priority to be executed. That is, when there are a task with task priority m and another task with task priority n (m<n) both assigned to a processor core, task with task priority m may be given higher priority to be executed than task with task priority n. Similarly, tasks in scheduling class 0 may be given higher priority to be executed than tasks in the scheduling class 1 on the same processor.
  • In addition, the different scheduling classes (number=M) can correspond to a plurality of scheduling algorithms (number=N, N<=M), respectively. In other words, a task in a scheduling class can be scheduled according to the scheduling algorithm corresponding to the scheduling class. In different embodiments of the invention, the scheduling algorithms comprise at least one of a real-time (RT) scheduler, a Completely Fair Scheduler (CFS; a Shortest Job First (SJF), a First-In First-Out (FIFO) scheduler, a Brain fuck Scheduler (BFS), a Stop scheduler class, a Deadline scheduler, and any other scheduling algorithms.
  • In a non-limiting example illustrated with FIG. 2, the scheduling class 0 can correspond to RT scheduler, and the scheduling class 1 can correspond to CFS. Therefore, tasks scheduled according to RT scheduler, hereafter referred to as RT tasks, are in the scheduling class 0 and can have higher task priorities ranging from 0 to 99. Similarly, tasks scheduled according to CFS, hereafter referred to as CFS tasks, are in the scheduling class 1 and have lower task priorities ranging from 100-139.
  • In an embodiment of the invention, to assign a runnable task to one of the processor cores 120A-120N, the task scheduler 110 may consider not only tasks in a scheduling class of the runnable task (hereafter referred to as a first scheduling class) that are currently assigned to the processor cores but also tasks in one or more scheduling classes different from the first scheduling class currently assigned to the processor cores 120A-120N.
  • For brevity, information about tasks in the first scheduling class assigned to the processor cores 120A-120N is referred to as first task assignment information; and information about tasks in the other one or more scheduling classes assigned to the processor cores 120A-120N is referred to as second task assignment information. In other words, to assign the runnable task to one of the processor cores 120A-120N, the task scheduler 110 may consider both the first task assignment information and the second task assignment information.
  • After obtaining the first task assignment information and the second task assignment information, the task scheduler 110 can know task(s) currently running and/or waiting in a queue to be run by the processor core 120A, task(s) currently running and/or waiting in a queue to be run by the processor core 120B, . . . , and task(s) currently running and/or waiting in a queue to be run by the processor core 120N, wherein the tasks known and considered by the task scheduler 110 are not limited to being in the same scheduling class of the runnable task. With the knowledge of the tasks currently assigned to the processor cores 120A-120N, the task scheduler 110 can therefore assign the runnable task in the first scheduling class to an appropriate one of the processor cores 120A-120N.
  • The method for assigning tasks in the embodiment is in contrast to the conventional method, which considers only the first task assignment information and neglects the second task assignment information. In other words, compared to conventional methods, the embodiment refers to more complete information by considering assigned tasks in more different scheduling classes. Consequently, the embodiment can have more balanced loading for the processor cores and better performance of the multi-core processor system, as will be demonstrated in the following disclosure.
  • Please be noted that the cross-referring to task information about tasks in different scheduling classes can be applied to any specific tasks/scheduling classes/scheduling algorithms and any numbers thereof. For example, the tasks to be assigned are not limited to having task priorities or being performed in sequence according to their task priorities. In a non-limiting embodiment, the tasks can be scheduled according to their respective deadlines, which can be implemented in the Deadline scheduler, for example.
  • Please also be noted that the runnable task may have been or not been assigned to any of the processor cores prior. Specifically, in some embodiments illustrated with FIGS. 3-5, prior to the assigning the runnable task, the runnable task has not been assigned to any of the processor cores. In other embodiments, exemplarily illustrated with FIG. 7, prior to the assigning the runnable task in the first scheduling class to the one of the processor cores, the runnable task in the first scheduling class is currently assigned to one of the processor cores but may be reassigned to another one of the processor cores.
  • In embodiments where the runnable task in the first scheduling class which is not currently assigned to any of the processor cores 120A-120N, before the task scheduler 110 assigns the runnable task in the first scheduling class to one of the processor cores, the task scheduler 110 may wake up the runnable task, and then determines which one of the processor cores 120A-120N is appropriate to be assigned with the runnable task by referring to the first task assignment information and the second task assignment information.
  • In embodiments where the runnable task in the first scheduling class has been assigned to one processor cores of the processor cores 120A-120N, the task scheduler 110 can determine to whether to reassign the runnable task in the first scheduling class for better load balance according to the first task assignment information and the second task assignment information. If the determination result is positive, the task scheduler 110 may move the runnable task in the first scheduling class to another processor core of the processor cores 120A-120N according to the first task assignment information and the second task assignment information. One advantage of referring to more task assignment information is to prevent non-discrimination between a processor core not assigned with task(s) in the first scheduling class but assigned with task(s) in other different scheduling class(es) and a processor core not assigned with any tasks in any scheduling classes. More specifically, by referring to the first task assignment information, the task scheduler 110 can know that whether at least one processor core is not assigned with any tasks in the first scheduling class. And by referring to the second task assignment information, the task scheduler 110 can further know that whether the at least one of the other processor cores is not assigned with any task in any scheduling class different from the first scheduling class or not. Accordingly, the task scheduler 110 can know whether at least one processor core is not assigned with any tasks or none of the processor cores is not assigned with any tasks, by referring to both the first task assignment information and second task assignment information. Due to a fuller consideration of assigned tasks in different scheduling classes, the task scheduler 110 can assign tasks in a more balanced way, as will be explained more by following embodiments.
  • FIG. 3 is a schematic diagram for explaining task assignment in a first case according to an embodiment of the invention. As exemplarily shown in FIG. 3, there are four processor cores CPU 0-CPU 3 in the multi-core processor system 100. In this case, CPU 0 is assigned with a CFS task, CPU 1 is not assigned with any tasks, and CPU 2 and CPU 3 are assigned with RT tasks, respectively. As mentioned above, a RT task can have higher task priority than a CFS task. When an RT task is awaken and the task scheduler 110 determines to assign the RT task to one of the processor cores, the task scheduler 110 can refers to the task assignment information corresponding to the CFS tasks and RT tasks (i.e. the first task assignment information and the second task assignment information). Knowing that CPU 1 is not assigned with any tasks, the task scheduler 110 can assign the RT task to the processor CPU 1.
  • In comparison to conventional technology, a conventional task scheduler may refer to the first task assignment information about RT tasks without referring to the second task assignment information about the CFS tasks, and the conventional task scheduler sees CPU 0 and CPU 1 equally. Consequently, the conventional task scheduler may assign the RT task to CPU 0 rather than to CPU 1. In other words, the conventional task scheduler treats the idle CPU 1 and the non-idle CPU 0 indifferently, and it may therefore arrange CPU 0 to undertake more tasks while leaving CPU 1 to remain unassigned with any tasks.
  • In comparison, by referring to more complete task assignment information, the task scheduler 110 in the embodiment can discriminate between CPU 1 that is assigned with a CFS task and CPU 1 that is not assigned with any task, and can therefore assign the RT task to CPU 1. The task scheduler 110 in the embodiment can make a more balanced-loading system. FIG. 4 is a schematic diagram for explaining task assignment in a second case according to another embodiment of the invention. FIG. 4 is similar to FIG. 3, differing only in that a RT task is awaked and is to be assigned by the task scheduler 110 to one of the four processor cores CPU 0-CPU 3 in the multi-core processor system 100, where CPU 0 is assigned with a RT task, CPU 1 is not assigned with any tasks, and CPU 2 and CPU 3 are assigned with CFS tasks, respectively.
  • Similar to the first case in FIG. 3, a conventional task scheduler in the second case may refer to the first task assignment information about CFS tasks without referring to the second task assignment information about the RT tasks, and may therefore assign the CFS task to CPU 0 rather than to CPU 1. In contrast, by referring to not only the first assignment information but also the second assignment information, the task scheduler 110 in the embodiment can discriminate between CPU 0 and CPU 1, and can therefore assign the RT task to CPU 1 that is not assigned with any tasks. Consequently, the task scheduler 110 in the embodiment can make a more balanced-loading system.
  • In summary, FIGS. 3 and 4 are similar in that at least one processor core is not assigned with any tasks in any scheduling classes. More specifically, when the runnable task (RT task in FIG. 3; CFS task in FIG. 4) in the first scheduling class (scheduling class 0 in FIG. 3; scheduling class 1 in FIG. 4) is wakened up and is to be assigned to one of the processor cores CPU0-CPU3, the first task assignment information and the second task assignment information indicate that at least one CPU1 is not assigned with any tasks in any scheduling class, and the second task assignment information further indicate that one or more of the other processor cores, i.e., CPU 0 is assigned with one or more tasks in one or more different scheduling classes than the first scheduling class (CFS task in FIG. 3; RT task in FIG. 4). In FIG. 3, the at least one of the one or more tasks, i.e., CFS task assigned to CPU 0, has a task priority lower than a task priority of the runnable task (RT task). In contrast, in FIG. 4, the at least one of the one or more tasks, i.e., RT task assigned to CPU 0, has a task priority higher than a task priority of the runnable task (CFS task). In both cases of FIGS. 3 and 4, the runnable task in the first scheduling class can be assigned to one of the at least one processor core not assigned with any tasks, i.e. CPU 1.
  • It is noted that the advantages of referring more complete task information rest not only in cases where at least one processor core is not assigned with any tasks (e.g., cases in FIGS. 3 and 4) but also in cases where none of the processor cores is not assigned with any tasks. In such cases, due to referring to the second task assignment information, the task scheduler 110 can further consider task priorities of tasks in scheduling classes different from the first scheduling class of the runnable task to be assigned. One of the advantages is to prevent non-discrimination between a processor core not assigned with task(s) in the first scheduling class but assigned with task(s) in other different scheduling class(es) with higher task priorities and a processor core not assigned with task(s) in the first scheduling class but assigned with task(s) in other different scheduling class(es) with lower task priorities. The details will be explained by embodiments illustrated with FIGS. 5 and 6.
  • FIG. 5 is a schematic diagram for explaining task assignment in a third case according to further another embodiment of the invention. As shown in FIG. 5, there are four processor cores (CPU 0-CPU 3) in the multi-core processor system 100. CPU 0 is assigned with a CFS task, CPU 1 is assigned with another CFS task, and CPU 2 and CPU 3 are assigned with respective RT tasks, wherein each of the RT tasks has higher priority than the CFS task, and the CFS task assigned to CPU 0 has higher priority than the CFS task assigned to CPU1.
  • When an RT task is awaken, by referring to the task assignment information corresponding to the CFS tasks and RT tasks (i.e. the first task assignment information and the second task assignment information), the task scheduler 110 can assign the RT task to CPU 1 because the CFS task assigned to CPU 1 has the lowest priority of the four tasks assigned to the four processor cores CPU 0-CPU 3.
  • In comparison, a conventional task scheduler in the third case only refers to the first task assignment information, that is, the task assignment about the RT tasks, it may not be able to discriminate CPU 0 and CPU 1 and may therefore assign the RT task to any of CPU 0 and CPU 1. That is, the conventional task scheduler might undesirably, assign the RT task to CPU 0 rather than CPU1. In contrast, the task scheduler 110 in the can obtain the second task assignment information about the CFS tasks, and therefore the task scheduler 110 can assign the RT task to CPU 1 with a lower task priority.
  • FIG. 6 is a schematic diagram for explaining task assignment in a fourth case according to still further another embodiment of the invention. As shown in FIG. 6, there are four processor cores (CPU 0-CPU 3) in the multi-core processor system 100, where CPU 0 is assigned with an RT task, and CPU 1-CPU 3 are assigned with respective CFS tasks. When a CFS task is awaked and to be assigned to one of CPU0-CPU3, the task scheduler 110 can refer to task assignment information about CFS tasks and task assignment information about RT tasks. Since the RT task has a higher priority than all of the CFS tasks, the task scheduler 110 may schedule the CFS task to be run on one of CPU 1-CPU3, according to a scheduling method of the CFS.
  • In comparison, a conventional task scheduler in this case only refers to the first task assignment information, i.e., information about CFS tasks, so it assigns the CFS task to CPU0 as a result of not considering that an RT task is assigned to CPU 0. This causes an undesired situation that the CFS task may not be executed until the RT task has been completed. In contrast, the task scheduler 110 in this embodiment can fully consider the CFS tasks and RT tasks and task priorities thereof, so it is able to appropriately assign the CFS task to CPU 1, CPU2, or CPU3 according to the CFS.
  • FIGS. 5 and 6 are similar in that when the runnable task in the first scheduling class (RT task in FIG. 5 and CFS task in FIG. 6) is wakened up and is to be assigned to one of the processor cores CPU 0-CPU 1, none of the processor cores is not assigned with any tasks in any scheduling classes. In other words, each processor core is assigned with at least one task. FIGS. 5 and 6 differ mainly in that in task priorities of tasks currently assigned to CPU0-CPU4 compared to that the task priority of the runnable task. More specifically, in FIG. 5, two or more of the processor cores, i.e. CPU 0 and CPU1 are assigned with tasks (CFS tasks) having task priorities each lower than the task priority of the runnable task (RT task). In contrast, at least one of the processor cores (CPU 0) is assigned with at least one task each having a respective task priority higher than the task priority of the runnable task (i.e., CPU 0 is assigned with at least one RT task), and the at least one processor core (CPU1-CPU3) is not assigned with any tasks in the first scheduling class (RT tasks).
  • Moreover, task priorities of the tasks in the scheduling class lower than (in FIG. 5) or equal to (in FIG. 6) the first scheduling class are taken into consideration in the assigning process. Specifically, in FIG. 5, the runnable task in the first scheduling class (the RT task) can be preferably assigned to one of the two or more processor cores (CPU0 or CPU1), and more preferably, the processor core taking the runnable task can be one of the tasks that has a lowest task priority (i.e., CPU1). On the other hand, in FIG. 6, the runnable task in the first scheduling class (CFS task) can be assigned to one of the processor cores (CUP1-CPU3) other than the at least one processor core (CPU0) according to a scheduling algorithm corresponding to the first scheduling class (CFS) which takes task priorities of the CFS tasks on CPU1-CPU3 into consideration.
  • No matter is cases 4 or 5, a plurality of candidate processor cores (i.e., CPU0 and CPU1 in FIG. 5; and CPU1-CPU3 in FIG. 6) can be selected from CPU0-CPU4, and an most appropriate processor core can be further determined among the one or more processor core according to the task priorities of the tasks on the candidate processor cores. In both the steps, the additional reference to task assignment information about tasks different from the runnable task to be assigned can mitigate the problem of load imbalance and therefore improve performance of the multi-core processor system.
  • In contrast to FIGS. 3-6 where the runnable task has not been assigned yet, the runnable task in FIG. 7 has been assigned to one of the processor cores prior to the assigning the runnable task. That is, the additional reference to task assignment information about tasks different from the runnable task can be also applied to determining whether to reassign the runnable task to another one of the processor cores.
  • FIG. 7 is a schematic diagram for explaining task assignment in a fifth case according to yet further another embodiment of the invention. As shown in FIG. 7, there are four processor cores (CPU 0-CPU 3) in the multi-core processor system 100. CPU 0 is assigned with a CFS task, CPU 1 is not assigned with any tasks, CPU 2 is assigned with an RT task and a CFS task, and CPU 3 is assigned with an RT task, wherein the RT task has a higher priority than the CFS task. When an idle balancing is to be performed for CFS tasks, since CPU2 is assigned with (i) at least one RT task, and (ii) at least one CFS task having a task priority lower than the at least one RT task, the task scheduler 110 can determine the CFS task can be reassigned to the processor core CPU1 that is not assigned with any tasks.
  • In comparison, since a conventional task scheduler refers to the task assignment information only about CFS tasks, it does not consider the RT task on CPU2 during a loading-balancing progress for CFS task, and therefore it might not considers it necessary to reassign the CFS task on CPU2 to any other processor core. In contrast, the task scheduler 110 refers to both the first task assignment information about the CFS tasks and the second task assignment information about the RT tasks, so it considers it necessary to reassign the CFS task on CPU2 to another processor core. Moreover, the task scheduler 110 is also able to discriminate the processor cores CPU1 and CPU3 and determine the more appropriate processor core CPU1 not assigned with any tasks to accept the reassigned CFS task.
  • In summary, the more complete consideration of task assignment information about tasks in more than one scheduling class can be applied to determining whether to reassign tasks if there is an idle processor core (i.e., without being assigned any tasks). More specifically, a specific scheduling class (i.e., the first scheduling class, which is class 1 in FIG. 7) can be determined to receive an idle balancing process. And if the first task assignment information and the second task assignment information indicate (1) one of the processor cores is not assigned with any tasks in any scheduling class (CPU1 in FIGS. 7); and (2) at least one processor core of the processor cores (CPU2 in FIG. 7) is assigned with (i) at least one task in the first scheduling class to receive the idle balancing process (CFS tasks), and (ii) at least one task in a scheduling class different from the first scheduling class and the at least one task has lower task priority than the at least one task in the first scheduling class, then one of the at least one task in the first scheduling class (CFS task), which is then the runnable task, can be reassigned to the processor cores (CPU1 in FIG. 7) not assigned with any tasks.
  • Note that, the above embodiments shown with FIGS. 1-7 present cases with only the CFS tasks, RT tasks, and four processor cores (CPU 0-CPU 3). However, the invention should not be limited to what is shown in FIGS. 1-7. The discussions for the above embodiments can be readily analogized to other embodiments with different numbers and/or scheduling classes of tasks and other different numbers of processor cores.
  • FIG. 8 is a flow chart illustrating the method 300 for assigning tasks according to an embodiment of the invention. The method for assigning tasks may be applied to a multi-core processor system and by a task scheduler for scheduling tasks to a plurality of processor cores. It is noted that the shown sequence of the steps is not for limiting purpose, but for explanation purpose. In step S310, first task assignment information about tasks in a first scheduling class assigned to the processor cores can be obtained. In step S320, second task assignment information about tasks in one or more other scheduling classes assigned to the processor cores can be obtained. Each of the one or more other scheduling classes is different from the first scheduling class. In step S330, both the first task assignment information and the second task assignment information can be referred to assign a runnable task in the first scheduling class to one of the processor cores. More other details can be analogized from the discussions for embodiments illustrated with FIGS. 1-7 so are omitted here for brevity.
  • The steps of the method described in connection with the aspects disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module (e.g., including executable instructions and related data) and other data may reside in a data memory such as RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of computer-readable storage medium known in the art. A sample storage medium may be coupled to a machine such as, for example, a computer/processor (which may be referred to herein, for convenience, as a “processor”) such that the processor can read information (e.g., code) from and write information to the storage medium. A sample storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in user equipment. In the alternative, the processor and the storage medium may reside as discrete components in user equipment. Moreover, in some aspects, any suitable computer-program product may comprise a computer-readable medium comprising codes relating to one or more of the aspects of the disclosure. In some aspects, a computer software product may comprise packaging materials.
  • In the conventional task scheduler, any task is assigned (newly assigned or reassigned) according to only task assignment information of tasks in the same scheduling class as the task to be assigned, and information of tasks of different scheduling class(es) are not considered. The conventional scheduling method considers different scheduling classes completely irrelevant to each other in assigning tasks. The incomplete reference to task assignment information causes many problems such as load imbalance and degraded system performance. In contrast, the embodiments consider fuller information, including not only task assignment information of tasks in the same scheduling class as the task to be assigned, but also information of tasks of scheduling class(es) different from the scheduling class of the task to be assigned. Therefore, the method in the embodiments can schedule a task according to a scheduling algorithm corresponding to the scheduling class of the task, and it can also assign the task to the processor cores according to information about a plurality of scheduling classes. Consequently, the embodiment can enhance load balance among processor cores and improve system performance.
  • The above paragraphs describe many aspects. Obviously, the teaching of the invention can be accomplished by many methods, and any specific configurations or functions in the disclosed embodiments only present a representative condition. Those who are skilled in this technology will understand that all of the disclosed aspects in the invention can be applied independently or be incorporated.
  • While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. Those who are skilled in this technology can still make various alterations and modifications without departing from the scope and spirit of this invention. Therefore, the scope of the present invention shall be defined and protected by the following claims and their equivalents.

Claims (4)

What is claimed is:
1. A method comprising:
operations to assign tasks in a multi-core processor system, wherein the multi-core processor system comprises a plurality of processor cores, and each of the tasks is in a respective one of a plurality of scheduling classes, the operations comprising:
obtaining first task assignment information about tasks which are in a first scheduling class from the plurality of scheduling classes and assigned to the plurality of processor cores, wherein the first task assignment information indicates current assignments of processor cores from the plurality of processor cores for the first scheduling class;
obtaining second task assignment information about tasks which are in one or more other scheduling classes and assigned to the plurality of processor cores, wherein each of the one or more other scheduling classes is different from the first scheduling class, wherein the second task assignment information indicates current assignments of processor cores from the plurality of processor cores for the one or more other scheduling classes; and
referring to the first task assignment information and the second task assignment information to assign a runnable task in the first scheduling class to one of the plurality of processor cores,
wherein prior to the assigning the runnable task in the first scheduling class, the runnable task in the first scheduling class has been assigned to one of the plurality of processor cores.
2. The method of claim 1, wherein the assigning the runnable task in the first scheduling class comprises:
determining whether to reassign the runnable task in the first scheduling class to another processor core of the plurality of processor cores.
3. A multi-core processor system, comprising:
a plurality of processor cores configured to perform a plurality of tasks, wherein each of the tasks is in a respective one of a plurality of scheduling classes; and
a task scheduler, configured to obtain first task assignment information about tasks which are in a first scheduling class from the plurality of scheduling classes and assigned to the plurality of processor cores, obtain second task assignment information about tasks which are in one or more other scheduling classes and assigned to the plurality of processor cores, wherein each of the one or more other scheduling classes is different from the first scheduling class, and refer to the first task assignment information and the second task assignment information to assign a runnable task in the first scheduling class to one of the plurality of processor cores,
wherein prior to the assigning the runnable task in the first scheduling class, the runnable task in the first scheduling class has been assigned to one of the plurality of processor cores.
4. The multi-core processor system of claim 3, wherein the assigning the runnable task in the first scheduling class comprises:
determining whether to reassign the runnable task in the first scheduling class to another processor core of the plurality of processor cores.
US15/817,819 2014-10-02 2017-11-20 Multi-core processor systems and methods for assigning tasks in a multi-core processor system Abandoned US20180074857A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/817,819 US20180074857A1 (en) 2014-10-02 2017-11-20 Multi-core processor systems and methods for assigning tasks in a multi-core processor system

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
US201462058846P 2014-10-02 2014-10-02
US14/799,921 US9852005B2 (en) 2014-10-02 2015-07-15 Multi-core processor systems and methods for assigning tasks in a multi-core processor system
US15/817,819 US20180074857A1 (en) 2014-10-02 2017-11-20 Multi-core processor systems and methods for assigning tasks in a multi-core processor system

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US14/799,921 Continuation US9852005B2 (en) 2014-10-02 2015-07-15 Multi-core processor systems and methods for assigning tasks in a multi-core processor system

Publications (1)

Publication Number Publication Date
US20180074857A1 true US20180074857A1 (en) 2018-03-15

Family

ID=55632888

Family Applications (2)

Application Number Title Priority Date Filing Date
US14/799,921 Active US9852005B2 (en) 2014-10-02 2015-07-15 Multi-core processor systems and methods for assigning tasks in a multi-core processor system
US15/817,819 Abandoned US20180074857A1 (en) 2014-10-02 2017-11-20 Multi-core processor systems and methods for assigning tasks in a multi-core processor system

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US14/799,921 Active US9852005B2 (en) 2014-10-02 2015-07-15 Multi-core processor systems and methods for assigning tasks in a multi-core processor system

Country Status (2)

Country Link
US (2) US9852005B2 (en)
CN (1) CN105487919A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11281502B2 (en) 2020-02-22 2022-03-22 International Business Machines Corporation Dispatching tasks on processors based on memory access efficiency
CN114691326A (en) * 2022-03-16 2022-07-01 中国船舶重工集团公司第七一一研究所 Multi-task scheduling method, multi-core processor and machine-side monitoring system

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ITUA20161426A1 (en) * 2016-03-07 2017-09-07 Ibm Dispatch of jobs for parallel execution of multiple processors
CN106775828B (en) * 2016-11-25 2020-07-03 Oppo广东移动通信有限公司 Application program installation method and device and computer equipment
US10620993B2 (en) 2017-02-27 2020-04-14 International Business Machines Corporation Automated generation of scheduling algorithms based on task relevance assessment
US11461069B2 (en) * 2017-09-29 2022-10-04 Knowles Electronics, Llc. Multi-core audio processor with deadline scheduler
KR102563648B1 (en) * 2018-06-05 2023-08-04 삼성전자주식회사 Multi-processor system and method of operating the same
KR102638531B1 (en) * 2018-11-15 2024-02-19 삼성전자주식회사 Computing device and method for operating computing device
CN110262839B (en) * 2019-06-17 2021-08-31 腾讯科技(深圳)有限公司 Scheduling method and device of processor and storage medium
CN112181517A (en) * 2020-09-24 2021-01-05 北京达佳互联信息技术有限公司 Starting method, device, equipment and medium of application software
KR102441045B1 (en) * 2020-12-14 2022-09-05 현대오토에버 주식회사 Method carried out in electronic control unit of the multi-core structure, and apparatus implementing the same method
CN114168352B (en) * 2021-12-30 2022-11-11 科东(广州)软件科技有限公司 Multi-core task scheduling method and device, electronic equipment and storage medium
CN115098240B (en) * 2022-07-25 2022-11-15 中诚华隆计算机技术有限公司 Multiprocessor application scheduling method and system and storage medium
CN115981819B (en) * 2022-12-30 2023-10-24 摩尔线程智能科技(北京)有限责任公司 Core scheduling method and device for multi-core system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8276142B2 (en) * 2009-10-09 2012-09-25 Intel Corporation Hardware support for thread scheduling on multi-core processors
EP2707796A4 (en) * 2011-05-13 2016-06-08 Samsung Electronics Co Ltd Method and apparatus for improving application processing speed in digital device
EP2793133B1 (en) * 2011-12-13 2019-09-25 Toyota Jidosha Kabushiki Kaisha Multi-core processor
KR101733117B1 (en) * 2012-01-31 2017-05-25 한국전자통신연구원 Task distribution method on multicore system and apparatus thereof
KR101834195B1 (en) * 2012-03-15 2018-04-13 삼성전자주식회사 System and Method for Balancing Load on Multi-core Architecture
US8943252B2 (en) * 2012-08-16 2015-01-27 Microsoft Corporation Latency sensitive software interrupt and thread scheduling
US9336057B2 (en) * 2012-12-21 2016-05-10 Microsoft Technology Licensing, Llc Assigning jobs to heterogeneous processing modules

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11281502B2 (en) 2020-02-22 2022-03-22 International Business Machines Corporation Dispatching tasks on processors based on memory access efficiency
CN114691326A (en) * 2022-03-16 2022-07-01 中国船舶重工集团公司第七一一研究所 Multi-task scheduling method, multi-core processor and machine-side monitoring system

Also Published As

Publication number Publication date
US9852005B2 (en) 2017-12-26
US20160098300A1 (en) 2016-04-07
CN105487919A (en) 2016-04-13

Similar Documents

Publication Publication Date Title
US20180074857A1 (en) Multi-core processor systems and methods for assigning tasks in a multi-core processor system
Goel et al. A comparative study of cpu scheduling algorithms
KR101666395B1 (en) Priority based RTOS task scheduling method in multicore environment
US8875151B2 (en) Load balancing method and apparatus in symmetric multi-processor system
US8924977B2 (en) Sequential cooperation between map and reduce phases to improve data locality
US9959142B2 (en) Dynamic task scheduling method for dispatching sub-tasks to computing devices of heterogeneous computing system and related computer readable medium
US20150347192A1 (en) Method and system for scheduling threads for execution
US8875146B2 (en) Systems and methods for bounding processing times on multiple processing units
KR101350755B1 (en) Cost Based Scheduling Algorithm for Multiple Workflow in Cloud Computing and System of The Same
Kang et al. Lalarand: Flexible layer-by-layer cpu/gpu scheduling for real-time dnn tasks
US9104491B2 (en) Batch scheduler management of speculative and non-speculative tasks based on conditions of tasks and compute resources
US10120721B2 (en) Pluggable engine for application specific schedule control
US20210200704A1 (en) Input/output command rebalancing in a virtualized computer system
US10379906B2 (en) Method and apparatus for system call command batch processing
US20200167191A1 (en) Laxity-aware, dynamic priority variation at a processor
Singh et al. Analysis and comparison of CPU scheduling algorithms
CN108958944A (en) A kind of multiple core processing system and its method for allocating tasks
US9632845B2 (en) Non-preemption of a group of interchangeable tasks in a computing device
US20150100964A1 (en) Apparatus and method for managing migration of tasks between cores based on scheduling policy
US9424078B2 (en) Managing high performance computing resources using job preemption
WO2017020762A1 (en) Apparatus, method, and computer program for utilizing secondary threads to assist primary threads in performing application tasks
Saroj et al. A novel CPU scheduling with variable time quantum based on mean difference of burst time
CN111143210A (en) Test task scheduling method and system
US20140047454A1 (en) Load balancing in an sap system
US11403138B2 (en) Method and electronic device for handling relative priority based scheduling procedure

Legal Events

Date Code Title Description
AS Assignment

Owner name: MEDIATEK INC., TAIWAN

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:CHANG, YA-TING;CHEN, YU-TING;LIN, YU-MING;AND OTHERS;REEL/FRAME:044178/0970

Effective date: 20150714

STPP Information on status: patent application and granting procedure in general

Free format text: DOCKETED NEW CASE - READY FOR EXAMINATION

STPP Information on status: patent application and granting procedure in general

Free format text: NON FINAL ACTION MAILED

STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION