• No results found

4.3 Extending to n-core Platform

5.1.1 Model and Analysis

Although the aim of the semi-partitioned model is to allow all tasks to remain schedulable, it is unwise to fail the schedulability test due to guaranteeing the execution of the lowest criticality level tasks when the system is in a high critical- ity level. So it is essential to redefine the criticality level to be assured of in the semi-partitioned model for a multi-core platform. A reasonable suggestion is to try to save all of the tasks that have one criticality level lower than the criticality level of the system. Consider a dual-core three-criticality system, based on the dual-core two-criticality system explored in Chapter 3, we may get the following scenarios:

• Both cores are in LO-crit mode, all of the tasks remain schedulable. • Core c1 enters MID-crit mode while core c2 remains in LO-crit mode,

migratable LO-crit tasks on core c1 migrate to core c2. All of the tasks

• Core c2 enters MID-crit mode while core c1 remains in MID-crit mode, all

LO-crit tasks on core c2 are abandoned. All of the MID-crit and HI-crit

tasks remain schedulable.

• Core c1 enters HI-crit mode while core c2 remains in MID-crit mode, mi-

gratable MID-crit tasks on core c1 migrate to core c2 while LO-crit tasks

on core c1 are abandoned. All of the MID-crit and HI-crit tasks remain

schedulable.

• Core c2 enters HI-crit mode while core c1 remains in HI-crit mode, all

MID-crit tasks on core c2 are abandoned. All of the HI-crit tasks remain

schedulable.

Based on the above scenarios, the criticality level to be assured of mainly depends on the highest criticality of the system, while the boundary number still plays an important role upon determining the criticality level to be guaranteed execution in the system. In detail, if the number of the cores in the current highest criticality level L is smaller than or equal to the boundary number, then all of the tasks with criticality levels larger than or equal to L − 1 can be saved. Otherwise, only tasks with criticality levels larger than or equal to L can be guaranteed to be schedulable.

However, the above scenarios only consider the situation that the criticality level of the system increases gradually, while the model allows the criticality level to increase directly. Again take the dual-core three-criticality system as an example, core c1 may mode change directly from LO-crit to HI-crit. In such

a situation, core c1 needs to guarantee the execution of HI-crit tasks, so that

migratable MID-crit tasks need to migrate to core c2 and all LO-crit tasks need

to be abandoned. In addition, since core c1 is in HI-crit mode, all of the MID-crit

tasks, including the tasks migrating away, are executing with their MID-crit budgets. As only one core is in HI-crit mode, the system is required to guarantee the execution of all MID-crit tasks. Thus, in order to guarantee the execution of the MID-crit tasks on core c2, c2 is therefore forced to enter MID-crit mode

state from the original mode change state, we name such a mode as MID’-crit. According to that, in semi-partitioned multi-level MCS, criticality level increase on one core may lead to system mode changes on other cores.

In all, the general model for multi-level semi-partitioned model may be viewed as following:

• All cores execute in criticality level 0, and the global state is set to be 0. • If one core enters level i and the global state is lower than i, then the global

state is set to i. The tasks with criticality levels lower than i − 1 on the core will be abandoned, a proportion of the tasks with criticality level of i − 1 will stay on the core while others will migrate to other cores, the tasks with criticality levels higher than i − 1 will stay on the core.

• If one core enters level i, the global state is i, and the number of the cores in level i is smaller than the boundary number, then the global state is unchanged, the tasks with criticality levels lower than i − 1 on the core will be abandoned, the migratable tasks with criticality level of i − 1 will migrate to available cores while the other tasks with criticality level of i − 1 will stay executing on the core, and the tasks with criticality levels higher than i − 1 will also stay executing on the core.

• If one core enters level i, the global state is i, and the number of the cores in level i is equal to or larger than the boundary number, then the global state is unchanged, the tasks with criticality levels lower than i − 1 on the core will be abandoned, the migratable tasks with criticality level of i − 1 will be abandoned while the other tasks with criticality level of i − 1 will stay executing on the core, and the tasks with criticality levels higher than i − 1 will also stay executing on the core.

• If one core enters level i and the global state is higher than i, then the global state is unchanged, and the tasks with criticality levels lower than i on the core will be abandoned, while the tasks with criticality levels equal to or higher than i will also stay executing on the core.