Real-Time Scheduling Dynamic Priority Servers
Objectives Schedule soft aperiodic and hard periodic tasks Reduce average response time of aperiodic requests without compromising schedulability of periodic tasks Periodic tasks are schedule by EDF Higher schedulability bounds than with fixedpriority assignments Fixed-priority: RM (periodic), U p =0.6, SS (aperiodic) U s =0.1 Dynamic-priority: EDF (periodic), U p =0.6 U s =0.4 Application: multimedia 2
Assumptions Periodic tasks scheduled by EDF Periodic tasks Hard All tasks start at t = 0 T i, C i, D i D i = T i Aperiodic tasks Soft, no deadlines Unkown arrival time r i Known C i (WCET Worst Case Execution Time) 3
BS BS = Background Server Simple implementation Serve hard periodic tasks accordingly to EDF If there is slack time, serve soft aperiodic tasks Worst performance 4
DPE (1/3) DPE Dynamic Priority Exchange server Extension of the PE server Server trade its runtime with that of lower priority tasks DPE server: T s and C s Aperiodic capacities receive priorities according to deadlines and EDF Ties are broken in favor of capacities (aperiodic requests) 5
DPE (2/3) C S 16 C S 8 t1 C S 24 C S 12 t2 aperiodic C S 6 C S 12 3 2 1 C S 0 2 4 6 8 10 12 14 16 18 20 7 C S 18 C S 24 22 24 t1 = (8, 2) t2 = (12, 3) S = (6, 3) 6
DPE (3/3) U p : periodic tasks processor utilization U s : DPE server processor utilization Whole set is schedulable if U p + U s 1 7
DSS (1/3) DSS = Dynamic Sporadic Server Extends SS to work with EDF Server capacity preserved for possible aperiodic requests Capacity replenished only after consumption Replenishment time: d s = t A + T s Server gets no more than U s even when experiencing overload (when tasks execute more than WCET) 8
DSS (2/3) t1 t2 aperiodic 2 2 2 1 t1 = (8, 2) t2 = (12, 3) S = (6, 3) d s = aperiodic deadline 3 2 +2 1 C S 0 2 4 6 8 10 12 14 16 18 20 C s >0 d s =3+T s d s is the first deadline +1 +1 +3 22 24 C s >0 d s =6+T s d s =9+T s C s >0 both sered with the same deadline d s =14+T s 9
DSS (3/3) U p : periodic tasks processor utilization U s : DSS server processor utilization Whole set is schedulable if U p + U s 1 DSS becomes idle until next replenishing time Bad for soft tasks response time 10
TBS (1/3) TBS = Total Bandwidth Server In DSS, if T s is long, aperiodic requests can be delayed significantly (far deadline!) d k = max(r k,d k-1 ) + C k /U s r k = k-th aperiodic arrival time d 0 = 0 11
TBS (2/3) t1 t2 aperiodic 1 d 1 2 1 d 2 d 3 0 2 4 6 8 10 12 14 16 18 20 22 24 t1 = (6, 3) t2 = (8, 2) U s = 1-U p = 0.25 d 1 =3+(1/0.25)=7 d 2 =9+(2/0.25)=17 d 3 =17+(1/0.25)=21 12
TBS (3/3) Implementation cost: neglegible U p : periodic tasks processor utilization U s : TBS server processor utilization Whole set is schedulable if U p + U s 1 Need of exact WCET knowledge 13
CBS (1/3) CBS = Constant Bandwidth Server Implements a bandwidth reservation scheme: server gets no more than U s even during overload If a task tries to execute for more than its WCET, its priority is decreased (deadline increased) Reduces interference on other taks Task remains elegible for execution, exploiting existing slack 14
CBS (2/3) C s <(d 2 -r 2 )U s uses d 2 t1 4 J 1,1 d 1 J 1,2 3 J 2,1 d2 J 2,2 d 3 aperiodic r 1 r 2 3 2 1 C S 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 d 0 =0 server is idle d 1 =r 1 +T s =11 server recharged to C s =3 d 2 =d 1 +T s =19 server postponed C s replenished t1 = (7, 4) CBS: C s = 3; T s = 8 d k+1 =d k +T s when C s =0 d k+1 =r j +T s when server is idle (no pending tasks) and C s (d k -r j )U s d 3 =d 2 +T s =27 15
CBS (3/3) U p : periodic tasks processor utilization U s : CBS server processor utilization Whole set is schedulable if U p + U s 1 Protects hard tasks from soft tasks transient overruns 16
Comparison (1/6) Simulation of BS, DSS, DPE, and TBS 10 periodic tasks T i {100.. 1000} units of time U p = 0.65 Aperiodic tasks Utilization from 3% to 33% (1-0.65=0.35) Poisson interarrival times, with average T a Aperiodic execution times exponentially distributed Periodic server T s = T a C s = T a U s 17
Comparison (2/6) relative to BS 18
Comparison (3/6) Simulation of DSS, TBS, and CBS Average soft tasks tardiness max{0,f i -d i } Multimedia tasks don t need to meet all deadlines Simulation 5 periodic hard tasks, fixed parameters 5 aperiodic soft tasks, variable execution and interarrival times 19
Comparison (4/6) DSS becomes idle until next replenishing time! 20
Comparison (5/6) TBS slightly outperforms CBS but does not protect hard tasks from transient overruns of soft activities 21
Comparison (6/6) Qualitative evaluation Policy Performance Computational complexity Memory requirement Implementation complexity BS DPE DSS TBS CBS 22
References Hard Real-Time Computing Systems, G. Buttazzo, Kluwer Academic 23