• No results found

7.4

Resource Sharing

In the previous section, the scheduling approaches for multiprocessors have been discussed in detail where the tasks are independent from each other. In this section resource access protocol will be discussed for both partitioned and global approaches in order to allow accesses to shared resources by the tasks.

In 1988, a multiprocessor variant of the priority ceiling protocol named MPCP has been introduced by Rajkumar et al. [46], which is applicable with the fixed priority scheduling algorithms of partitioned approaches. The global shared resources receive a priority ceiling values that are strictly higher than those of any other tasks in the system. When a task tries to acquire a global resource that is currently locked by any other task then the requested task is blocked and waits in a priority queue for the maintenance of blocked tasks on that resource. As a result, the lower priority local tasks can continue execution. At the time of global resource being released, a task will be taken from the head of the queue waiting to acquire this resource, will have the lock on the resource and resume with the ceiling priority of the re- source. MPCP restricts nested access to the globally shared resources, i.e. local and global critical section nesting is not allowed. A bounded blocking time and a sufficient schedulability test is provided by MPCP, the schedulability test is based on utilization bound provided by Liu and Layland [38] [22].

Another multiprocessor variant of priority ceiling protocol named MDPCP has been described by Chen et al. [20]. A sufficient schedulability analysis for Partitioned EDF with MDPCP resource access protocol is provided by them for a multiprocessor system [20].

A multiprocessor resource access protocol MSRP has been introduced by Gai et al., which is based on the stack resource protocol for uni-processor resource access proto- col. MSRP can be used with either fixed priority scheduling algorithms or EDF for partitioned systems. The significant difference between MPCP and MSRP is that when a resource is blocked on a global resource in MSRP, it busy-waits and becomes non-preemptive which is known as spin-lock. A FIFO queue is used for each global resource in order to store the blocked task on this resource so that the correct task resumes when the resource is released. In MSRP, the spin-lock wastes processing time just by making the processor idle which can be used by other tasks [22]. Devi et al. [26] proposed two simple methods for short non-nested access to shared data structures by considering the problems of accessing shared resources under global EDF, a scheduling approach for global multiprocessor scheduling. The meth- ods are spin-based queue lock and lock free synchronization [22].

Block et al. [14] introduced a multiprocessor resource access protocol which is known as flexible multiprocessor locking protocol abbreviated as FMLP. FMLP can be used with both partitioned and global scheduling algorithms. A variant of both parti- tioned EDF and global EDF is necessary to use FMLP which is discussed in detail in section 8.3.2 on page 69.

8

|

Multiprocessor Scheduling Poli-

cies

In chapter-7, the general concepts for scheduling on multiprocessor systems have been discussed. In this section, a few scheduling algorithms both from partitioned and global approach will be discussed in detail.

The existing simulation software developed by Munk [41] supports multi-core schedul- ing algorithms along with single-core scheduling algorithms. He explained how to add a new scheduler to the SAVORS system [41, sec. 8.11]. New scheduling poli- cies and resource access protocols can be added to the existing installation of the software as an additional plug-in. All newly implemented multi-core scheduling al- gorithms were added to the de.unistuttgart.iste.ps.savors.scheduler.mul- ticore plug-in. A multi-core scheduling algorithm will be available to the software after adding it to the plug-in extension.

This simulation software supports only homogeneous multiprocessor systems, de- fined in Chapter-2 [41]. The simulation software does not support task parallelism, meaning a task cannot run on more than one processors at a time [41]. Therefore, the newly implemented multi-core algorithms only work for homogeneous multipro- cessor systems without task parallelism.

8.1

Partitioned Earliest Deadline First

In the Partitioned EDF multiprocessor scheduling algorithm the task-set needs to be divided into smaller disjoint sets of tasks. There are several heuristic methods for this partitioning process. Once the task-set is partitioned, on each processor each task set will be scheduled by a uni-processor scheduling algorithm Earliest Deadline

First.

Therefore, the multiprocessor scheduling problem under partitioned approach can be divided into solving two different parts: partition the task set into m subsets of tasks, so that each subset is schedulable where m is number of processors, and run a uni- processor scheduler for each core. In this case the uni-processor scheduling algorithm is EDF. Several polynomial time heuristics are present to partition the task set on

multiprocessor systems based on bin-packing approaches which are known to be NP-hard in the strong sense [21, 27]. Three of them are going to be described here in brief, details with the algorithms can be found in [55, section 2.1.2]

Heuristic Methods for Task Partitioning

Next Fit: this method maintains an ordering among the processors and assigns tasks to each processor. Since many tasks can be assigned on that processor in such a way, the partition is schedulable using a desirable single core scheduling algorithm. The detailed procedure can be found in [55, figure 2.3]

First Fit: the next fit method is achieved by considering that a task will be as- signed to the first available processor to which it fits and is known as first fit, described in [55, figure 2.4].

Best Fit: in this method, each task is assigned to a processor that the assigned task can fit on and the remaining unused processing capacity is minimized. Srinivasan [55] described this method in section 2.4 with EDF as uni-processor scheduling algorithm.

The next fit partitioning method has a time complexity of O(n) times the uni- processor schedulability analysis, whereas the first fit and best fit partitioning meth- ods have the time complexity of O(mn) times the uni-processor schedulability anal- ysis time.

In P-EDF, when the task set partitioning has been done, a uni-processor dynamic priority scheduling algorithm EDF will be used to schedule the task sets assigned to that core.