6. a pplication mapping 6.1 problem definition 6.2 scheduling in real-time systems 6.3...
TRANSCRIPT
![Page 1: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/1.jpg)
6. A
pplica
tion M
appin
g
1
6. APPLICATION MAPPING
6.1 Problem definition
6.2 Scheduling in real-time systems
6.3 Hardware/software partitioning
6.4 Mapping to heterogeneous multi-proces-sors
![Page 2: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/2.jpg)
2
6. A
pplica
tion M
appin
g6.1 PROBLEM DEFINITION
Find: A mapping of applications to processors, Appropriate scheduling techniques (if not fixed), and A target architecture (if not fixed)
Objectives: Keeping deadlines and/or maximizing performance, as well
as Minimizing cost, energy consumption, and possibly other ob-
jectives. The application mapping problem is a very difficult one
and currently only approximated for an automated map-ping are available. Standard scheduling techniques, Hardware/software partitioning, and Advanced techniques for mapping sets of applications onto
multi-processor systems.
![Page 3: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/3.jpg)
3
6. A
pplica
tion M
appin
g6.2 SCHEDULING IN REAL-TIME SYSTEMS
Scheduling is one of the key issues in implementing embedded systems. Scheduling defines start times for each task and therefore defines a
mapping from nodes of a task graph G=(V, E) to time domain Dt:
: V Dt (6.1)
6.2.1 Classification of scheduling algorithms Classes of scheduling algorithms
real-time scheduling
hard deadlines soft deadlines
periodic aperiodic
preemptive Non-preemptive preemptive Non-preemptive
static dynamic static dynamic static dynamic static dynamic
![Page 4: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/4.jpg)
4
6. A
pplica
tion M
appin
g
6.2.2 Aperiodic scheduling without precedence constraints
6.2.2.1 Definitions {Ti}, a set of tasks
ci be the execution time of Ti,
di be the deadline-interval,
li be the laxity or slack, defined as
6.2.2.2 Earliest Due Date (EDD) – Algorithm Jackson’s rule:
Given a set of a independent tasks, any algorithm that executes the tasks in order of non-decreasing deadlines is optimal with respect to minimizing the maximum lateness.
(6.2)i i il d c
Availability of Task
di
ci lit
![Page 5: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/5.jpg)
5
6. A
pplica
tion M
appin
g6.2.2.3 Earliest Deadline First (EDF) – Algorithm The Earliest Deadline First (EDF) algorithm is optimal with respect to minimizing the
maximum lateness. Given a set of n independent tasks with arbitrary arrival times, any algorithm that at any
instant executes the task with the earliest absolute deadline among all the ready tasks is optimal with respect to minimizing the maximum lateness.
EDF is a dynamic scheduling algorithm. Fig. 6.6 shows a schedule derived with the EDF algorithm. Vertical arrows indicate the ar-
rival of tasks.
![Page 6: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/6.jpg)
6
6. A
pplica
tion M
appin
g6.2.2.4 Least Laxity (LL) algorithm Priorities = decreasing function of the laxity
(lower laxity higher priority); changing priority; preemptive. Fig. 6.6 shows an example of an LL schedule, together with the compu-
tations of the laxity.
![Page 7: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/7.jpg)
7
6. A
pplica
tion M
appin
g6.2.2.5 Scheduling without preemption• T1: periodic, c1 = 2, p1 = 4, d1 = 4
• T2: occasionally available at times 4*n+1, c2= 1, d2= 1
• T1 has to start at t =0 deadline missed, but schedule is possible (start T2 first) scheduler is not optimal contradiction! q.e.d.
![Page 8: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/8.jpg)
8
6. A
pplica
tion M
appin
g
6.2.3 Aperiodic scheduling with precedence constraints
6.2.3.1 Latest Deadline First (LDF) algorithm In a task graph reflecting tasks dependences (Fig. 6.11). Task T3 can be executed only af-
ter tasks T1 and T2 have completed and sent message to T1.
6.2.3.2 As-soon-as-possible (ASAP) scheduling Consider a 33 matrix.
a b c
A d e f
g h i
![Page 9: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/9.jpg)
9
6. A
pplica
tion M
appin
g The determinant det(A) of this matrix can be computed as
ASAP schedule for the example of det(A)
det( ) ( ) ( ) ( )A a e i f h b f g d i c d h e g
e i a f h b g d c
- - -
+
+
=1
=3
=4
=6
=7
![Page 10: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/10.jpg)
10
6.2.4 Periodic scheduling without precedence constraints
6.2.4.1 Notation Let {Ti } be a set of tasks. Let:
pi be the period of task Ti, ci be the execution time of Ti , di be the deadline interval, that is,
the time between Ti becoming available and the time until which Ti has to finish execution.
li be the laxity or slack, defined as li = di - ci
fi be the finishing time.
Let denote the utilization for a set of n processes, that is, the accumulated ex-ecution times of these processes divided by their period:
6. A
pplica
tion M
appin
g
li
pi
ci
di
ti
1
ni
i i
c
p
![Page 11: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/11.jpg)
11
6. A
pplica
tion M
appin
g
m• Necessary condition for schedulability (with m=number of pro-
cessors):
6.2.4.2 Rate monotonic scheduling• RM policy: The priority of a task is a monotonically decreasing function of its pe-
riod.
• At any time, a highest priority task among all those that are ready for execution is allocated.
T1 preempts T2 and T3.T2 and T3 do not preempt each other.
![Page 12: 6. A PPLICATION MAPPING 6.1 Problem definition 6.2 Scheduling in real-time systems 6.3 Hardware/software partitioning 6.4 Mapping to heterogeneous multi-processors](https://reader036.vdocuments.net/reader036/viewer/2022070411/56649f2f5503460f94c49375/html5/thumbnails/12.jpg)
12
6. A
pplica
tion M
appin
g
6.2.4.3 Earliest deadline first scheduling
EDF can also be applied to periodic scheduling.
EDF optimal for every hyper-period(= least common multiple of all periods)
Optimal for periodic scheduling
EDF must be able to schedule the example in which RMS failed.
At time 5, T2 not preempted, due to its earlier deadline.