exercise 4 - n.ethz.chabiri/download/assistenz/es...roman trüb [email protected] 1...
TRANSCRIPT
-
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Exercise 4:
Scheduling Periodic and Mixed Task Sets
25. April 2018
presented by
Stefan Drašković [email protected] slides by
Roman Trüb [email protected]
1
Embedded Systems
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Clicker Quiz
Lecture Summary
The Exercise
Solution Discussion
2
Overview
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Clicker Quiz
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 4
Clicker Quiz – Question 1
Schedulable with EDF
Test failed
Task set is not schedulable with EDF
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 5
Clicker Quiz – Question 2
Schedulable with RM
Test failed
With this test result, no statement can be made since
schdulablility test condition is not necessary.
Task set could still be schedulable with RM.
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 6
Clicker Quiz – Question 3
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 7
Clicker Quiz – Question 4
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Lecture Summary
Exercise 4
Institut für Technische Informatikund KommunikationsnetzeComputer Engineering andNetworks Laboratory
Stefan Draskovic 3.4.2019 Page 1 of 5
-
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Periodic with
D = T
Periodic with
D < TMixed Tasks
Static
PriorityRM DM Polling Server
Dynamic
PriorityEDF EDF
Total
Bandwidth
Server
9
Scheduling Algorithms
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Periodic with
D = T
Periodic with
D < TMixed Tasks
Static
PriorityRM DM Polling Server
Dynamic
PriorityEDF EDF
Total
Bandwidth
Server
10
Scheduling Algorithms
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Static priority assignment:
Tasks with shorter period get higher priority
11
Rate Monotonic (RM)
t
tT1
tT3
tT2
High
Low
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 12
RM – Schedulability Test
Sufficient
(but not necessary)
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Periodic with
D = T
Periodic with
D < TMixed Tasks
Static
PriorityRM DM Polling Server
Dynamic
PriorityEDF EDF
Total
Bandwidth
Server
14
Scheduling Algorithms
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Static priority assignment:
Tasks with smaller relative deadline get higher priority
15
Deadline Monotonic (DM)
t
tT3
tT1
tT2
High
Low
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 16
DM – Schedulability Test
Sufficient
(but not necessary)
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 17
RM & DM – Schedulability Test
Necessary &
Sufficient
Ri Ri+CiWorst-case Interference:
Longest Response Time Ri(computed iteratively)
Exercise 4
Institut für Technische Informatikund KommunikationsnetzeComputer Engineering andNetworks Laboratory
Stefan Draskovic 3.4.2019 Page 2 of 5
-
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Periodic with
D = T
Periodic with
D < TMixed Tasks
Static
PriorityRM DM Polling Server
Dynamic
PriorityEDF EDF
Total
Bandwidth
Server
18
Scheduling Algorithms
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Dynamic Priority Assignment:
Always execute the task with the currently closest deadline
19
Earliest Deadline First (EDF)
t
tT1
tT3
tT2
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Di= Ti Di< Ti
20
EDF – Schedulability Tests
Sufficient
(but not necessary)
Necessary &
Sufficient
Utilization:
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Mixed (or hybrid) task set contains both periodic and
aperiodic tasks
Basic idea for scheduling:
Schedule the periodic tasks as usual
Serve the aperiodic tasks via a "server" that behaves like a periodic
task but serves the aperiodic tasks
21
Mixed Task Scheduling
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Periodic with
D = T
Periodic with
D < TMixed Tasks
Static
PriorityRM DM Polling Server
Dynamic
PriorityEDF EDF
Total
Bandwidth
Server
22
Scheduling Algorithms
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Idea: Introduce an artificial periodic task (Cs, Ts) which
serves the aperiodic requests
23
RM – Polling Server
Schedulability test for mixed task set:
Sufficient
(but not necessary)
Sufficient
(but not necessary)
Aperiodic guarantee:Assumption: aperiodic task finishes
before new aperiodic request arrives
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Periodic with
D = T
Periodic with
D < TMixed Tasks
Static
PriorityRM DM Polling Server
Dynamic
PriorityEDF EDF
Total
Bandwidth
Server
24
Scheduling Algorithms
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Idea: For every aperiodic request a deadline which is
based on the server’s parameters (Cs, Ts) is assigned.
The aperiodic requests are then scheduled with EDF as
any other periodic instance.
25
EDF – Total Bandwidth Server
Assignment of the deadlines to the aperiodic requests:
NOTE: recursive
computation!
Aperiodic requests
are assumed to be
ordered by increasing
release time ri
Exercise 4
Institut für Technische Informatikund KommunikationsnetzeComputer Engineering andNetworks Laboratory
Stefan Draskovic 3.4.2019 Page 3 of 5
-
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 26
EDF – Total Bandwidth Server
Schedulability test for mixed task set:
Necessary &
Sufficient
Set of periodic tasks with
utilization Up and a Total
Bandwidth Server with utilization
Us is schedulable with EDF
Utilization of Total Bandwidth Server:
Utilization of the periodic tasks:
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Execise 4
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 28 |
Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 29
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 30 |
Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
Execise 4 - Solution
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 32 |
Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
1. Maximum utilization of the server:
2. Order tasks by increasing release time: J4, J6, J5
Then, calculate new deadlines recursively:
33
Task 1 – Solution
Exercise 4
Institut für Technische Informatikund KommunikationsnetzeComputer Engineering andNetworks Laboratory
Stefan Draskovic 3.4.2019 Page 4 of 5
-
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
2. EDF schedule with aperiodic tasks:
34
Task 1 – Solution
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 35
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
1. Sufficient test:
Test failed! Since it is not necessary, we still don’t know if
the task set is schedulable with RM or not.
36
Task 2 – Solution
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
2. Necessary test: Iterative algorithm
1) Order tasks by their priority (already ok in this case)
2) Start with task which has lowest priority:
37
Task 2 – Solution
Necessary test succeeds task set is schedulable with RM
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
3. RM schedule
38
Task 2 – Solution
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018 39
|Computer Engineering
and Networks Laboratory Stefan Drašković | 25.04.2018
1. Aperiodic guarantee:
2. Sufficient schedulability test for RM Polling Server:
40
Task 3 – Solution
Test succeeded!
Substituting values & considering minimum
Task set is schedulable with RM
Exercise 4
Institut für Technische Informatikund KommunikationsnetzeComputer Engineering andNetworks Laboratory
Stefan Draskovic 3.4.2019 Page 5 of 5