1 / 86

Aperiodic Job Scheduling

Aperiodic Job Scheduling. Real-Time Computing 羅習五. 本份投影片大量參考交通大學 張立平教授的投影片. rejection. Acceptance Test. Sporadic Jobs. Job-basis. rejection. Processor. Acceptance Test. Periodic Task. Task-basis. Aperiodic Jobs. Aperiodic and Sporadic Jobs. Definition

mmark
Download Presentation

Aperiodic Job Scheduling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aperiodic Job Scheduling Real-Time Computing 羅習五 本份投影片大量參考交通大學張立平教授的投影片

  2. rejection Acceptance Test Sporadic Jobs Job-basis rejection Processor Acceptance Test Periodic Task Task-basis Aperiodic Jobs

  3. Aperiodic and Sporadic Jobs • Definition • Jobs of apreiodic and sporadic tasks • Inter-arrival times are arbitrary • Aperiodic Jobs • Assigned to either no deadlines or soft deadlines • Sporadic Jobs • Assigned to hard deadlines

  4. Aperiodic and Sporadic Jobs • Handling of jobs • Apreiodic jobs • In a best-effort fashion • Accept anyway • Sporadic jobs • Accept jobs if deadline satisfaction is guaranteed • Otherwise, reject jobs

  5. Aperiodic and Sporadic Jobs • Correctness • All accepted sporadic jobs and periodic jobs meet their respective deadlines

  6. Aperiodic and Sporadic Jobs • Optimality • Apreiodic jobs • Minimizing the average response time of jobs • Sporadic jobs • Accept jobs if and only if they can be scheduled by some means

  7. Aperiodic and Sporadic Jobs • What we are going to talk about are… • How to handle aperiodic jobs • Reserve a portion of CPU power for aperiodic jobs in fixed-priority and deadline-driven systems • Try to deliver high responsiveness • Schedulability of periodic tasks must not be affected • How to handle sporadic jobs • Employ mechanism proposed for the above • Test whether deadlines of sporadic jobs can be met

  8. Handling Aperiodic Jobs • Approaches • Background execution • Improvement: slack stealing • Interrupt-driven execution • Improvement: slack stealing • Polled execution • Improvement: Bandwidth-preserving servers

  9. Handling Aperiodic Jobs • Terminology (1/3) • Periodic jobs • Jobs of periodic tasks • Server • A task servicing sporadic jobs • Can be either periodic servers or sporadic servers • Characterized by (c,p) • Don’t confuse with a periodic task, a server does not stands for a periodic task • cbudget, c/pserver size

  10. Handling Aperiodic Jobs • Terminology (2/3) • Backlogged • A server is backlogged if there are some ready jobs in its queue • Eligible • A server is eligible if it has budget and is backlogged

  11. Handling Aperiodic Jobs • Terminology (3/3) • Budget consumption rules • Define how budget is consumed when servicing jobs • Budget replenishment rules • Define how budget is replenished • Server execution • When a server is eligible, it is scheduled with other periodic tasks as if it were a periodic task • When budget is exhausted, the server is suspended immediately

  12. Part A: Server Design & the handling of aperiodic jobs

  13. Handling Aperiodic Jobs • Background execution • Handle aperiodic jobs whenever there is no periodic jobs to execute • Extremely simple • Always produce correct schedule • Poor response time

  14. Background Execution 0.8 0.1 Response time=7.7

  15. Handling Aperiodic Jobs • Interrupt execution • An obvious extension to background execution • On arrivals, aperiodic jobs immediately interrupts the currently running periodic job • Fastest response time • Schedulability of periodic jobs can be damaged

  16. Interrupt Execution * Execution time=2.1

  17. Handling Aperiodic Jobs • Slack stealing • To postpone periodic jobs when it is safe to do so • Algorithmically simple, but hard to implement

  18. Slack Stealing A

  19. Handling Aperiodic Jobs • Polled execution • A purely periodic task (polling server) to serve a queue of aperiodic jobs • When the polling server gains control of the CPU, it services aperiodic jobs in the queue • If the queue becomes empty, the polling server suspends immediately • The queue is not checked until the next polling period

  20. The polling server loses all its budget at time 0, since there is no ready aperiodic jobs 0 0.5 0.3 (0.5,2.5) RMS Aperiodic job A arrives at time 0.1

  21. Handling Aperiodic Jobs • Polling servers are easy to implement and are analytically simple • However, a polling server loses all its budget once the queue is empty • If we can preserve the residual budget, aperiodic jobs can be serviced and their response time can be shortened

  22. Handling Aperiodic Jobs • Bandwidth-preserving servers • Deferrable servers • Sporadic servers • Constant utilization servers, total bandwidth servers, weighted fair-queuing servers • These servers aim at improving responsiveness by means of: • Preserving budget whenever possible • Aggressively replenish

  23. Deferrable Servers • Let a deferrable server be denoted by (cs,ps) • Consumption rules: • Budget is consumed at rate of 1 whenever the server services aperiodic jobs • Replenishment rules: • Budget is set to cs at k*ps, for k=0,1,2,…

  24. Deferrable Servers (1,3) (1.5,3.5) (0.5,6.5) Preserving budget Fixed-priority: priority TDST1T2

  25. Deferrable Servers (1,3) (1.5,3.5) (0.5,6.5) Preserving budget Deadline-driven: the deadline of a server job is the next replenishment time

  26. Deferrable Servers • Because budget is preserved, aperiodic jobs can conflict with any periodic jobs at any time • Differently, jobs of a purely periodic task only arrive at the beginning of every period • Does critical instants for tasks of a fixed-priority system in which there is a deferrable server exists?

  27. cS cS pS pS Deferrable Servers • The below figure shows a scenario in which a deferrable server interferes low-priority tasks most (aka double hit) DS becomes backlogged budget

  28. Deferrable Servers • Theorem: Critical instant of task Ti(Let the deferrable server TDS have the highest priority)

  29. Deferrable Servers • Response time analysis • For each i, task Ti is schedulable if Ri,j converges no later than Pi

  30. Deferrable Servers • Response time analysis is accurate, but can we have a polynomial time test like the utilization-bound test? • Bad news: • There is no know utilization bound if a deferrable server is of an arbitrary priority • Good news (not so good): • Consider a system of n independent, preemptible periodic tasks and ps<p1<…<pn<2ps and pn>ps+cs [Lehoczky87]

  31. Ouch, it is quite low… Utilization bound when Us = 1/3

  32. Deferrable Servers • Yet another good news: • We can still make use of the Liu-and-Layland utilization bound if some conservative considerations are taken

  33. pS pS pi ci Deferrable Server • If the deferrable server TDS is of an arbitrary priority, it may impose up to one additional Cs on feasible intervals of jobs of some low-priority task Ti cS cS cS ……

  34. Deferrable Server • Task set {T1,…,Tm,TDS,Tm+2,…Tn} • {T1,…,Tm} is schedulable if ∑ci/pi≦U(m) • For i=(m+1)…n, the reminder of the task set is schedulable if • Let’s try T1=(0.6,3), TDS=(0.8,4), T3=(0.5,5), T4=(1.4,7)

  35. Deferrable Servers • Why can we treat the additional cs as “extra blocking time” of Ti? ?? TDS TDS Ti Ti Schedulable  schedulable

  36. Deferrable Servers • Schedulability of a deadline-driven system with a deferrable server • Consider task set {T1,…, Tn}U{(cs,ps)} • Let t be the deadline of a job of a periodic task • Let t- (<t) be the latest time instant when the CPU is idle or is executing jobs with deadline later than t • Consider time interval (t-,t], we are interested in the maximum computation time demand from periodic tasks and the deferrable server

  37. Deferrable Servers • Deadline-driven systems • The maximum CPU time demanded by the deferrable server in time interval (t-,t] is The last job of es does not affect jobs of deadline no later then t due to EDF discipline Cs? The maximum occurs when the term inside the floor function is an integer

  38. Deferrable Servers • Deadline-driven systems • The maximum CPU time demanded by periodic jobs is Similarly, the maximum happens when the term inside the floor function is a integer

  39. Deferrable Servers • If the total CPU time demanded by periodic jobs and apreiodic jobs exceeds t-t-, the taskset is unschedulable! • Diving both sides of the inequality and then Invert the above statement, we have the theorem:

  40. Deferrable Servers • A deadline-driven system with a deferrable server is schedulable if [Ghazalie95]

  41. Bandwidth-Preserving Servers • Deferrable servers • Sporadic servers  • Priority-exchange servers • Constant utilization servers and total bandwidth server

  42. Sporadic Servers • Deferrable servers have simple rules for budget consumption and replenishment, but they impose extra delays on periodic tasks • Double hit exists both in priority-driven and deadline-driven scheduling • Schedulability tests for periodic systems with deferrable servers are quite complicated

  43. Sporadic Servers • Sporadic servers are designed to improve over deferrable servers • Schedulability test for periodic systems with sporadic servers is very simple • However, nothing always wins. Sporadic servers have complicated consumption and replenishment rules.

  44. Sporadic Servers • Design guideline: a sporadic server never demand processor time more than a periodic task (c,p) does in any time interval • Sporadic servers can be replaced with corresponding periodic tasks for schedulability test

  45. Sporadic Servers • A sporadic server can be characterized by (c,p) • Note again that a sporadic server is not a periodic task! • Different designs of sporadic servers exist, aiming at • preserving server budget as long as possible, and • replenishing server budget as early as possible

  46. Sporadic Servers • Simple sporadic servers in fixed-priority systems

  47. Sporadic Servers • Consumption rules

  48. Sporadic Servers • Fact A: if a periodic task is schedulable in a fixed-priority system, then all its jobs are schedulable if their inter-arrival times are not shorter than its task period • Based on this fact, budget can be preserved for a long period of time D D D D

  49. H H L L H L H L Sporadic Servers • Fact B: when a low-priority job is delayed by a high-priority job, the produced schedule is the same as that produced by the two jobs arriving at the same time • Based on this fact, budget can be replenished more aggressively

  50. (0.5,3) (1.0,4) (1.5,5) (4.5,19) FA FA

More Related