Hardware Reference
In-Depth Information
In particular, the following issues have to be taken into account when comparing the
two approaches:
In many practical situations, such as I/O scheduling or communication in a shared
medium, either preemption is impossible or prohibitively expensive.
Preemption destroys program locality, increasing the runtime overhead due to
cache misses and pre-fetch mechanisms. As a consequence, worst-case execution
times (WCETs) are more difficult to characterize and predict [LHS + 98, RM06,
RM08, RM09].
The mutual exclusion problem is trivial in non-preemptive scheduling, which
naturally guarantees the exclusive access to shared resources. On the contrary,
to avoid unbounded priority inversion, preemptive scheduling requires the im-
plementation of specific concurrency control protocols for accessing shared re-
sources, as those presented in Chapter 7, which introduce additional overhead
and complexity.
In control applications, the input-output delay and jitter are minimized for all
tasks when using a non-preemptive scheduling discipline, since the interval be-
tween start time and finishing time is always equal to the task computation time
[BC07].
This simplifies control techniques for delay compensation at design
time.
Non-preemptive execution allows using stack sharing techniques [Bak91] to save
memory space in small embedded systems with stringent memory constraints
[GAGB01].
In summary, arbitrary preemptions can introduce a significant runtime overhead and
may cause high fluctuations in task execution times, so degrading system predictabil-
ity. In particular, at least four different types of costs need to be taken into account at
each preemption:
1. Scheduling cost . It is the time taken by the scheduling algorithm to suspend the
running task, insert it into the ready queue, switch the context, and dispatch the
new incoming task.
2. Pipeline cost . It accounts for the time taken to flush the processor pipeline when
the task is interrupted and the time taken to refill the pipeline when the task is
resumed.
3. Cache-related cost . It is the time taken to reload the cache lines evicted by the
preempting task. This time depends on the specific point in which preemption
occurs and on the number of preemptions experienced by the task [AG08, GA07].
Search WWH ::




Custom Search