TIME-VARIANT SCHEDULING OF AFFINITY GROUPS ON A MULTI-CORE PROCESSOR
Methods and systems for scheduling applications on a multi-core processor are disclosed, which may be based on association of processor cores, application execution environments, and authorizations that permits efficient and practical means to utilize the simultaneous execution capabilities provided by multi-core processors. The algorithm may support definition and scheduling of variable associations between cores and applications (i.e., multiple associations can be defined so that the cores an application is scheduled on can vary over time as well as what other applications are also assigned to the same cores as part of an association). The algorithm may include specification and control of scheduling activities, permitting preservation of some execution capabilities of a multi-core processor for future growth, and permitting further evaluation of application requirements against the allocated execution capabilities.
Latest Green Hills Software, Inc Patents:
- Systems and methods for summarization and visualization of trace data
- Systems and Methods for Summarization and Visualization of Trace Data
- Systems and Methods for Summarization and Visualization of Trace Data
- Systems and methods for summarization and visualization of trace data
- Systems and Methods for Summarization and Visualization of Trace Data
This application is a continuation of U.S. patent application Ser. No. 14/880,447, entitled “TIME-VARIANT SCHEDULING OF AFFINITY GROUPS ON A MULTI-CORE PROCESSOR” and filed Oct. 12, 2015; which is a continuation of U.S. patent application Ser. No. 13/462,119, entitled “SYSTEM AND METHOD FOR TIME VARIANT SCHEDULING OF AFFINITY GROUPS COMPRISING PROCESSOR CORE AND ADDRESS SPACES ON A SYNCHRONIZED MULTICORE PROCESSOR” and filed May 2, 2012, now U.S. Pat. No. 9,158,592; which claims priority to U.S. Application No. 61/481,675, entitled “TIME-VARIANT SCHEDULING OF AFFINITY GROUPS ON A MULTI-CORE PROCESSOR”, and filed May 2, 2011. The entirety of each of the foregoing patents and patent applications is incorporated by reference herein.
BACKGROUND OF THE DISCLOSURE 1. Field of the DisclosureThe disclosure relates generally to methods for scheduling applications on a multi-core processor.
2. General BackgroundThe advent of faster and more capable processors has resulted in the development of operating systems features that permit previously independent applications running on completely independent processors to be ported to an operating environment where the independent applications share a processor. Separation and scheduling mechanisms have been defined and fielded that support simultaneous hosting of multiple applications on a single-core processor. Previous scheduling mechanisms have included priority based schedulers, time-partitioning schedulers, cooperative schedulers, and many other schedulers, including schedulers that combine techniques. Each scheduling mechanism has capabilities that are beneficial to some uses but include tradeoffs for other uses.
Additional processor capabilities in terms of supporting multiple computing cores (i.e., multi-core) within a single processor, are increasingly becoming standard, with more cores seemingly being integrated with each passing revision. A multi-core processor is an integrated electronic device that contains two or more independent processing elements (i.e., cores, with or without dedicated caches) on which execution sequences can simultaneously execute. These cores are interconnected with each other and the remaining system resources (e.g., data memory, program memory, hardware devices) through hardware capabilities provided by the multi-core processor. The composite execution capabilities of the multi-core platform should mean that there is sufficient bandwidth to add new applications (or extend existing applications) in the future, provided the scheduling mechanism includes sufficient support to preserve unallocated processor core resources and sufficient granularity to allocate those resources, independent of which core contains unallocated resources.
Several general multi-core usage paradigms have been developed, including: (1) Asymmetric Multi Processing (AMP), where each core runs a completely independent executable; (2) Symmetric Multi Processing (SMP), where an executable is designed to make use of multiple cores simultaneously; (3) Combinations of both (some cores used for AMP, other cores used for SMP).
The rigidness of these usage paradigms is highlighted when additional applications are attempted to be added to a multi-core processor based platform. A typical implementation, during initialization, may associate a core or set of cores with an application or group of applications. For example, elemental associations (processor sets) used for scheduling may be defined, such that there may be an association of processor cores within the processor sets. However, processor cores in such applications are not shared between processor sets. While any unallocated core can be utilized for new applications (or to extend an existing application), a new application cannot be defined that utilizes spare capacity on cores assigned to different processor sets. Other implementations may not associate cores with any application. For example, elemental associations (scheduling domains) used for scheduling may be defined, such that there is intentionally no association of a processor core within the scheduling domain. As such, in such implementations, preservation of core resources is not enforced (e.g., all available processor core capabilities may be utilized, including capabilities intended to be preserved for future use or capabilities not intentionally used due to application programming errors).
Accordingly, it is desirable to address the limitations in the art.
SUMMARYMethods and systems relating to scheduling applications on a multi-core processor are disclosed. Since any single core may provide more execution capabilities than any single application requires and some of these applications may be designed to utilize multiple cores simultaneously (including utilizing different numbers of cores at various times during execution), a new scheduling method that efficiently and practically utilizes multi-core processors is necessary. In one embodiment, this method, time-variant scheduling, defines scheduling for groupings of how cores will be utilized by one or more applications, with the grouping of cores and applications being permitted to vary over time. One component of time-variant scheduling is the forming of association of cores and applications into groupings, referred to as affinity groups. Affinity groups can be formed to define any association of cores and applications, but typically are formed to correspond to some intended function (or functions). When an affinity group is selected for scheduling on a core (or set of cores), its associated address-spaces are exclusively scheduled on the associated cores (i.e., all other address-spaces are excluded from using the allocated cores). The affinity groups are scheduled independently of other affinity groups, permitting sequences that closely correspond to application requirements, yet also permitting other affinity groups to be developed that can make use of cores that are not being utilized or fully utilized. Any new application (or extension of an existing application) can make use of the unallocated execution time across the entire multi-core processor. Other aspects and advantages of various aspects of the present invention can be seen upon review of the figures and of the detailed description that follows.
In certain embodiments, a method for scheduling applications on a multi-core processor comprising a plurality of processor cores is disclosed, the method comprising: associating a first at least one processor core and a first plurality of address spaces with a first affinity group; associating a second at least one processor core and a second plurality of address spaces with a second affinity group; and scheduling one or more of the first affinity group and the second affinity group to execute on associated cores of the multi-core processor, wherein the step of scheduling further comprises: releasing a first processor core for scheduling; synchronizing the plurality of processor cores; processing a scheduling event for the first processor core; associating the first processor core with the affinity group associated with the scheduling event; and assigning a plurality of address spaces to the first processor core for the scheduling event. The scheduling event may comprise task-core affinity for at least one task. At least one task-core affinity may be designated to be changeable at run-time. A task-core affinity may be designated not to be changeable at run-time. The method may further comprise synchronizing the first core with any of the plurality of processor cores associated with the scheduling event. The method may further comprise synchronizing the first core with at least one of the plurality of processor cores associated with the affinity group associated with the scheduling event. The step of scheduling may further comprise scheduling at least one of the first one or more processor cores according to a predefined sequence of affinity groups. The step of processing the scheduling event may comprise selecting an affinity group for which all of the associated cores are available and none of the associated address spaces are currently running on another core.
In certain embodiments, a method for scheduling applications on a multi-core processor comprising a plurality of processor cores is disclosed, the method comprising: associating a first at least one processor core and a first plurality of address spaces with a first affinity group; associating a second at least one processor core and a second plurality of address spaces with a second affinity group; and scheduling one or more of the first affinity group and the second affinity group to execute on associated cores of the multi-core processor. The first affinity group may comprise at least one dependency group comprising a plurality of address spaces that share at least one resource. The method may further comprise scheduling a plurality of address spaces associated with at least one dependency group. The second at least one affinity group may comprise at least one of the at least one dependency group. Only applications associated with the first plurality of address spaces may be eligible to be scheduled on the first at least one processor core when the first affinity group is being executed. At least one of the first plurality of address spaces may be a primary address space eligible to run on any of the first at least one processor core. At least one of the first plurality of address spaces may be a restart address space eligible to restart on any of the first at least one processor core. At least one of the first plurality of address spaces may be a background address space eligible to run in the background on any of the first at least one processor core. The step of scheduling a background address space may further comprise scheduling based on a priority less than a predetermined threshold. The step of scheduling may further comprise activating one of a plurality of schedules for at least one of the associated cores. The step of scheduling may comprise scheduling the first affinity group and the second affinity group to execute simultaneously on one or more cores of the multi-core processor. The step of scheduling may further comprise scheduling at least one of the first one or more processor cores according to a predefined sequence of affinity groups. The first plurality of address spaces may comprise at least one address space in the second plurality of address spaces. The first at least one affinity group may comprise at least one address space in the second at least one affinity group. The method may further comprise scheduling a task to run on a processor core according to a task-core affinity for the task. The method may further comprise scheduling a task to run on a processor core according to a task-core affinity if the task has an affinity for a processor core associated with the affinity group scheduled for execution. The method may further comprise not scheduling a task for execution with an affinity group if the task has an affinity for a processor core that is not associated with the affinity group. The step of scheduling may further comprise: releasing a first address space for scheduling; synchronizing the plurality of processor cores; processing a scheduling event for the first address space; and assigning the first address space to a processor core for the scheduling event.
In certain embodiments, a method for scheduling applications on a multi-core processor comprising a plurality of processor cores is disclosed, the method comprising: associating a first at least one affinity group with a first subsystem; associating a second at least one affinity group with a second subsystem; wherein the first at least one affinity group has no cores in common and no address spaces in common with the second at least one affinity group, whereby the first subsystem can be scheduled independently of the second subsystem.
In certain embodiments, a system for scheduling applications on a multi-core processor is disclosed, comprising: a plurality of affinity groups each comprising one or more processor cores and a plurality of address spaces; and a scheduler configured for assigning one or more of the plurality of affinity groups to execute on associated cores of the multi-core processor, wherein the scheduler is further configured for: releasing a first processor core for scheduling; synchronizing the plurality of processor cores; processing a scheduling event for the first processor core; associating the first processor core with an affinity group associated with the scheduling event; and assigning a plurality of address spaces to the first processor core for the scheduling event. The scheduling event may comprise task-core affinity for at least one task. At least one task-core affinity may be designated to be changeable at run-time. A task-core affinity may be designated not to be changeable at run-time. The scheduler may be further configured for synchronizing the first core with any of the plurality of processor cores associated with the scheduling event. The scheduler may be further configured for synchronizing the first processor core with at least one of the processor cores associated with the affinity group associated with the scheduling event. The scheduler may be further configured for scheduling at least one processor core according to a predefined sequence of affinity groups. The scheduler may be further configured for selecting an affinity group for which all of the associated cores are available and none of the associated address spaces are currently running on another core.
In certain embodiments, a system for scheduling applications on a multi-core processor is disclosed, comprising: a plurality of affinity groups each comprising one or more processor cores and a plurality of address spaces; and a scheduler configured for assigning one or more of the plurality of affinity groups to execute on associated cores of the multi-core processor. Only applications associated with the address spaces assigned to an affinity group may be eligible to be assigned to the processor cores assigned to the affinity group scheduled for execution. At least one of the plurality of affinity groups may comprise at least one dependency group comprising a plurality of address spaces that share at least one resource. The scheduler may be further configured for scheduling a plurality of address spaces associated with at least one dependency group. At least two of the plurality of affinity groups may share a dependency group. The scheduler may be further configured for activating one of a plurality of schedules for at least one of the associated cores. The scheduler may be further configured for scheduling a task to run on a processor core according to a task-core affinity for the task. The scheduler may be configured to schedule a task to run on a processor core according to a task-core affinity if the task has an affinity for a processor core associated with the affinity group scheduled for execution. The scheduler may be configured not to schedule a task for execution with an affinity group if the task has an affinity for a processor core that is not associated with the affinity group. Each of the affinity groups may have no processor cores and no address spaces in common with any of the other of the plurality of affinity groups, to permit each of the plurality of affinity groups to be scheduled independently. The scheduler may be further configured for scheduling a first affinity group and a second affinity group to execute simultaneously. The scheduler may be further configured for scheduling at least one processor core according to a predefined sequence of affinity groups. The first plurality of address spaces may comprise at least one address space in the second plurality of address spaces. The first at least one affinity group may comprise at least one address space in the second at least one affinity group. The scheduler may be further configured to propagate timing events of the first processor core to at most, the plurality of processor cores associated with the scheduling event. The scheduler may be further configured for: releasing a first address space for scheduling; synchronizing the plurality of processor cores; processing a scheduling event for the first address space; and assigning the first address space to a processor core for the scheduling event.
In certain embodiments, a system for scheduling applications on a multi-core processor is disclosed, comprising: a plurality of subsystems each comprising one or more affinity groups, wherein each of one or more affinity groups comprises one or more processor cores and a plurality of address spaces; and a scheduler configured for assigning one or more of the plurality of affinity groups to execute on associated cores of the multi-core processor; wherein each of the subsystems has no processor cores and no address spaces in common with any of the other of the plurality of subsystems, to permit each of the plurality of subsystems to be scheduled independently.
By way of example, reference will now be made to the accompanying drawings, which are not to scale.
Those of ordinary skill in the art will realize that the following description of the present invention is illustrative only and not in any way limiting. Other embodiments of the invention will readily suggest themselves to such skilled persons, having the benefit of this disclosure. Reference will now be made in detail to specific implementations of the present invention as illustrated in the accompanying drawings. The same reference numbers will be used throughout the drawings and the following description to refer to the same or like parts.
Further, certain figures in this specification are flow charts illustrating methods and systems. It will be understood that each block of these flow charts, and combinations of blocks in these flow charts, may be implemented by computer program instructions. These computer program instructions may be loaded onto a computer or other programmable apparatus to produce a machine, such that the instructions which execute on the computer or other programmable apparatus create structures for implementing the functions specified in the flow chart block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction structures which implement the function specified in the flow chart block or blocks. The computer program instructions may also be loaded onto a computer or other programmable apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow chart block or blocks.
Accordingly, blocks of the flow charts support combinations of structures for performing the specified functions and combinations of steps for performing the specified functions. It will also be understood that each block of the flow charts, and combinations of blocks in the flow charts, can be implemented by special purpose hardware-based computer systems which perform the specified functions or steps, or combinations of special purpose hardware and computer instructions.
For example, any number of computer programming languages, such as C, C++, C# (CSharp), Perl, Ada, Python, Pascal, SmallTalk, FORTRAN, assembly language, and the like, may be used to implement aspects of the present invention. Further, various programming approaches such as procedural, object-oriented or artificial intelligence techniques may be employed, depending on the requirements of each particular implementation. Compiler programs and/or virtual machine programs executed by computer systems generally translate higher level programming languages to generate sets of machine instructions that may be executed by one or more processors to perform a programmed function or set of functions.
The term “machine-readable medium” should be understood to include any structure that participates in providing data which may be read by an element of a computer system. Such a medium may take many forms, including but not limited to, non-volatile media, volatile media, and transmission media. Non-volatile media include, for example, optical or magnetic disks and other persistent memory. Volatile media include dynamic random access memory (DRAM) and/or static random access memory (SRAM). Transmission media include cables, wires, and fibers, including the wires that comprise a system bus coupled to processor. Common forms of machine-readable media include, for example, a floppy disk, a flexible disk, a hard disk, a magnetic tape, any other magnetic medium, a CD-ROM, a DVD, any other optical medium.
In certain embodiments, a receiver 120 may include any suitable form of multimedia playback device, including, without limitation, a cable or satellite television set-top box, a DVD player, a digital video recorder (DVR), or a digital audio/video stream receiver, decoder, and player. A receiver 120 may connect to network 130 via wired and/or wireless connections, and thereby communicate or become coupled with content server 110, either directly or indirectly. Alternatively, receiver 120 may be associated with content server 110 through any suitable tangible computer-readable media or data storage device (such as a disk drive, CD-ROM, DVD, or the like), data stream, file, or communication channel.
Network 130 may include one or more networks of any type, including a Public Land Mobile Network (PLMN), a telephone network (e.g., a Public Switched Telephone Network (PSTN) and/or a wireless network), a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), an Internet Protocol Multimedia Subsystem (IMS) network, a private network, the Internet, an intranet, and/or another type of suitable network, depending on the requirements of each particular implementation.
One or more components of networked environment 100 may perform one or more of the tasks described as being performed by one or more other components of networked environment 100.
Processor 205 may include any type of conventional processor, microprocessor, or processing logic that interprets and executes instructions. The processor 205 may be capable of interpreting and executing multiple sequences of instructions substantially simultaneously. Main memory 210 may include a random-access memory (RAM) or another type of dynamic storage device that stores information and instructions for execution by processor 205. ROM 215 may include a conventional ROM device or another type of static storage device that stores static information and instructions for use by processor 205. Storage device 220 may include a magnetic and/or optical recording medium and its corresponding drive.
Input device(s) 225 may include one or more conventional mechanisms that permit a user to input information to computing device 200, such as a keyboard, a mouse, a pen, a stylus, handwriting recognition, voice recognition, biometric mechanisms, and the like. Output device(s) 230 may include one or more conventional mechanisms that output information to the user, including a display, a projector, an A/V receiver, a printer, a speaker, and the like. Communication interface 235 may include any transceiver-like mechanism that enables computing device/server 200 to communicate with other devices and/or systems. For example, communication interface 235 may include mechanisms for communicating with another device or system via a network, such as network 130 as shown in
As will be described in detail below, computing device 200 may perform operations based on software instructions that may be read into memory 210 from another computer-readable medium, such as data storage device 220, or from another device via communication interface 235. The software instructions contained in memory 210 cause processor 205 to perform processes that will be described later. Alternatively, hardwired circuitry may be used in place of or in combination with software instructions to implement processes consistent with the present invention. Thus, various implementations are not limited to any specific combination of hardware circuitry and software.
A web browser comprising a web browser user interface may be used to display information (such as textual and graphical information) on the computing device 200. The web browser may comprise any type of visual display capable of displaying information received via the network 130 shown in
The browser and/or the browser assistant may act as an intermediary between the user and the computing device 200 and/or the network 130. For example, source data or other information received from devices connected to the network 130 may be output via the browser. Also, both the browser and the browser assistant are capable of performing operations on the received source information prior to outputting the source information. Further, the browser and/or the browser assistant may receive user input and transmit the inputted data to devices connected to network 130.
Similarly, certain embodiments of the present invention described herein are discussed in the context of the global data communication network commonly referred to as the Internet. Those skilled in the art will realize that embodiments of the present invention may use any other suitable data communication network, including without limitation direct point-to-point data communication systems, dial-up networks, personal or corporate Intranets, proprietary networks, or combinations of any of these with or without connections to the Internet.
In the following description, a preferred embodiment of the method is described in terms of preferred data structures, preferred and optional enforcements, preferred control flows, and examples. Other and further application of the described method, as would be understood after review of this application by those with ordinary skill in the art, are within the scope of the invention.
The following terminology and meanings are used to describe embodiments of the invention. These terms are not intended to be limiting.
Core—In a multi-core processor, a “core” represents the independent hardware processing element on which applications will execute. An N-core processor means that there are N independent hardware processing elements that can simultaneously execute at any instance of time.
Address-Space—An “address-space” is an operating system managed association that defines the operational environment in which an application will be executed. An address-space includes memory and device resources; an abstracted (or actual) range of memory addresses to which the memory and device resources may be assigned; one or more execution contexts; and a set of operating system interfaces. Address-spaces are further refined by the degree of processor access authorized by associated core privileges. A“virtual” address-space executes in a core's least privileged operating environment (e.g., user mode). A“kernel” address-space executes in a core's more privileged operating environment (e.g., kernel mode, hypervisor mode, supervisor mode, etc.), including authorizations that permit execution in a core's most privileged operating environment (e.g., same mode as the operating system). One of ordinary skill in the art will recognize that other privilege levels are also within the scope of this the invention. An address-space can be scheduled as either Primary, Background or Restart or combinations thereof.
Primary Address Space—A“primary address space” is an address-space assigned to one or more cores, via an affinity group grouping, where some or all tasks from the address-space may be run.
Background Address Space—A“background address space” is an address-space assigned to one or more cores on which tasks from the address space may run in the background based on assigned priorities or other Task scheduling means. Tasks may be assigned to a background address space and may be run on any of the cores allocated to the affinity group to which the background address space is assigned.
Restart Address Space—A“restart address space” is an address-space assigned to one or more cores where the address space can be rescheduled/restarted. A restart address space can be restarted on any of the cores allocated to the affinity group to which the restart address space is assigned. Scheduling of a restart address space may be utilizing portions of an assigned time window or may be dynamically utilizing portions of unassigned time windows.
Application—An “application” is the executable object code and memory resource assignments designed to perform some intended function on the multi-core platform. Applications may be assigned to one or more address-spaces.
Affinity Group—An “affinity group” is an operating system managed association that includes cores and address-spaces. For this method, affinity groups are the basic element of time scheduling on the multi-core platform. The operating system schedules the multi-core's execution time based on the affinity groups. Multiple affinity groups may be defined.
Task-Core Affinity—A“task-core affinity” is an operating system managed association that associates a task with a particular core such that the task may only be executed by that core. A task-core affinity may be changed at run-time if the particular task-core affinity has been designated to be changeable. If not designated to be changeable, then the task-core affinity cannot be changed at run-time.
Dependency Group—A“dependency group” is an operating system managed association that consists of a group of address-spaces that have some kind of resource in common. Resources can include, but are not limited to, items such as semaphores, information flows, other address spaces or portions thereof, and hardware devices. Not all address-spaces in a dependency group need to share all the same resources.
Schedule—In this method, a “schedule” includes a set of affinity groups designed to be executed on a multi-core processor within a scheduler's time window, and a description on how and when they may be executed. Multiple schedules, with different combinations of affinity groups and execution resources, may be defined. Sub-schedules may be utilized to form a hierarchy of schedules.
Task—A“task” is an operating system managed association that defines a unique execution context being utilized by an application. Each address-space has one or more tasks associated with it. Tasks permit execution parallelism within an application. Tasks may be assigned or inherit priorities that may be used by an operating system to select which task context to assign to a core for execution.
One possible optional enforcement, for illustrative purposes, is illustrated in the control flow diagram 900 included in
In
As shown in
To reduce interference between cores, timing events associated with one affinity group are restricted to affecting, at most, only the processor cores assigned to the affinity group.
Exemplary applications of embodiments of the present invention may include a method for defining affinity groups that consist of an association of processor cores, address-spaces, and authorizations (as shown, for example, in
a. Identification:
-
- i. Identification of one or more unique affinity groups (AG1, AG2, . . . AGN).
- ii. Identification of two or more unique processor cores (C1, C2, . . . CP).
- iii. Identification of one or more unique virtual address-spaces (VAS1, VAS2, . . . VASM).
- iv. Identification of zero or more unique kernel address-spaces (KAS1, KAS2, . . . KASQ).
- v. Identification of zero applications (e.g., no explicit specification of) or more applications (e.g., explicit specification of) that are associated with an address-space.
b. Assignment:
-
- i. Assignment of one or more processor core identifications as members of an affinity group.
- ii. Assignment of zero or more kernel address-space identifications as members of an affinity group.
- iii. Assignment of zero or more virtual address-space identifications as members of an affinity group.
c. Enforcement:
-
- i. Enforcement that each affinity group has at least one processor core assigned to it.
- ii. Enforcement that each affinity group has at least one address-space assigned to it.
Another exemplary application of embodiments of the present invention may include a method for generating schedules for the defined affinity groups (as shown, for example, in
a. Identification:
-
- i. Identification of one or more unique schedules (51, S2, . . . SS).
b. Assignment:
-
- i. Assignment of one or more affinity groups to a schedule.
Another exemplary application of embodiments of the present invention may include a method for enforcing the currently selected schedule on a multi-core processor (as shown, for example, in
-
- a. Selecting of affinity groups to be scheduled from the available affinity groups defined for the currently selected schedule. Such a method may cover selecting affinity groups based on any selection sequence. This may include an optional predefined sequence of affinity groups for the core (
FIG. 4 shows example attributes and associations for a predefined sequence) and sequences (example potential conflicts shown inFIG. 7 ) for which the following principles may be optionally enforced: - i. At any instant of time, a core can be selected to be associated with, at most, one of the available affinity groups.
- ii. At any instant of time, an address-space can be associated with, at most, one of the affinity groups selected to run on a core or set of cores (i.e., if already running on one core or set of cores as part of one affinity group, an address-space cannot run on other cores as part of other affinity groups).
- a. Selecting of affinity groups to be scheduled from the available affinity groups defined for the currently selected schedule. Such a method may cover selecting affinity groups based on any selection sequence. This may include an optional predefined sequence of affinity groups for the core (
b. Scheduling of an affinity group (or affinity groups) associated with the currently selected schedule.
-
- i. When an affinity group (or affinity groups) is active, scheduling of only the assigned address-spaces on the assigned cores.
- A. Only applications associated with the address-spaces assigned to an affinity group are eligible to be executed on the cores assigned to the same affinity group.
- ii. When a currently active affinity group (or affinity groups) completes, the assigned address-spaces are not eligible to be scheduled on the assigned cores as part of the affinity group that completed.
- i. When an affinity group (or affinity groups) is active, scheduling of only the assigned address-spaces on the assigned cores.
c. Isolation of timing events for one affinity group to only affect, at most, the processor cores assigned to the affinity group.
Another exemplary application of embodiments of the present invention may include a method for enforcing the defined schedules on a multi-core processor (as shown, for example, in
a. Selecting a schedule and enforcing the schedule and its associated affinity groups on the multi-core processor.
b. Scheduling of address-spaces on cores which are currently not being utilized for the current schedule.
Affinity Group 4 1140 consists of primary address space AS7 and utilizes cores 1, 2 and 3. Affinity Group 5 1150 consists of primary address space AS8 and also utilizes cores 1, 2 and 3. Affinity Group 6 1160 utilizes cores 1, 2 and 3 but contains no primary address spaces. It defines eight background address spaces (AS1 through AS8) with a Background Max Priority of 15, and one restart address space (AS1). When address spaces are scheduled as background address spaces, they may be scheduled based on their priority and may be bounded by the Background Max Priority. The restart address space (AS1) may restart in any available time during Affinity Group 6′s allotted time. Affinity Group 7 1170 is assigned to core 4 and has four background address spaces (AS1, AS4, AS5 and AS6) and three restart address spaces (AS4, AS5 and AS6). The Background Max Priority is 15. Affinity Group 7 1170 can execute concurrently with Affinity Groups 2, 4, and 5 as they have no address-space or core overlaps.
Task-core affinity may be used to limit tasks to a specific core. If a task-core affinity is set for a particular task, that task will only be able to run on the core specified in the task core affinity. If task-core affinity is set for one or more tasks, the system scheduling may be priority-based preemptive scheduling as allowed by address space and task core affinity. For example,
The methods described can be used to implement many types of processing systems. Two examples of such systems are given in
While the above description contains many specifics and certain exemplary embodiments have been described and shown in the accompanying drawings, it is to be understood that such embodiments are merely illustrative of and not restrictive on the broad invention, and that this invention not be limited to the specific constructions and arrangements shown and described, since various other modifications may occur to those ordinarily skilled in the art, as mentioned above. The invention includes any combination or sub combination of the elements from the different species and/or embodiments disclosed herein.
Claims
1. A method for scheduling applications on a multi-core processor comprising a plurality of processor cores, the method comprising:
- associating a first at least two processor cores and a first plurality of address spaces with a first affinity group;
- associating a second at least one processor core and a second plurality of address spaces with a second affinity group; and
- scheduling one or more of the first affinity group and the second affinity group to execute on associated cores of the multi-core processor.
2. The method of claim 1, wherein the first affinity group comprises at least one dependency group comprising a plurality of address spaces that share at least one resource.
3. The method of claim 2, further comprising scheduling a plurality of address spaces associated with at least one dependency group.
4. The method of claim 2, wherein the second at least one affinity group comprises at least one of the at least one dependency group.
5. The method of claim 1, wherein only applications associated with the first plurality of address spaces are eligible to be scheduled on the first at least one processor core when the first affinity group is being executed.
6. The method of claim 1, wherein at least one of the first plurality of address spaces is a primary address space eligible to run on any of the first at least one processor core.
7. The method of claim 1, wherein at least one of the first plurality of address spaces is a restart address space eligible to restart on any of the first at least one processor core.
8. The method of claim 1, wherein at least one of the first plurality of address spaces is a background address space eligible to run in the background on any of the first at least one processor core.
9. The method of claim 8, wherein the step of scheduling the background address space further comprises scheduling based on a priority less than a predetermined threshold.
10. The method of claim 1, wherein the step of scheduling further comprises activating one of a plurality of schedules for at least one of the associated cores.
11. The method of claim 1, wherein the step of scheduling comprises scheduling the first affinity group and the second affinity group to execute simultaneously on one or more cores of the multi-core processor.
12. The method of claim 1, wherein the first plurality of address spaces comprises at least one address space in the second plurality of address spaces.
13. The method of claim 1, wherein the first at least one affinity group comprises at least one address space in the second at least one affinity group.
14. The method of claim 1, further comprising scheduling a task to run on a processor core according to a task-core affinity for the task.
15. The method of claim 1, further comprising scheduling a task to run on a processor core according to a task-core affinity if the task has an affinity for the processor core associated with the affinity group scheduled for execution.
16. The method of claim 1, further comprising not scheduling a task for execution with an affinity group if the task has an affinity for a processor core that is not associated with the affinity group.
17. The method of claim 1, wherein the step of scheduling further comprises:
- releasing a first address space for scheduling;
- synchronizing the plurality of processor cores;
- processing a scheduling event for the first address space; and
- assigning the first address space to a processor core for the scheduling event.
18. A method for scheduling applications on a multi-core processor comprising a plurality of processor cores, the method comprising:
- associating a first at least one affinity group with a first subsystem;
- associating a second at least one affinity group with a second subsystem;
- wherein the first at least one affinity group has no cores in common and no address spaces in common with the second at least one affinity group, whereby the first subsystem can be scheduled independently of the second subsystem.
19. A system for scheduling applications on a multi-core processor, comprising:
- a plurality of affinity groups each comprising two or more processor cores and a plurality of address spaces; and
- a scheduler configured for assigning one or more of the plurality of affinity groups to execute on associated cores of the multi-core processor.
20. The system of claim 19, wherein only applications associated with the address spaces assigned to an affinity group are eligible to be assigned to the processor cores assigned to the affinity group scheduled for execution.
21. The system of claim 19, wherein at least one of the plurality of affinity groups comprises at least one dependency group comprising a plurality of address spaces that share at least one resource.
22. The system of claim 21, wherein the scheduler is further configured for scheduling a plurality of address spaces associated with at least one dependency group.
23. The system of claim 21, wherein at least two of the plurality of affinity groups share a dependency group.
24. The system of claim 19, wherein the scheduler is further configured for activating one of a plurality of schedules for at least one of the associated cores.
25. The system of claim 19, wherein the scheduler is further configured for scheduling a task to run on a processor core according to a task-core affinity for the task.
26. The system of claim 19, wherein the scheduler is configured to schedule a task to run on a processor core according to a task-core affinity if the task has an affinity for a processor core associated with the affinity group scheduled for execution.
27. The system of claim 19, wherein the scheduler is configured not to schedule a task for execution with an affinity group if the task has an affinity for a processor core that is not associated with the affinity group.
28. The system of claim 19, wherein each of the affinity groups has no processor cores and no address spaces in common with any of the other of the plurality of affinity groups, to permit each of the plurality of affinity groups to be scheduled independently.
29. The system of claim 19, wherein the scheduler is further configured for scheduling a first affinity group and a second affinity group to execute simultaneously.
30. The system of claim 19, wherein the first plurality of address spaces comprises at least one address space in the second plurality of address spaces.
31. The system of claim 19, wherein the first at least one affinity group comprises at least one address space in the second at least one affinity group.
32. The system of claim 19, wherein the scheduler is further configured to propagate timing events of the first processor core to at most, the plurality of processor cores associated with the scheduling event.
33. The system of claim 19, wherein the scheduler is further configured for:
- releasing a first address space for scheduling;
- synchronizing the plurality of processor cores;
- processing a scheduling event for the first address space; and
- assigning the first address space to a processor core for the scheduling event.
34. A system for scheduling applications on a multi-core processor, comprising:
- a plurality of subsystems each comprising one or more affinity groups, wherein each of one or more affinity groups comprises two or more processor cores and a plurality of address spaces; and
- a scheduler configured for assigning one or more of the plurality of affinity groups to execute on associated cores of the multi-core processor;
- wherein each of the subsystems has no processor cores and no address spaces in common with any of the other of the plurality of subsystems, to permit each of the plurality of subsystems to be scheduled independently.
Type: Application
Filed: Aug 18, 2017
Publication Date: Nov 30, 2017
Applicant: Green Hills Software, Inc (Santa Barbara, CA)
Inventors: Mark Anthony Griglock (Oldsmar, FL), Patrick John Huyck (Trinity, FL), Sidney Slay Ishee (Odessa, FL), James Anthony Gleason (Tarpon Springs, FL), Richard Andrew Erich (Palm Harbor, FL), Mathew Lowell Aamold (New Port Richey, FL)
Application Number: 15/681,273