Hardware Reference
In-Depth Information
algorithm, this number can be estimated off-line as a function of tasks' timing con-
straints. If N i is the maximum number of preemptions that a periodic task τ i may
experience in each period, and δ is the time needed to perform a context switch, the
total utilization factor (overhead included) of a periodic task set can be computed as
+ δ
.
n
n
n
C i + δN i
T i
C i
T i
N i
T i
U tot
=
+ U t
=
+ U t
i =1
i =1
i =1
Hence, we can write
U tot = U p + U ov ,
where U p is the utilization factor of the periodic task set and U ov is a correction factor
that considers the effects of the timer handling routine and the preemption overhead
due to intrinsic context switches (explicit context switches are already considered in
the C i 's terms):
n
N i
T i
U ov = U t + δ
.
i =1
Finally, notice that an upper bound for the number of preemptions N i on a task τ i can
be computed as
T i
T k
.
i− 1
N i
=
k =1
However, this bound is too pessimistic, and better bounds can be found for particular
scheduling algorithms.
10.7.1
ACCOUNTING FOR INTERRUPT
Two basic approaches can be used to handle interrupts coming from external devices.
One method consists of associating an aperiodic or sporadic task to each source of in-
terrupt. This task is responsible for handling the device and is subject to the scheduling
algorithm as any other task in the system. With this method, the cost for handling the
interrupt is automatically taken into account by the guarantee mechanism, but the task
may not start immediately, due to the presence of higher-priority hard tasks. This
method cannot be used for those devices that require immediate service for avoiding
data loss.
Another approach allows interrupt handling routines to preempt the current task and
execute immediately at the highest priority. This method minimizes the interrupt la-
tency, but the interrupt handling cost has to be explicitly considered in the guarantee
of the hard tasks.
Search WWH ::




Custom Search