1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded...

13
1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks Alexander Maxiaguine 4. May 2005

Transcript of 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded...

Page 1: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

1Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Embedded Systems

Exercise 2:Scheduling Real-Time Aperiodic

Tasks

Alexander Maxiaguine

4. May 2005

Page 2: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

2Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Definitions: RT Tasks

Tt

Arrival Time

Execution Time

t

Response Time

Deadline

Lateness

Page 3: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

3Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Overview

Scheduling aperiodic tasks with real-time constraints

Some known algorithms:

Page 4: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

4Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Earliest Due Date (EDD)

Optimization goal:– minimize the maximum lateness

Assumptions on the task set:– independent tasks– synchronous arrival times

EDD is non preemptive

Page 5: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

5Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Earliest Due Date (EDD)

T1t

T2t

T3t

t

Jackson’s rule: execute tasks in order of non decreasing

deadlines

T2T1

T3

Page 6: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

6Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Earliest Deadline First (EDF)

Optimization goal:– minimize the maximum lateness

Assumptions on the task set:– independent tasks– arbitrary arrival times (dynamic

arrivals)

EDF is preemptive

Page 7: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

7Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Earliest Deadline First (EDF)

T1t

T2t

T3t

t

Horn’s rule: at any instant execute the task with the earliest

absolute deadline

T2T1

T3

T1

Page 8: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

8Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Latest Deadline First (LDF)

Optimization goal:– minimize the maximum lateness

Assumptions on the task set:– tasks with precedence relations – synchronous arrival times

LDF is non preemptive

Page 9: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

9Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Latest Deadline First (LDF)

Main Idea [Lawler]: build the scheduling queue, at run time execute tasks from that queue

•Building the scheduling queue:

– proceed from tail to head

– among the tasks without successors or whose successors have been all scheduled, select the task with the latest deadline to be scheduled last

– repeat the procedure until all tasks in the set are selected

T2

T3T1

Page 10: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

10Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Latest Deadline First (LDF)Building the scheduling queue (example):

A

B

C

D

E

A B C D E

di 4 4 8 12

15

deadlines DAG

Scheduling Queue:

A

E

D

C

B

runt-time scheduler

Page 11: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

11Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Ealiest Deadline First (EDF*)

Optimization goal:– minimize the maximum lateness

Assumptions on the task set:– tasks with precedence relations – arbitrary arrival times

EDF* is preemptive

Page 12: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

12Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Earliest Deadline First (EDF*)Main idea:

modify deadlines and arrival times to satisfy the precedence constraints and then use EDF

T2

T3T1

Modifying deadlines:Task must finish the execution within its deadlineTask must not finish the execution later than the maximum start time of its successor

T1t

T2t

T3t

Page 13: 1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.

13Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Earliest Deadline First (EDF*)Main idea:

modify deadlines and arrival times to satisfy the precedence constraints and then use EDF

T2

T3T1

Modifying arrival times:Task must start the execution not earlier than its release time. Task must not start the execution earlier than the minimum finishing time of its predecessors.

T1t

T2t

tT3