Download presentation
Presentation is loading. Please wait.
1
courseware Scheduling Uniprocessor Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens Plads, Building 321 DK2800 Lyngby, Denmark Jan@imm.dtu.dk
2
SoC-MOBINET coursewareJan Madsen2 Rate-monotonic scheduling Real-time scheduling with provable properties [Liu and Layland 73] Each process is independent and given a unique priority A process may be preempted by a higher-priority process All processes have a deadline equal to their period and a fixed WCET Context switching overhead is ignored
3
SoC-MOBINET coursewareJan Madsen3 RMS The critical instance for a process occurs when the process and all higher-priority processes are released simultaneously sisi cici aiai didi = T i Must guarantee that all processes meet their deadlines, independent of order of releases pipi pipi
4
SoC-MOBINET coursewareJan Madsen4 RMS example 50 40 30 p3p3 p2p2 p1p1 0203040506010 TiTi CiCi p1p1 5012 p2p2 4010 p3p3 3010
5
SoC-MOBINET coursewareJan Madsen5 Rate-monotonic priority assignment Each process is given a unique priority where 1 is the highest Prioritize according to T i ’s, with shortest-period process given highest priority Fixed-priority scheme Independent of c i ’s This priority assignment is optimal No fixed priority scheme does it better!
6
SoC-MOBINET coursewareJan Madsen6 RMS example (cont.) TiTi CiCi priority p1p1 50123 p2p2 40102 p3p3 30101
7
SoC-MOBINET coursewareJan Madsen7 CPU utilization under RMS Given N independent processes, utilization U N i i i T c U 1 12 1 N NU ( ) %3.69)12((lim 1 N N N Least upper bound for utilization
8
SoC-MOBINET coursewareJan Madsen8 RMS example (cont.) TiTi CiCi priorityU p1p1 50121 p2p2 40102 p3p3 30103 12 1 3 3U ( ) = 0.78 0.24 0.25 0.33 0.82
9
SoC-MOBINET coursewareJan Madsen9 RMS example (cont.) p3p3 p2p2 p1p1 50 40 30 0203040506010
10
SoC-MOBINET coursewareJan Madsen10 RMS The utilization-based schedulability test is sufficient but not necessary If the test is passed it is schedulable If the test is not passed, it may be schedulable If all processes meet their first deadline then they will meet all future one
11
SoC-MOBINET coursewareJan Madsen11 Response time analysis Highest-priority process r = c Other processes will suffer interference from higher-priority processes r i = c i + i i Maximum interference occur at a critical instance
12
SoC-MOBINET coursewareJan Madsen12 Response time analysis cj cj TjTj RiRi cici RiRi )(ihpj Processes with higher-priority than p i number of releases of process p j during [0, R i ) each release will impose an interference of c j cjcj cici ihpj TjTj wiwi n )( wiwi n 1
13
SoC-MOBINET coursewareJan Madsen13 Response time analysis example TiTi CiCi priority p1p1 731 p2p2 1232 p3p3 2053 w1w1 0 3 w2w2 0 3 7 3 w2w2 1 3 + 3 = 6 7 6 w2w2 2 R 1 =3 R 2 =6
14
SoC-MOBINET coursewareJan Madsen14 Earliest-Deadline-First Scheduling Dynamic priority scheme changes priorities during execution based on initiation times can achieve higher CPU utilization than RMS, i.e. 100% Priority policy: process with closest deadline gets highest-priority
15
SoC-MOBINET coursewareJan Madsen15 EDF example TiTi CiCi p1p1 31 p2p2 41 p3p3 52 p1p1 p2p2 p3p3 0123456789101213141516 123123 312312 231231 231231 123123 213213 123123
16
SoC-MOBINET coursewareJan Madsen16 RMS example 50 40 30 p3p3 p2p2 p1p1 0203040506010 TiTi CiCi p1p1 5012 p2p2 4010 p3p3 3010
17
SoC-MOBINET coursewareJan Madsen17 RMS example scheduled using EDF 40 30 50 p3p3 p2p2 p1p1 0203040506010 809010011070 TiTi CiCi p1p1 5012 p2p2 4010 p3p3 3010
18
SoC-MOBINET coursewareJan Madsen18 Comparing RMS and EDF Higher CPU utilization with EDF Easier to ensure that deadlines will be satisfied with RMS RMS easier to implement
19
SoC-MOBINET coursewareJan Madsen19 Overload conditions When not all processes can meet their deadlines EDF may result in domino effect First process missing its deadline may cause all subsequent processes to miss their deadlines Accociate value w i of importance with each process Use T i /w i as priority (similar to shortest-process-first)
20
SoC-MOBINET coursewareJan Madsen20 More realistic model assumptions Shared resources Data dependencies Context switching Cache effects Power reduction
21
SoC-MOBINET coursewareJan Madsen21 Shared resources Scheduling processes without considering resource requirements may cause priority inversion example, p 1 highest-priority process p 1 {r 1 } p 2 {r 1 } deadlock!
22
SoC-MOBINET coursewareJan Madsen22 Shared resources When there are mutual exclusion constraints, it is impossible to find a totally on-line optimal runtime scheduler [Mok83] Priority ceiling protocol (PCP) a way to bound priority inversion blocking of processes that may cause them temporary priority increase of process PCP prevents deadlocks
23
SoC-MOBINET coursewareJan Madsen23 t1t1 t2t2 Data dependencies p1p1 p3p3 p2p2 didi t1t1 10 t2t2 8 cici p1p1 2 p2p2 1 p3p3 4 p1p1 p2p2 p3p3
24
SoC-MOBINET coursewareJan Madsen24 Context switching cici didi p1p1 35 p2p2 210 p2p2 p1p1 0468 2 p2p2 p1p1 0468 2
25
SoC-MOBINET coursewareJan Madsen25 Cache effects cici average c i p1p1 21.5 p2p2 10.75 p3p3 1 p3p3 p2p2 p1p1 p1p1 p2p2 p1p1 p3p3 p2p2 p1p1 p3p3 p2p2 p1p1 p3p3 p2p2 LRU cache policy: least-recently-used
26
SoC-MOBINET coursewareJan Madsen26 Cache effects cici average c i p1p1 21.5 p2p2 10.75 p3p3 1 p1p1 p2p2 p1p1 p3p3 p1p1 p3p3 p1p1 p2p2 p1p1 p3p3 p1p1 p3p3 p2p2 p1p1 cache policy: keep p 1 in cache
27
SoC-MOBINET coursewareJan Madsen27 Power reduction Power management policy Takes time to power-down/up Techniques: event/request based predictive probabilistic
28
SoC-MOBINET coursewareJan Madsen28 Power reduction p3p3 p2p2 p1p1 r1r1 r1r1 r1r1 r1r1 p3p3 p2p2 p1p1 r1r1 r1r1 r 1 idle
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.