Interactive Powerpoint_How to Master effective communication
Priority driven scheduling of periodic tasks
1. S T A T I C A S S U M P T I O N
F I X E D P R I O R I T Y V E R S U S D Y N A M I C P R I O R I T Y A L G O R I T H M
M A X I M U M S C H E D U L A B L E U T I L I Z A T I O N
O P T I M A L I T Y O F R M A N D D M A L G O R I T H M S
S C H E D U L A B I L I T Y T E S T F O R F I X E D P R I O R I T Y T A S K S
S U F F I C I E N T S C H E D U L A B I L I T Y C O N D I T I O N F O R T H E R M
A N D D M A L G O R I T H M S
P R A C T I C A L F A C T O R
Priority Driven Scheduling of
Periodic Tasks
2.
3.
4.
5. Example showing poor performance:
Consider m+1 independent tasks.
First m tasks Ti=(1,2ε) and last task=(1+ε,1) where ε
is a very small number.
We will schedule them in the m processors.
Priorities are assign on EDF basis.
6.
7. The first job Jm+1,1 in Tm+1 has the lowest priority
because it has the latest deadline.
Jm+1,1 does not complete until 1+2ε and hence
misses its deadline.
Total utilization = m (2 ε/1) + 1/(1+ ε)= 2m ε/1 +
1/(1+ ε) = 2mε +1/(1+ ε).
In the limit as ε approaches zero, U approaches 1,
and yet the system remains unschedulable.
8. As long as the total utilization of the first m tasks,
2mε, is equal to or less than 1, this system can be
feasibly scheduled statically on two processors.
If we put Tm+1 on one processor and the other tasks
on the other processor and schedule the task(s) on
each processor according to either of these priority-
driven algorithms we will get feasible schedule.
9. Fixed Priority vs. Dynamic Priority Algorithms
Priority-driven algorithms differ from each other in
how priorities are assigned to jobs.
We classify algorithms for scheduling periodic tasks
into two types:
Fixed priority and
Dynamic priority.
A fixed-priority algorithm assigns the same priority
to all the jobs in each task.
In other words, the priority of each periodic task is
fixed relative to other tasks.
10. Dynamic-priority algorithm assigns different
priorities to the individual jobs in each task.
The priority of the task with respect to that of the
other tasks changes as jobs are released and
completed.
11. Indeed, we have three categories of algorithms:
Fixed-priority algorithms: Rate Monotonic (RM), Deadline
Monotonic (DM).
Task-level dynamic-priority (and job level fixed-priority)
algorithms: EDF, FIFO, LIFO
Job-level (and task-level) dynamic algorithms: LST
We assume dynamic means task level dynamic and
job level fixed unless otherwise stated.
12. Rate Monotonic Algorithm
The rate (of job releases) of a task = 1/period.
The higher its rate, the higher the priority of the task.
In other word smaller the period higher the priority
of the task.
13.
14. Deadline Monotonic Algorithm
Well known fixed priority algorithm.
The shorter its relative deadline, the higher the
priority of the task.
Example:
T1 = (50,50,25,100); T2 = (0,62.5,10,20);
T3 = (0,125,25,50)
u1 = 0.5; u2 = 0.16; u3 = 0.2
U = 0.86; H = 250.
15.
16.
17. When relative deadline of every job is proportional to
its period both RM and DM algorithms are identical.
When relative deadlines are arbitrary, DM algorithm
performs better than RM.
We can see DM produce the feasible schedule even
when RM fails.
18. EDF Algorithm
The earlier its absolute deadline ,the higher the
priority of the job.
19. LST Algorithm
It assigns the priorities to individual jobs in the tasks
according to the slack time.
At time t, the slack of a job whose remaining
execution time is e and deadline is d is equal to the
d-e-t.
The scheduler checks the slacks of all the ready jobs
each time a new job is released and orders the jobs
on the basis of their slacks.
Smaller the slack higher the priority.
20. Example T1=(2,1) and
T2=(5,2.5)
At time t=0
Slack for T1=2-1-0=1
Slack for T2=5-2.5-0=2.5
At time t=2
T1=4-1-2=1
T2=5-1.5-2=1.5
At time t=4
T1=6-1-4=1
T2=5-0.5-4=0.5
At time t=5
T1=6-0.5-5=0.5
T2=10-2.5-5=2.5
At time t=6
T1=8-1-6=1
T2=10-2-6=2
At time =8
T1=10-1-8=1
T2=10-1-8=1
22. If decisions are made only at the time when the jobs
are released or completed, it does not follow the LST
rule all the time then it is called non restrict LST
algorithm.
If the scheduler were to follow the LST rule strictly, it
would have to monitor the slacks of all ready jobs
and compare them with slack of executing job.
It would reassign priorities to jobs whenever their
slacks change relative to each other.
23. From above example: At time t=2.6
Slack time for T1=4-0.4-2.6=1
Slack time for T2=5-1.5-2.6=0.9
The runtime overhead of the strict LST algorithm
includes the time required to monitor and compare
the slack of all ready jobs as the time progress.
24. Maximum Schedulable Utilization
A system is schedulable by an algorithm if the
algorithm always produces a feasible schedule of the
system.
25. Schedulable Utilization of the EDF Algorithm
A system T of independent, preemptable tasks with
relative deadlines equal to their respective periods
can be feasibly scheduled on one processor if and
only if its total utilization is equal to or less than 1.
When the relative deadlines of some tasks are less
than their period, the system may not be feasible,
even when its total utilization is less than 1.
For example : for task T1=(2,0.9),T2=(5, 2.3) is
feasible but it would not be schedulable if its relative
deadlines were 3 instead of 5.
26. The ratio of the execution time ek of a task Tk to the
minimum of its relative deadline Dk and period pk is
the density dk of the task.
In other words, the density of Tk is ek/min(Dk , pk).
The sum of the densities of all tasks in a system is
the density of the system and is denoted by ∆ when
Di < pi for some task Ti , ∆ > U.
If the density of a system is larger than 1, the system
may not be feasible.
27. Example: T1=(2,0.9); T2=(5,2.3,3);
∆ = 0.9/2+2.3/3 = 7.3/6 > 1, not feasible.
So the tasks are not schedulable by any algorithm.
Any system is feasible if its density is equal to or less
than 1.