13.07.2015 Views

Rate Monotonic Scheduling Re-analysed - Faculty of Science and ...

Rate Monotonic Scheduling Re-analysed - Faculty of Science and ...

Rate Monotonic Scheduling Re-analysed - Faculty of Science and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

numbers, there is obviously no utilisation factorthat can be equal to m(2 1 m − 1) , except when m = 1(one task) <strong>and</strong> in this case, the task (set) is triviallyschedulable. For a scheduling algorithm in general,we expect that v(m) is not an element <strong>of</strong> u(S 1 )(in other words, u(S 1 ) has no minimum element),which means that a set <strong>of</strong> tasks whose utilisationfactor is equal to v(m) is schedulable. Suppose thisis not true <strong>and</strong> assume an unschedulable task setΓ whose utilisation factor is v(m). We can reducethe execution time <strong>of</strong> one task <strong>of</strong> Γ by a very smallamount, <strong>and</strong> the new task set is still unschedulable.The utilisation factor <strong>of</strong> the new task set is less thanv(m), hence a contradiction. Note we do not considerthis argument as a pro<strong>of</strong>, because it lacks therigor that is usually required in mathematics.3. Static <strong>Scheduling</strong>For static scheduling, the priorities <strong>of</strong> tasks arefixed. Without loss <strong>of</strong> generality, we hereafter assumepriorities are in decreasing order, namely, fora set <strong>of</strong> tasks τ 1 , τ 2 , · · · , τ m , the priority order isτ 1 > τ 2 > · · · > τ m . In this section, we discussstatic scheduling <strong>and</strong> shall not state this all the time.A set <strong>of</strong> tasks is schedulable if the timing requirement<strong>of</strong> each instance <strong>of</strong> every task is satisfiedbefore the corresponding deadline. Let us take onetask, say τ k , to consider. We first study the conditionfor its first request to be satisfied. Suppose thetiming requirement is satisfied at time t (t ≤ T k ).Over the interval (0, t), the processor is occupiedby τ 1 , τ 2 , · · · , τ k , i.e., one <strong>of</strong> them is running <strong>and</strong>no tasks τ k+1 , τ k+2 , · · · , τ m can be executed, sinceτ k ’s request is outst<strong>and</strong>ing until t. It follows that∑ ki=1⌈ tT i⌉C i ≤ t (where ⌈ tT i⌉ is the smallest integergreater than or equal to tT i), since tasks with higherpriorities need ∑ k−1i=1 ⌈ tT i⌉C i executing time. On theother h<strong>and</strong>, if there exists 0 < t ≤ T k , such that∑ ki=1⌈ tT i⌉C i ≤ t, then obviously there is enough timefor task τ k , along with the tasks with higher priorities,to complete the execution time. We next investigatea condition for an arbitrary request <strong>of</strong> atask.Lemma 2. The j-th request <strong>of</strong> task τ k is satisfied,if for any b ≤ ( j − 1)T k , there exists t such that( j − 1)T k < t ≤ jT k , ∑ ki=1⌈ t−bT i⌉C i ≤ (t − b).Pro<strong>of</strong>: We search backwards from ( j − 1)T k forthe first time point b such that the processor isnot used by a task from τ 1 to τ k (either no taskis running or a task from τ k+1 to τ m is running)over interval (b − ɛ, b) where ɛ is arbitrarily small.3If such a point cannot be found, then let b = 0.It follows that the processor is totally occupiedby τ 1 , τ 2 , · · · , τ k over (b, ( j − 1)T k ) <strong>and</strong> there areno outst<strong>and</strong>ing requests <strong>of</strong> τ 1 , τ 2 , · · · , τ k that startbefore b. The total amount <strong>of</strong> requested executiontime from τ 1 , τ 2 , · · · , τ k during (b, t) is at most∑ ki=1⌈ t−bT i⌉C i . The processor will continue to be occupiedby τ 1 , τ 2 , · · · , τ k from ( j − 1)T k until theirrequests are satisfied. Since ( j − 1)T k < t ≤ jT k<strong>and</strong> ∑ ki=1⌈ t−bT i⌉C i ≤ (t − b), there is enough time forτ k to complete execution by t.✷Liu <strong>and</strong> Layl<strong>and</strong> [6] discovered a property,which became well known afterwards, about thestatic scheduling: the critical instant (the arrivingtime <strong>of</strong> a task that needs the maximal time to complete)<strong>of</strong> a task occurs when the task is requestedsimultaneously with requests <strong>of</strong> all higher prioritytasks. Apart from its application in the schedulabilitytheorem, it also provides the basis for the responsetime method studied by many researchers,for example, Joseph <strong>and</strong> P<strong>and</strong>ya [5]. However, thepro<strong>of</strong> was informal in the form <strong>of</strong> illustrative diagrams<strong>and</strong> found to have flaws by Goossens [4].In [3], we formally proved a similar result: underthe static scheduler, if the timing requirement <strong>of</strong> atask’s first instance is satisfied, then all instances<strong>of</strong> this task will be satisfied. The pro<strong>of</strong> in [3] wasgiven in Duration Calculus [7], an interval temporallogic. For easy reference, we reformulate thepro<strong>of</strong> using traditional mathematics <strong>and</strong> now thepro<strong>of</strong> follows immediately from Lemma 2.Theorem 4. For any task, the timing requirements<strong>of</strong> all its instances are satisfied under the staticscheduler if <strong>and</strong> only if its first instance is satisfied.Pro<strong>of</strong> The only if part is by the definition. Wenext show the if part. Consider any task τ k . Its firstinstance is satisfied, <strong>and</strong> therefore there exists time0 < t ≤ T k such thatk∑⌈ t ⌉C i ≤ t (1)T ii=1For any instance j > 0, it follows from 0 < t ≤ T kthat for any b ≤ ( j − 1)T k there exists n > 0 suchthat ( j − 1)T k < b + nt ≤ jT k . Thus,∑ ki=1⌈ (b+nt)−bT i⌉C i ≤ ∑ ki=1n⌈ tT i⌉C i( by ⌈ ntT i⌉ ≤ n⌈ tT i⌉)= n ∑ ki=1⌈ tT i⌉C i≤ ntTherefore, by Lemma 2, the j-th instance <strong>of</strong> τ k issatisfied.✷

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!