Improved EDF schedulability analysis of EDF on

Download Report

Transcript Improved EDF schedulability analysis of EDF on

Real-Time Scheduling
for
Multiprocessor Platforms
Marko Bertogna
Scuola Superiore S.Anna,
Pisa, Italy
Real-Time Systems

Solid theory of single processor systems


Much less results for multiprocessors


Optimal schedulers, tight schedulability tests,
shared resource protocols, bandwidth reservation
schemes, hierarchical schedulers, OS, etc.
Many NP-hard problems, few optimal results,
heuristic approaches, simplified task models, only
sufficient schedulability tests, etc.
Do we really need to investigate MultiProcessors Real-Time Systems?
Solution
Use a higher number of slower logic gates
Denser chips with transistor operating at lower
frequencies
MULTICORE SYSTEMS
The Multicore invasion









Intel’s Core2, Itanium, Xeon: 2, 4 cores
AMD’s Opteron, Athlon 64 X2, Phenom: 2, 4 cores
IBM-Toshiba-Sony Cell processor: 8 cores (PSX3)
Microsoft’s Xenon: 3 cores (Xbox 360)
ARM’s MPCore: 4 cores
Sun’s Niagara UltraSPARC: 8 cores
Tilera’s TILE64: 64-core
Nios II: x soft Cores
TI, Freescale, Atmel, Broadcom,Picochip (picoArray
up to 300 DSP cores), ...
Identical vs heterogenous cores
ARM’s MPCore
• 4 identical ARMv6 cores
STI’s Cell Processor
• One Power Processor Element (PPE)
• 8 Synergistic Processing Element (SPE)
System model


Platform with m identical processors
Task set t with n periodic or sporadic tasks ti




Period or minimum inter-arrival time Ti
Worst-case execution time Ci
Deadline Di
Utilization Ui=Ci/Ti, density li=Ci/min(Di,Ti)
Problems addressed


Run-time scheduling problem
Schedulability problem
t1
CPU1
t2
t3
?
CPU2
t4
t5
CPU3
Assumptions


Independent tasks
Job-level parallelism prohibited


Preemption and Migration support


the same job cannot be contemporarily executed
on more than one processor
a preempted task can resume its execution on a
different processor
Cost of preemption/migration integrated into
task WCET
Uniprocessor RT scheduling



There are optimal scheduling algorithms, like
Earliest Deadline First
EDF optimal for arbitrary job collections
Optimal priority assignments for sporadic and
synchronous periodic task systems


RM for implicit deadlines
DM for constrained deadlines
EDF for uniprocessor systems

Optimality: if a collection of jobs can be
scheduled with a given scheduling algorithm,
than it is schedulable as well with EDF

Bounded number of preemptions

Efficient implementations

Easy necessary and sufficient schedulability
test (when Di=Ti):
RT scheduling for uniprocessors

Exact feasibility conditions (using EDF)



linear test for implicit deadlines: Utot ≤ 1
Pseudo-polynomial test for constrained and
arbitrary deadlines [Baruah et al. 90]
Exact FP schedulability conditions

Response Time Analysis for Fixed Priority systems:
the response time of task k is given by the fixed
point of Rk in the iteration
 Rk 
Rk  Ck      Ci
t i hp Ti 
Multiprocessor RT scheduling




Many NP-hard problems
Optimal scheduling algorithms exist only for
the simplest task models and have limited
performances
Schedulability analysis is still far from tight
conditions
Global vs partitioned scheduling
Global vs partitioned scheduling

Single system-wide queue instead of multiple
per-processor queues:
Global scheduling
t5
t4
t3
t2
t1
Partitioned approach
CPU1
t1
t5 t4 t1
CPU1
t1
CPU2
t2
t3 t2
CPU2
t2
CPU3
t3
CPU3
Partitioned Scheduling

The scheduling problem reduces to:
Bin-packing
problem
NP-hard in the
strong sense
+
Uniprocessor
scheduling
problem
t2
t3
t4
t5
Well known
Various heuristics used:
FF, NF, BF, FFDU, BFDD, etc.

t1
EDF
Utot ≤ 1
RM
(RTA)
Global (work-conserving) and partitioned
approaches are incomparable
...
Global scheduling on SMP
Global queue
(ordered according to a given policy)
t5
t4
t3
t2
t1
CPU1
t1
CPU2
t2
CPU3
t3
The first m tasks are scheduled upon the m CPUs
Global scheduling on SMP
Global queue
(ordered according to a given policy)
t5
t54
t43
t2
t1
CPU1
t1
CPU2
t2
CPU3
t43
When a task finishes its execution, the next one in
the queue is scheduled on the available CPU
Global scheduling on SMP
Global queue
(ordered according to a given policy)
t5
t45
t34
t2
t1
CPU1
t1
CPU2
t2
CPU3
t34
t3
When a higher priority task arrives, it preempts the
task with lowest priority among the executing ones
Global scheduling on SMP
Global queue
(ordered according to a given policy)
t5
t54
t43
t32
t21
Task t4 “migrated” from
CPU3 to CPU1
CPU1
t41
CPU2
t2
CPU3
t34
When another task ends its execution, the
preempted task can resume its execution
Global scheduling


The m highest priority ready jobs are always
the one executing
Work-conserving scheduler

No processor is ever idled when a task is ready to
execute.
t5
t4
t3
t2
t1
CPU1
t1
CPU2
t2
CPU3
t3
Global scheduling: advantages
Load automatically balanced
Easier re-scheduling (dynamic loads, selective
shutdown, etc.)
Lower average response time (see queueing theory)
More efficient reclaiming and overload management
Number of preemptions
Migration cost: can be mitigated by proper HW (e.g.,
MPCore’s Direct Data Intervention)
Few schedulability tests  Further research needed
Global Scheduling problem

Pfair optimal only for implicit deadlines:
Utot ≤ m




preemption and synchronization issues
No optimal scheduler known for more general
task models
Classic schedulers are not optimal:
Dhall’s effect
Hybrid schedulers: EDF-US, RM-US, DM-DS,
AdaptiveTkC, fpEDF, EDF(k), EDZL, …
Dhall’s effect
Example: m processors, n=m+1 tasks, Di = Ti
t1 ,…, tm = (1,T-1)
tm+1 = (T,T)
m light tasks
1 heavy task
Utot1
DEADLINE
MISS
T
EDF can fail at very low utilizations
Hybrid schedulers

EDF-US, RM-US, DM-DS, fpEDF


EDF(k), RM(k), DM(k)


assign priorities according to a function (T- k C)
EDZL


give highest priority to the heaviest k tasks and schedule the
remaining ones with EDF/RM/DM
AdaptiveTkC


give highest static priority to the heaviest tasks and schedule
the remaining ones with EDF/RM/DM
…
Schedule tasks with EDF, raising the priority to the jobs that
reach zero laxity
Schedulability problem




All known exact tests are computationally
intractable for non-trivial task sets
Many different sufficient schedulability tests
Big gap from necessary and sufficient
conditions  difficult to “compare” the
various scheduling policies
Need to reduce this schedulability gap
Global scheduling: main results


Only sufficient schedulability tests
Utilization-based tests (implicit deadlines)




Polynomial tests



EDF  Goossens et al.: Utot ≤ m(1-Umax)+Umax
fpEDF  Baruah: Utot ≤ (m+1)/2
RM-US  Andersson et al.: Utot ≤ m2/(3m-2)
EDF, FP  Baker: O(n2) and O(n3) tests
EDZL  Cirinei,Baker: O(n2) test
Pseudo-polynomial tests

EDF, FP  Fisher,Baruah: load-based tests
The GFB test



For implicit deadline systems (Di = Ti)
Linear complexity
Utilization-based test (tight)
A task set is schedulable with EDF on a platform
with m identical processors if:
Total utilization
Umax = maxi{Ci/Ti}
(Utilization of the heaviest task)
The GFB test
Total Utilization
Utot  m (1-Umax) + Umax
m
1
0
1
Umax = max{Ci/Ti}
Density-based tests


EDF:
ltot ≤ m(1-lmax)+lmax
EDF-DS[1/2]: ltot ≤ (m+1)/2
[ECRTS’05]
Gives highest priority to (at most m-1) tasks
having lt ≥ 1/2, and schedules the
remaining ones with EDF


DM:
ltot ≤ m(1–lmax)/2+lmax
DM-DS[1/3]: ltot ≤ (m+1)/3
Gives highest priority to (at most m-1) tasks
having lt ≥ 1/3, and schedules the remaining
ones with DM (only constrained deadlines)
[OPODIS’05]
Critical instant



A particular configuration of releases that leads to
the largest possible response time of a task.
Possible to derive exact schedulability tests
analyzing just the critical instant situation.
Uniprocessor FP and EDF: a critical instant is when



all tasks arrive synchronously
all jobs are released as soon as permitted
Response Time Analysis for uniprocessors

FP  the response time of task k is given by the fixed
point of Rk in the iteration
 Rk 
Rk  Ck      Ci
t i hp Ti 
Multiprocessor anomaly

Synchronous periodic arrival of jobs is not a
critical instant for multiprocessors:
t1 = (1,1,2)
t2 = (1,1,3)
t3 = (5,6,6)
Second job periodic
of t2
Synchronous
delayed
situation
by one unit
from [Bar07]
Need to find pessimistic situations to
derive sufficient schedulability tests
Conclusions




Multiprocessor Real-Time systems are a
promising field to explore.
Still few existing results far from tight conditions.
We contributed filling this gap.
Future work:




Find tighter schedulability tests.
Use our techniques to analyze the efficiency of other
scheduling algorithms (EDZL, EDF-US, FP-DS, etc).
Take into account exclusive resources access.
Integrate into Resource Reservation framework.
The end