priority driven scheduling of periodic tasks

27
STATIC ASSUMPTION FIXED PRIORITY VERSUS DYNAMIC PRIORITY ALGORITHM MAXIMUM SCHEDULABLE UTILIZATION OPTIMALITY OF RM AND DM ALGORITHMS SCHEDULABILITY TEST FOR FIXED PRIORITY TASKS SUFFICIENT SCHEDULABILITY CONDITION FOR THE RM AND DM ALGORITHMS PRACTICAL FACTOR Priority Driven Scheduling of Periodic Tasks

Upload: kamal-acharya

Post on 28-Jan-2018

213 views

Category:

Education


2 download

TRANSCRIPT

Page 1: Priority driven scheduling of periodic tasks

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 MA 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

Page 2: Priority driven scheduling of periodic tasks
Page 3: Priority driven scheduling of periodic tasks
Page 4: Priority driven scheduling of periodic tasks
Page 5: Priority driven scheduling of periodic tasks

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.

Page 6: Priority driven scheduling of periodic tasks
Page 7: Priority driven scheduling of periodic tasks

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.

Page 8: Priority driven scheduling of periodic tasks

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.

Page 9: Priority driven scheduling of periodic tasks

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.

Page 10: Priority driven scheduling of periodic tasks

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.

Page 11: Priority driven scheduling of periodic tasks

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.

Page 12: Priority driven scheduling of periodic tasks

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.

Page 13: Priority driven scheduling of periodic tasks
Page 14: Priority driven scheduling of periodic tasks

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.

Page 15: Priority driven scheduling of periodic tasks
Page 16: Priority driven scheduling of periodic tasks
Page 17: Priority driven scheduling of periodic tasks

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.

Page 18: Priority driven scheduling of periodic tasks

EDF Algorithm

The earlier its absolute deadline ,the higher the priority of the job.

Page 19: Priority driven scheduling of periodic tasks

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.

Page 20: Priority driven scheduling of periodic tasks

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

Page 21: Priority driven scheduling of periodic tasks

Time Ready Running

0 J1,1 J2,1 J1,1

1 J2,1 J2,1

2 J1,2 J2,1 J1,2

3 J2,1 J2,1

4 J1,3 J2,1 J2,1

4.5 J1,3 J1,3

5 J1,3 J2,2 J1,3

Time Ready Running

5.5 J2,2 J2,2

6 J1,4 J2,2 J1,4

7 J2,2 J2,2

8 J1,5 J2,2 J1,5

9 J2,2 J2,2

Page 22: Priority driven scheduling of periodic tasks

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.

Page 23: Priority driven scheduling of periodic tasks

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.

Page 24: Priority driven scheduling of periodic tasks

Maximum Schedulable Utilization

A system is schedulable by an algorithm if the algorithm always produces a feasible schedule of the system.

Page 25: Priority driven scheduling of periodic tasks

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.

Page 26: Priority driven scheduling of periodic tasks

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.

Page 27: Priority driven scheduling of periodic tasks

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.