Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

Published in: Business, Technology
  • Be the first to comment


  1. 1. The Limited Preemption Uniprocessor Scheduling of Sporadic Task Systems Sanjoy Baruah - 2005
  2. 2. <ul><li>Motivation </li></ul><ul><ul><li>From feasibility perspective, preemptive scheduling strictly dominates non preemptive scheduling. Every task system that is feasible under non preemptive scheduling is feasible under preemptive scheduling too, but the converse is not always true. </li></ul></ul><ul><ul><li>Preemptive scheduling has overhead associated with itself - context switching and arbitrating access in critical section to shared resources which allows access to only one task at any instant of time. </li></ul></ul><ul><ul><li>Objective is to reduce the number of preemptions. </li></ul></ul><ul><ul><li>Determine the largest size chunk in which the tasks can be scheduled non preemptively. Also if a task needs a shared resource for a period smaller than this chunk, then access to this shared resource is arbitrated by just having the task execute the resource non preemptively. </li></ul></ul>
  3. 3. <ul><li>The Formation of Problem Statement </li></ul><ul><ul><li>A sporadic task system in which every real-time sporadic task is defined by </li></ul></ul><ul><ul><ul><li>τ i = (e i , d i , p i ) </li></ul></ul></ul><ul><ul><ul><ul><li>e i => Worst case execution requirement </li></ul></ul></ul></ul><ul><ul><ul><ul><li>d i => A relative deadline </li></ul></ul></ul></ul><ul><ul><ul><ul><li>p i => Minimum inter arrival separation </li></ul></ul></ul></ul><ul><ul><li>It is further assumed that the task system is schedulable under preemptive scheduling. </li></ul></ul><ul><ul><li>Objective: To determine the largest value q i for each τ i Є τ such that τ remains feasible if the jobs of τ i are scheduled in non preemptive chunks, each of size no larger than q i . </li></ul></ul><ul><ul><li>Inserted idle times are forbidden </li></ul></ul>
  4. 4. <ul><li>The EDF Scheduling Algorithm </li></ul><ul><ul><li>Priority driven scheduling algorithm, with higher priority assigned to request which has earlier deadline </li></ul></ul><ul><ul><li>Is an optimal uniprocessor – if EDF cannot schedule a task set on a uniprocessor, there is no scheduling algorithm that can </li></ul></ul><ul><ul><li>If all the tasks are periodic and have relative deadlines equal to their periods , this algorithm will feasibly schedule a periodic task set as long as its utilization factor verifies: </li></ul></ul><ul><ul><ul><li>U ≤ 1 where </li></ul></ul></ul>
  5. 5. <ul><li>Algorithm Proposed by the Author </li></ul><ul><ul><li>Define Demand Bound Function DBF( τ i , t) as the largest cumulative execution requirement of all jobs that can be generated by τ i to have both their arrival times and deadline times within a contiguous interval of length t. </li></ul></ul><ul><ul><li>DBF in an interval [t 0 , t 0 + t) is maximised when the first job arrives at t 0 and the successive jobs arrive as soon as possible, i.e, t 0 + p i , t 0 + 2p i , … </li></ul></ul><ul><ul><li>Approach : Compute the largest values of q i such that the infeasibility conditions are not satisfied. </li></ul></ul><ul><ul><li>Suppose a system τ which is not schedulable under EDF, and derive properties that it must satisfy. </li></ul></ul><ul><ul><li>As τ is not schedulable, it must generate a legal collection of jobs upon which EDF would miss some deadline. Let σ ( τ ) denote the smallest such legal collection of jobs. Let t f denote the instance at which deadline is missed, and t a the earliest arrival time of any job in σ ( τ ). </li></ul></ul><ul><ul><ul><li>The processor is never idled over [t a , t f ) in the EDF schedule of σ ( τ ). </li></ul></ul></ul><ul><ul><ul><li>Atmost one job with deadline greater than t f . </li></ul></ul></ul><ul><ul><ul><li>If no jobs with deadlines > t f , then </li></ul></ul></ul><ul><ul><ul><li>Suppose there is 1 job with deadline > t f . Let τ j denote the task which generates this job, and let [t 1 , t 2 ] denote the last contiguous time interval during which it executes in non-preemptive mode. Then </li></ul></ul></ul><ul><ul><li>From these we conclude that Restricted Sporadic Task System is not schedulable </li></ul></ul><ul><ul><ul><li>if </li></ul></ul></ul><ul><ul><ul><li>Or there is a </li></ul></ul></ul><ul><ul><li>From these, the value of q i can be calculated iteratively while performing the feasibility analysis. </li></ul></ul>
  6. 6. <ul><li>Conclusion </li></ul><ul><ul><li>In uniprocessor systems, preemptive scheduling dominates over non-preemptive one considering feasibility, ignoring the overhead of context switching which can be significant for many applications (processor preemption, resource sharing, etc). </li></ul></ul><ul><ul><li>The author here has given an algorithm to determine the largest chunk size that can be scheduled non-preemptively and yet the system does not miss its deadline. </li></ul></ul><ul><ul><li>Advantages : </li></ul></ul><ul><ul><ul><li>If a resource is required for a time less than this chunk size, then the resource access can be arbitrated by simply having the task use the resource non-preemptively, instead of using complex resource sharing algorithms. </li></ul></ul></ul><ul><ul><ul><li>Run time scheduling can be simplified by knowing that a task that gets access to shared processor may run for a certain time prior to being preempted by some other task. Context switching overhead is reduced. </li></ul></ul></ul><ul><ul><li>Other attempts in this direction were by </li></ul></ul><ul><ul><ul><li>Baker, who assigned preemption levels and allowed tasks to preempt only those which are at a lower level than itself. </li></ul></ul></ul>
  7. 7. Deadline Fair Scheduling: Bridging the Theory and Practice of Proportionate Fair Scheduling in Multiprocessor Systems Abhishek Chandra, Micah Adler and Prashant Shenoy - 2001
  8. 8. <ul><li>Motivation </li></ul><ul><ul><li>Streaming audio, video and multiprocessor have timing constraints, but unlike hard-real time applications, occasional violations of these deadlines do not result in catastrophic consequences. </li></ul></ul><ul><ul><li>A P-Fair scheduler allows an application to request x i time units every y i time quanta and guarantees that over any T quanta, a continuously running application receives between floor[(x i / y i ) * T] and ceiling[(x i / y i ) * T] quanta of service. </li></ul></ul><ul><ul><li>Simulations have shown that in practical application of the P-Fair schedulers, asynchrony in scheduling multi-processors, frequent arrivals and departures of tasks can cause the system to be non-work conserving. </li></ul></ul><ul><ul><li>Most of the research focuses on theoretical analysis of these schedulers. </li></ul></ul><ul><ul><li>The authors here have considered practical issues of implementing the scheduler into a multi-processor operating system kernel. </li></ul></ul><ul><ul><li>Also to make the system work conserving, the P-Fair scheduler is coupled with Airport Scheduling. </li></ul></ul><ul><ul><li>Also as this is a multiprocessor environment, processor affinities are to be considered for better performance by making use of cached data. </li></ul></ul>
  9. 9. <ul><li>The Formation Of Problem Statement </li></ul><ul><ul><li>Soft-real time constraint (streaming audio, video, online virtual world, multiplayer games) </li></ul></ul><ul><ul><li>Multiprocessor system </li></ul></ul><ul><ul><li>Practical issues of implementing P-Fair Scheduling into multiprocessor operating system kernel </li></ul></ul><ul><ul><li>Combine DFS with auxiliary work conserving scheduler in order to guarantee work conserving behavior </li></ul></ul><ul><ul><li>Account for processor affinities </li></ul></ul>
  10. 10. <ul><li>Proportionate Fair Scheduler </li></ul><ul><ul><li>A P-Fair scheduler allows an application to request x i time units every y i time quanta and guarantees that over any T quanta, a continuously running application receives between floor[(x i / y i ) * T] and ceiling[(x i / y i ) * T] quanta of service. </li></ul></ul><ul><ul><li>Strong notion of fairness as at any given instant, no given application is more than one quantum away from its due share. </li></ul></ul><ul><ul><li>Assumptions: </li></ul></ul><ul><ul><ul><li>Quantum direction is fixed. </li></ul></ul></ul><ul><ul><ul><li>Set of tasks in the system is fixed. </li></ul></ul></ul>
  11. 11. <ul><li>Algorithm Proposed By The Author </li></ul><ul><ul><li>Use a modified definition of P-Fairness </li></ul></ul><ul><ul><li>Let Φ i denote the share of processor bandwidth that is requested by task I in a p-processor system. </li></ul></ul><ul><ul><li>Then over any T time quanta, a continuously running application should receive between floor[( Φ i /summation( Φ i )).pT] and ceiling[( Φ i /summation( Φ i )).pT]. </li></ul></ul><ul><ul><li>DFS schedules each ask periodically depending on its share Φ i . It uses an eligibility criteria to determine the tasks eligible for scheduling. Once scheduled, the task becomes ineligible until the next period begins. Each eligible task is stamped with an internally generated deadline, and the DFS schedules these eligible tasks in the earliest-deadline-first order. </li></ul></ul><ul><ul><li>Each task is associated with a share Φ i , a start tag S i and a finish tag F i . When a task is executed, its start tag is updated at the end of the quantum as S i + q/ Φ i ,where q is the duration for which the task ran. If a suspended task wakes up, its S i is max of present S i and the virtual time. </li></ul></ul><ul><ul><li>The finish tag F i is updated to S i + q`/ Φ i , where q` is the maximum time for which the task can run the next time it is scheduled. </li></ul></ul><ul><ul><li>At scheduling instance, the scheduler determines the eligible tasks using an eligibility criterion, and then computes the deadlines for these tasks – for both operations S i and F i are used. </li></ul></ul><ul><ul><li>DFS has been proven to be work conserving under the assumption of fixed task set and synchronize fixed length quanta. These need not hold in a typical multiprocessor system. </li></ul></ul><ul><ul><li>DFS is combined with an auxiliary scheduler to make the system work conserving. It maintains two queues – one which contains eligible tasks and the other contains all the tasks. If there are no eligible tasks to be scheduled by the DFS, then the auxiliary scheduler uses the second task set and schedules a task which is currently ineligible. </li></ul></ul><ul><ul><li>To take into account the processor affinities, instead of just using the deadline as the sorting factor, a combination (ex. Linear) of deadline and affinity (affinity is 0 for the processor on which the task ran last and 1 for all others) can be used. He authors have called this as the goodness factor, and the scheduler picks the smallest goodness factor task to be scheduled – thus it is global scheduling. </li></ul></ul>
  12. 12. Early Release Fair Scheduling James H Anderson and Anand Srinivasan - 2000
  13. 13. <ul><li>Motivation </li></ul><ul><ul><li>P-Fair scheduling algorithms schedule tasks by breaking them into quantum-length subtasks which are given intermediate deadlines. </li></ul></ul><ul><ul><li>In P-Fair, if some subtask of a task executes early in its window, the task becomes in-eligible for scheduling again until the start of the window of its next subtask. </li></ul></ul><ul><ul><li>Thus, P-Fair is not work-conserving. </li></ul></ul>
  14. 14. <ul><li>The Formation of the Problem Statement </li></ul><ul><ul><li>Collection of periodic real-time tasks </li></ul></ul><ul><ul><li>Multiple processors </li></ul></ul><ul><ul><li>Each task T is associated with a period T.p and execution cost T.e. Each T.p time units, an invocation of T with a cost of T.e takes place. This is a job of T. It is required that each job of a task must complete before the next job can of the same task can begin. </li></ul></ul><ul><ul><li>T can be allocated on different processors, provided it is not scheduled on more than one processor at the same time. </li></ul></ul><ul><ul><li>T.e / T.p is the weight of a task. It is assumed that the weight is strictly less than 1 (weight 1 task would require a dedicated processor which makes the scheduling decision easier). </li></ul></ul>
  15. 15. <ul><li>P-Fair Scheduling Algorithm </li></ul><ul><ul><li>A P-Fair scheduler allows an application to request x i time units every y i time quanta and guarantees that over any T quanta, a continuously running application receives between floor[(x i / y i ) * T] and ceiling[(x i / y i ) * T] quanta of service. </li></ul></ul><ul><ul><li>Strong notion of fairness as at any given instant, no given application is more than one quantum away from its due share. </li></ul></ul><ul><ul><li>Assumptions: </li></ul></ul><ul><ul><ul><li>Quantum direction is fixed. </li></ul></ul></ul><ul><ul><ul><li>Set of tasks in the system is fixed. </li></ul></ul></ul><ul><ul><li>Lag of a task T is defined as the difference between the amount of time allocated to the task and what would have been allocated to it in an ideal system. </li></ul></ul><ul><ul><ul><li>Lag(T, t) = (T.e / T.p) * t – allocated(T, t) </li></ul></ul></ul><ul><ul><li>P-Fair scheduler implies -1 < lag(T, t) < 1 </li></ul></ul>
  16. 16. <ul><li>ER-Fair Scheduling Algorithm </li></ul><ul><ul><li>The Early Release Scheduling Algorithm is derived by dropping the -1 lag constraint. </li></ul></ul><ul><ul><ul><li>Lag(T, t) < 1 </li></ul></ul></ul><ul><ul><li>Every P-Fair schedule is ER-Fair, but the converse need not be true. </li></ul></ul><ul><ul><li>Every ER-Fair is periodic </li></ul></ul><ul><ul><ul><li>Lag(T, t) = 0 for t = T.p, 2T.p, 3T.p, … </li></ul></ul></ul><ul><ul><ul><ul><li>Reason is that for these values of t, (T.e / T.p)*t is an integer. Now by the constraint of the lag(T, t) < 1, the lag has to be either 0 or negative. But a negative lag implies that the task received more time than what it had requested. Hence lag(t, t) = 0 for these values of t. </li></ul></ul></ul></ul><ul><ul><li>Baruah et al. showed that a periodic task set has a P-Fair schedule in a system of M processors iff summation(T.e/T.p) < M. Every PFair being an ER-Fair, same is the feasibility condition for ER-Fair schedule. </li></ul></ul><ul><ul><li>Each subtask of T has an associated pseudo-release and pseudo-deadline (referred to as release and deadline) </li></ul></ul><ul><ul><ul><li>r(T i ) = floor[(i-1) * T.e / T.p] </li></ul></ul></ul><ul><ul><ul><ul><li>r(Ti) is the first slot into which T i can be scheduled. </li></ul></ul></ul></ul><ul><ul><ul><li>d(T i ) = ceiling[i * T.e / T.p] – 1 </li></ul></ul></ul><ul><ul><ul><li>w(T i ) = [r(T i ), d(T i )] </li></ul></ul></ul><ul><ul><ul><ul><li>w is the window of a subtask. </li></ul></ul></ul></ul><ul><ul><li>The only difference between PFair and ERFair is in their eligibility criterion. In PFair, a subtask T i is eligible at time t if t Є w(T i ) and if T i-1 has been scheduled prior to t but T i has not. In ERFair, if T i and T i+1 are part of the same job, then T i+1 becomes eligible for execution immediately after T i executes. </li></ul></ul>
  17. 17. <ul><li>Conclusion </li></ul><ul><ul><li>The authors have proposed the ER-Fair scheduling algorithm by dropping the -1 constraint of PFair Scheduling, whereby some subtasks can execute early – before their window. This overcomes the non work-conserving nature of the PFair schedules. </li></ul></ul><ul><ul><li>A hybrid system can be proposed in which only few selected tasks can be released early. This might be useful if a small subset of tasks are subject to stringent response-time requirements. </li></ul></ul><ul><ul><li>It may also be possible to determine dynamically when and by how much the subtasks might be released early. </li></ul></ul>
  18. 18. Bounds on the Performance of Heuristic Algorithm for Multiprocessor Scheduling of Hard-Real Time Tasks Fuxing Wang, Krithi Ramamritham and John A Stankovic - 1992
  19. 19. <ul><li>Motivation </li></ul><ul><ul><li>To determine feasible non preemptive schedules on multiprocessor systems, list scheduling can be used. But while list scheduling has a good worst case schedule length, it does not have good average case performance. </li></ul></ul><ul><ul><li>An heuristic approach is the H scheduling algorithm. It has a good average case performance with respect to meeting deadline, but a poor worse case schedule length. </li></ul></ul><ul><ul><li>So try to combine the features of both the list scheduling algorithm and H scheduling algorithm, such that it performs well in finding feasible schedule and has a good schedule length bound. </li></ul></ul>
  20. 20. <ul><li>The Formation of the Problem Statement </li></ul><ul><ul><li>To assign a set of real time tasks to processors and additional resources, such that all tasks meet their resource requirements and timing requirements. </li></ul></ul><ul><ul><li>Given </li></ul></ul><ul><ul><ul><li>A set of m identical processors in a homogeneous multiprocessor system. Each processor is capable of executing any task. </li></ul></ul></ul><ul><ul><ul><li>A set of r resources such as data sets and buffers. Resources are discreet and may have multiple instances. Resources are continuous (a resource is continuous if a task can request any portion of it) and renewable (a resource is renewable if its total amount is always fixed and they are not consumed by the tasks). </li></ul></ul></ul><ul><ul><ul><li>A set of n tasks, each characterized by its worst case computation time, its deadline and its resource requirement vector. </li></ul></ul></ul><ul><ul><li>Assume that the tasks are aperiodic, independent and non preemptable. Also assume that the resources requested by a task are used throughout the tasks execution time. </li></ul></ul><ul><ul><li>The performance criteria is to minimize the maximum completion time. </li></ul></ul><ul><ul><li>Scheduling problem with these characteristics is a hard problem. Heuristic approach is considered here. </li></ul></ul>
  21. 21. <ul><li>The List Scheduling Algorithm </li></ul><ul><ul><li>Every task has a priority defined (may depend on deadline, resource requirement or some combination). </li></ul></ul><ul><ul><li>Tasks are arranged in a ready queue sorted on their priority values. </li></ul></ul><ul><ul><li>When a processor becomes idle, it scans the ready queue and selects the first task that does not violate resource constraints. </li></ul></ul><ul><ul><li>Does not have good average case performance because sometimes moving a lower priority task up in schedule when higher priority tasks are blocked by resource constraints causes the higher priority tasks to miss some deadlines. </li></ul></ul><ul><li>The H Scheduling Algorithm </li></ul><ul><ul><li>Priority is calculated as </li></ul></ul><ul><ul><ul><li>h(T i ) = d i + W i . b i </li></ul></ul></ul><ul><ul><ul><li>Higher the value of h, lower is the priority. </li></ul></ul></ul><ul><ul><li>The tasks are sorted on this priority value. </li></ul></ul><ul><ul><li>Whenever a processor becomes free, it schedules the task with the highest priority. </li></ul></ul><ul><ul><li>It does not, as list scheduling does, try to be greedy about processor resource usage. </li></ul></ul>
  22. 22. <ul><li>Algorithm Proposed by the Authors </li></ul><ul><ul><li>The authors have proposed a combination of the list and H scheduling algorithms, calling it the H K scheduling algorithm. </li></ul></ul><ul><ul><li>It uses the same heuristic as H scheduling algorithm, but tries to be greedy to a certain degree with respect to processor usage. </li></ul></ul><ul><ul><li>H K maintains a variable t CK which divides the schedule into two parts. The first portion satisfies that in any sub-interval, either at least k processors are busy or less than k processors are busy, but addition of any task causes a resource contention. </li></ul></ul><ul><ul><li>t ck is formally set to the maximum possible value that satisfies- </li></ul></ul><ul><ul><ul><li>In any sub-interval [x, y] of [0, t ck ) at least k processors are busy </li></ul></ul></ul><ul><ul><ul><li>Less than k processors are busy, but no other tasks can be as their addition causes resource conflict. </li></ul></ul></ul><ul><ul><li>The H K then applies highest priority first rule to schedule a task which can fit into the partial schedule before t CK . </li></ul></ul>
  23. 23. <ul><li>Conclusion </li></ul><ul><ul><li>The time complexity of H k scheduling algorithm is very high when k > 2. Only H 2 has time complexity comparable to those of H scheduling and list scheduling algorithms. Also for non-uniform tasks the length bound does not improve for k > 2. So the authors focused mainly on H 2 . </li></ul></ul><ul><ul><li>Analyses showed that the H 2 produces better worst-case bound lengths than H algorithm, and is also almost as good as H scheduling algorithm in finding the feasible schedule. </li></ul></ul>