Kwei-Jay Lin and Ansgm Herkert+

Proceedings ofthe 29th Annual Hawaii International Conferenceon SystemSciences- 1996
Jitter
Control
in Time-Triggered
Systems*
Kwei-Jay Lin and Ansgm Herkert+
Department
of Electrical and Computer Engineering
University of California,
Irvine
Irvine, CA 92717, U.S.A.
Abstract
For systems tl1a.t are used in applications such as
a.vionic systems, automated factories, intelligent vehicles etc., fa.ult tolera.nce is another important requirement t.1la.t must be satisfied. An autonomous real-time
system must be a.ble to detect faults as early as possible a.nd to a.void unsafe operations. Systems designed
to be jitterless can discover faults as soon as an expected event did not occur. In comparison, systems
tha.t allow jitters will have to wa.it longer before they
ca.n be sure tl1a.t something bad has ha.ppened. For
sa.fety-critical systems, the extra time gained from an
earlier fa.ult detection a.nd recovery could make the
difference between a. success and a disaster.
This paper addresses the jitter control issue in timetriggered real-time systems where tasks are activa.ted
according to time, Our model is based on the tem.poral distance constrained iask model (DCTS). However,
many real-time systems hrave tasks that do not fit the
simple assumptions of th,fe DCTS model because tasks
may occasionally access shared resources, an.d certain
tasks may arrive irregularly.
In this paper, We address the issues that cause jitters in DCTS. We first
review the algorithm developed for DCTS and present
an extension for an optimal algorithm.
Three jitter
issues are then discussea!: sharing resources between
tasks, handling tasks that have fixed and unchangeable
periods, and handling ta.sks that arrive aperiodically.
We present soluti0n.s that can prevent jitters, as well
as other solutions that may result in m.inor jitters.
1
This pa.per a.ddresses the jitter control issue in timet.riggered real-time systems [KG941 where tasks are
act,iva.ted a.ccording to time. Our model is based on
the tempora.1 distan.ce constrained task model (DCTS)
[HL92] in which the dista,nce between any two consecutive finishing times of the same task must be less than
or equal to a cert,ain value. In [HL92], the pinwheel
scheduling algorithms [CC93, CC92, HM89] have been
used t,o schedule periodic dista.nce-constrained tasks.
The a.lgorithm transforms a. set of a.rbitrary distance
coustra.ints into a corresponding set which has smaller
but, easier-to-schedule distance constraints. Using this
a.pproa.ch, tasks can be scheduled using the prioritydriven mechanism a.t run time, yet the task execution
schedule is very predicta,ble a.nd has no jitter.
Introduction
In real-time systems, the t.imeliness of computations is as crucial as the correct,ness of t,heir results; a.
late result is often a. wrong
result. For ma.iiy sa.fetycritical applications,
syst,em oiitput,s must be produced in regular intervals t,o meet human expectations or to maintain the system sta.bilit(y. This is true
for systems with real-time sensors a.nd a.ctua.tors t.ha,t
must execute smoothly (,e.g. robot8s tha.t ca.rry sensitive chemical objects). Other exa.mples include multimedia systems where a video fra.me present.ed too ea.rly
or too late will result in ja.gged motion perceptions.
The unpredictable dela.y;s, or jitters, a.re una.ccepta.ble
in many real-time embedded systems.
However, ma.ny rea,l-t,ime systems have tasks that
do not. fit, the simple assumptions of the DCTS model
beca.use some tasks must, occasionally access sha.red resources exclusively, a.nd certain tasks may a.rrive spora.dica.lly. It is thus impossible for systems to always
prevent jitters using the simple DCTS model.
To
ma.ke DCTS a pra.ctica.1 and useful scheduling model,
we need to a.ddress these pra.ctica,l system issues. In
this pa.per, we a.ddress the three issues that may cause
jitters in DCTS: shazing resources between tasks, hanclliug ta.sks that ha.ve fixed and unchangeable periods,
and lmndling tasks that arrive aperiodically. We
present solutions tha,t ca.n prevent jitters totally, and
*This work was supported
in part by cont.racts from t,he
Office of Naval Research NOO014-94-1-0034
and N00014-95-l0262, Hughes Aircraft/UC
MICR.0
94-082, and the 1JS Navy
NSWCDD
N60921-94-M-1261
and N60921-94-M-2714.
t Work done when the second co-aut,hor was at, t,he IJniversiby
of Illinois, Urbana-Champaign.
1060-3425196 $5.00 0 1996 IEEE
451
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE
Proceedings of the 29th Annual Hawaii International Conferenceon SystemSciences- 1996
time
sch.edule
some solutions that may result in minor jitters.
The rest of the paper is organized as follows. In
Section 2, we provide some ba.ckground on real-time
scheduling. The DC scheduling a.lgorithms are introduced with also a. new optima.1 algorithm. We discuss
how to handle ma.ny practica.1 syst.em design issues using the DCTS model in Section 3. The paper is concluded in Section 4.
2
Time-Triggered
Event-
vs.
.;. ,8,,9,
.;. &
task (period = 4) schedule
systems more subject to overloads. This is true especia.lly when systems are under-stress, i.e. many critical
event.s happen at the same time and all must be handled immediately. If a system is not designed to adequa.tely respond to the situation in a timely manner,
more urgent events may occur a.nd cause the system
t,o escalate into more trouble or even to crash.
In comparison, time-triggered systems have a more
predicta.ble schedule. Regardless of the system load
and environmental uncertainty, tasks are executed according to a pre-defined schedule. Tasks therefore are
designed to ha.ndle only the most urgent events between task activa.tions. If a system has more events
than the tasks a.re designed to handle, only the predefined events will be ha.ndled.
One important benefit of using the time-triggered
protocol is the earlier fault detection and recovery.
Since users and tasks know when and what to expect. from the time-triggered
schedule, an error can
be detected as soon as a.n event, misses the schedule.
Time-triggered systems in general have less jitter than
event,-triggered systems. Less jitter makes fault detection and recovery easier and earlier. Again for safetycrit.ica.1 systems, this is a very important measure of
success.
Scheduling
time-triggered
.;.1;1,h
Figure 1: A periodic
Many different types of timing constraints ma.y be
defined in rea,l-time systems. The most commonly defined constra.int is t#he dea.dline which specifies when
a task must be finished. Ta.sks may also ha.ve ready
times when they can st,a.rt to be execut.ed. Some tasks
have periods on how often they should be executed or
distances on how fa.r apa.rt a.ny two consecutive esecutions can be. Scheduling a.lgorit.1un.s ha.ve been designed to schedule ta.sks with specific types of timing
constraints.
Two scheduling models a.re used in many existing
the cyclic executive
real-time
systems:
(GE) model [BS89] a.nd the fixed priorit,y (FP)
Using the CE model, a.pplica.tions
model [SG90].
are divided into a. sequence of non-preempta.ble tasks.
Tasks are activa.ted in a, fixed order as set in the preThe c.yclic schedule is redefined cyclic schedule.
peated forever a.nd usua.lly does not change a.t.run time
unless special a.ctions are needed. The FP model uses
the priority-driven
scheduling so t,ha.t no pre-defined
schedule exists. Among all rea.dy t.asks, the t,ask with
the highest priority is executed. A task being execut,ed
may be preempted if a. higher pri0rit.y t.a.sk becomes
ready.
Of the two models mentioned above, the CE model
is time-triggered
since tasks a.re pre-scheduled. a.nd
triggered by time, while the FP model is event.triggered since the cont,ent of t,he scheduling rea.dy
queue is the result. of a.ctua.1 even&. In t,his section,
we review and compa.re the event.-triggered and t,imetriggered scheduling schemes. In pa.rt,icula.r, we disCUSS the dista.nce-const,ra.inecl scheduling model as one
of the time-triggered scheduling schemes.
2.1
,l,
2.2
Rate-Monotonic
Scheduling
One of the most commonly-used
event-triggered
model is the rat,e monotonic fixed priority
(RM)
model [LS89]. Using RM, a system is implemented
a.s a set of periodic preempta.ble tasks. The execution
of a. task in one period is independent of the execution of the same ta.sk in another period. Although
every t-ask must be completed before the end of each
period, there is no constra.int, on when in the period
it must be executed. This is because the completion
t.ime of a lower priority task in each period depends
011 if a.nd when some higher priority
tasks may arrive
[LS89, Bu91]. Therefore, task execution jitters are una.voidable using RM.
For exa.mple (Figure l), a. task could be executed
a.t. t,he end of its previous period, then immediately at
t,he beginning of the current period, but not aga.in until
t,he end of t.he next period. This makes it difficult for
t.he client of a periodic server task to expect results
a.nd t(o detect faults. In Figure 1, the longest inter-
systelns
It ha.s been suggest,ed [KG941 that event-t.riggered
systems a.re more flexible a,nd responsive: systems only
respond to events tha,t do occur and wit.11 a. high priority. On the other hand, event-triggered syst.ems ma.ke
452
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE
Proceedings of the 29th Annual Hawaii International Conferenceon SystemSciences- 1996
completion time is 7 for a task of period 4. If Tl fails
at time 6, a client must wait until time 12 to be sure of
that. Since the client and the periodic server usua.lly
are not synchronized (i.e:. the client does not know
when a server period sta.rts a.nd ends), it must wa.it
until the end of two task periods to be certa.in tha,t
the server is not working any more. In other words,
the fault detection delay for the clients of t#a.skTi with
period Pi and execution time ei is 2Pi - ei.
2.3
The Distance-Constrained
Model
(DC)
The distance between two Tl’s is 3. Similarly,
6, 6, 6) is also schedula.ble.
Example
1 Given A = {3,7,8,14}.
We can specialize it with respect to (3) and get B = (3, 6,
6, 12). A can also be scheduled by B’ = { 3, 3,
6, 6). However, solution B is more eficient since
a.2 = 7 < b2 = 6 < bi = 3.
As another example, suppose A = (4, 7, 8, 13, 24
}, we can specialize it with respect to (4) and schedule
it by B = (4, 4, 8, 8, 16). We can also schedule it as
0
(4, 6, 6, 6, 61.
Task
From these exa.mples, we know that a pinwheel
problem may have many solutions. The difference between different a.lgorithms is their schedula.bility condit,ions.
I-Ian and Lin [HL92] have developed a scheduler Sr
for DC t,a.sk sets ba.sed on the pinwheel algorithms. Sr
a.llows rea.1 uumber distance constra.ints a.nd execution
t,imes. Furthermore, it specia,lizes with respect to a
real number r a,nd chooses the best r which has to
be in the interval (c1/2, cl]. The scheduler Sr ca.n be
found in [HL92]. We show a.n example of Sr below.
Many real-time systems must, guarantee tha.t certain tasks are executed with a. bounded inter-execution
interval. We call such constra.ints a.s the temporal distance constraint (DC). In t,he DC ta.sk model, a rea,ltime system has a set of ta.sks T = {Tl, T2, . . . . T,,}.
Every task Ti consists of a. sequence of jobs Jil 1 Jig,
Ji3,..-, each with an execution t.ime ei. Ta.sk Ti has
distance constraint ci, i.e. the dist.a.nce between t,wo
consecutive jobs of a. ta.sk must, be less than ci. The
distance between two jobs is the difference of their
finish times. Let fij denote the finish time of job Jij.
Suppose task Ti starts at time 0, the dist,ance constraint requires tha.t fil 1s ci and fi,j+l - fij < c;, for
all j 2 1. We assume tha.t there is a, precedence constraint between two consecutive jobs, i.e., job Ji,j+l
can be started only a.fter job JQ ha.s been finished.
Moreover, jobs a.re preempt,a.ble.
2.3.1
Adopting
Pinwheel
(4, 4,
((4, l), (7,3), (18,3)}
Example
2 Suppose T =
p(T) M 0.85 and
where z is defined by (ci, ei).
C = {4,7,18}.
Usin,g Sr, T is specialized as ((3.5, l),
(7,3)? ( 14,3)} = {A, B, C}. The resulting schedule is
sh.oum in Figure 2. The com.pletion times of A are 1,
4..5, 8, 11.5, which has a fixed distance of 3.5, satisfying ihe original distance constraint 4 and jitterless.
The completion iimes of B are 5, 12, 19, . . . . with a jitterless distance of 7. Tlt,e completion times of C are
0
13.27, . . . with a jitterless distance of 14.
Algorithms
Our scheduling a.pproach for DC tasks is ba.sed on the
algorithms designed for the pin&eel problem which is
defined as follows [HMN]. Criven a. multiset of 11.positive integers A = {al, ~2, . . , a.,,), the pinwheel problem is to find an infinite sequence (schedule) over the
symbols {l, 2,..., n) such tha.t t,liere is a.t least one
symbol i within a.ny subsequence of ui consecutive
symbols (slots). Moreover, preempt,ion is not a.llowed.
Several algorithms ha.ve been presented [CC93, CC921
e.g. Sa, Sx, Sbc, Shy, and Sxy. All of these algorithms use a specialization technique to find a corresponding multiset B = { bl, bat . . . . b,} such tha.t for all
i, bi 5 ai. The specia.lized mult,iset B is thus more
strict in terms of distance constraints than A. B usually has some nice properties, so tha.t it, can be easily scheduled. Two such properties a.re: it consists
solely of multiples, or is composed of two distinct, iutegers [CC93, CC92]. For example, { 3, 3, 6, 6) can be
schedule as “Tl, T2, T3, Tl , T?, Td” and repea.ts forever.
After speciahzing T int,o T’, we ca.n easily schedule
T’ a.8 a, pinwheel instance using on-line schedulers as
shown in [HM89]. The demity of DC task Ti is defined
a.s p(Ti) = 2. For Sr, the following schedulability
bound ha.s been found [HL92].
1 Given a DC task set T of 11. tasks, if
72(2l/” - l), then. Sch.ednler Sr is guaranteed to jind a fea&ble schedule for T.
Tlleorem
p(T) I=
2.3.2
An Optimal
Sr Algorithm
The proved schedulability
bound of Sr is the worst
ca.se bound. In other words, a. ta.sk set with a utilizat,ion higher than the bound may still be schedulable
using Sr. Moreover, there a.re ta.sk sets that are not
schedula.ble using Sr but, caa be scheduled by other
schedulers. For exa.mple Sr ca,nnot find a schedule for
453
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE
Proceedings of the 29th Annual Hawaii International
1234567
IAl
B
8
IAIBl
9
Conference on System Sciences -
1996
10 11 12 1.9 14
Cl-
Figure 2: DC schedule for Exa.mple 2
Algorithm
1
2
3
4
5
6
7
8
9
10
11
12
Srb
min + co, opt-b + 2, opt-x +-- 1
Base-Set + {2,3,5,6,7,.
‘. , l%/ClJ>
repeat {
b +- one of the elements in Base-Set
Base-Set +-- Ba.se-Set, - b
run Sr with ba.se b
if (resulting utilization < min) then
min +- resulting ut.iliza.tion
opt-b - b
opt-x +- x
1
until Base-Set = {}
Figure 3: Algorithm
L
0.2
for Scheduler Srb
Figure 4: Avera.ge utiliza.tion
the ta.sk set {(7,4), (21, B), (64,9)}, even though the
set can be scheduled a.s {(7,4), (21,G), (63,9)}. This
is because Sr uses a ba,se of 2. Sr ca.n be extended so
that it tries all possible ba.ses of the task set; i.e. the
bases 2,3,5,6,7,10,11,12,.
, [c,~/c~]. Bases greater
than [cn/clJ do not need to be considered since the
base [cn/clJ will a.lrea.dy result in a. schedule with only
two different ci’s. La.rger ba.ses will only restrict the
ci even further and t#herefore reduce the schedula.bility
of the resulting set.
An optimal a.lgorithm Srb is shown in Figure 3. Srb
tries to minimize the function f(b)
0.6
Utilization
0.6
increase with Sr and Srb
All proofs in this pa.per a.re omitted due to the spa.ce
limitation.
To analyze and compa.re Srb a,nd Sr we randomly
genera.ted sa.mple ta.sk set,s a.nd specialized them by
both schedulers. We set the minimum number of tuples in a. task set to 5 and the utilizations between
0.1 a.nd 1. The maximum utilization for a task in the
set, is ra.ndomly va.ried between 0.025 and 0.5. A tota.l of 4746 sets ha.ve been generated and scheduled.
The distance constraints of the tasks are set to be
in t,he interval (0, . , lOOO]. Utilization and distance
const,rabnt are both set to have a precision of 2 digits
after t.he decimal point.
where
b E {2,3,5,
0.4
Original
In Figure 4, we compare the performance of Srb and
Sr. Srb has a slightly better schedula.bility and lower
utiliza.tion increase tha.n Sr on a.vera.ge. The figure
shows that there is a drop in the average utilization
increase when t,he original ut,ilization is ,greater than
177.2.This is misleading since t.he number is counted by
the tota. increase divided by the number of schedulable sets. As less sets a.re schedulable when the original
ut,iliza.tion is greater tha.n ln.2, the ca.lcula.ted average
v&e is not quite correct. This can be seen from Figure 5 where we show the percentage of schedulable
task set,s.
” ., [Cn/ClJ>.
x is chosen with respect, to t.he ba.se 6, i.e. we ha.ve
to find the b and x tha.t give t,he set. {(z, et), (X .
b-+2,e2), . . ) (32 tin , e,,)} the minimum utilization.
In
this way, Srb provides the optima.1 result.
Theorem
2 Given n daslnwe constrained task set T,
if Srb does not find a. sched,ule for T then ILO scheduler
based on the pinwheel-problem u!%th single-ll.mmber reduction can find a sched~ule.
454
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE
Proceedings of the 29th Annual Hawaii International Conferenceon SystemSciences- 1996
ta.sk which ma,y lock the resource. A job J may lock a
resource only if the job’s priority is strictly higher than
the priority ceilings of all resources currently locked
by other jobs. If not, the job holding the lock on the
resource with the highest priority ceiling will be execut.ed by inheriting J’s priority.
A similar approach can be used for DCTS. There
a.re two ba.sic strategies to the resource sharing problem for DC ta.sks.
1. Always expect the worst. case blocking and thus
include it as a pa.rt of the normal execution time.
If in fa.ct no blocking is necessa.ry, the system is
left idle to meet the no-jitter requirement.
2. Allow some small degree of jitter and use only
the priority inheritance protocol to shorten the
blocking. As long as all DC ta.sks are in-phase,
i.e. t,heir first jobs a,re rea.cly a.t the sa.me time, we
can show tl1a.t a.ny ta.sk will be blocked at most
once. Thus it is not necessary to use the PCP to
gua.ra.ntee the single blocking property.
Figure 5: Percentage of schedula.ble tasks wit,h origina.1
utilization > In 2
3
Jitter
Control
ifor DCTS
As we have discussed ea.rlier, ma,ny real-time systems need to have well-controlled execution schedules
with no or low jitters.
In the previous section, we
show that DCTS produces jitterless schedules for DC
tasks. However, we assume tha.t each ta.sk can he
executed with a modified tempora.1 dist,ance tl1a.t. is
smaller than its original dista.nce constra.int. Moreover, the resource sharing l1a.s not been considered in
the model. In some pra.ct.ica.1 systems, tasks must a.ccess shared resources in a. mut,ua.l exclusive ma.nner,
and some of the ta.sks cannot, be executed wit,h a. period shorter than their original period. In this sect,iou,
we discuss how systems can handle these types of tasks
under the distance constra.ined scheduling fra.mework.
3.1
Support
of Resource
(a) No jitter
solution
In t*his ca.se we increase the run-time of the highest
pri0rit.y job which uses a given critical section (CS)
by t,he length of the CS. If a job uses more than 1
CX the maximum of the lengths of the CS’s which
a,re not, used by a.ny higher priority job is chosen.
Define SLa a,s t,he set, of sema.phores S accessed by
Ti. The potential blocking set of Ti is Z’i = {S]S E
SLi a.nd S E SLI,, b > i} then the blocking set of T;
From this we ca.n derive the
is Bi = Zi --UkciZk.
ma.ximum blocking length a.s bi = max{ IS]}, S E Bi.
The schedula.bility bound is then
2
e; + b;
7
5 n(21’n - 1)
i=l
Sharing
This mea.ns the execution time of a. job Ti is prolonged by its ma.ximum blocking length giving a new
esecut,ion time of ei = ei + bi. The jobs thus ha.ve
enough time to finish before their deadlines even if
they a.re blocked.
For exa.mple if we have a task
set, {A(% 2, [$I), B(8,2,
[Sl, &I), C(W2,
[SI, S23>,
D( 16,2, [&I), E(32,2, [S,, S,])} with CS lengths of
]Si] = 1. 15’s] = 1, then t.he resulting set is {A(8,3),
B(8,3), C(lG, l), D(l6,2),
E(32,2)} (Figure 6(b)).
During the execution of the system, when the
scheduler wants to run a job it checks if a.ny of the
resources the job needs to use a.re being used before
st.arting t#he job. If all resources a.re availa,ble then the
scheduler let#s the job wait, volunta.rily for the length
of the CS before st,a.rting its execution (but no other
Real-time systems ha,ve limited resources t,hat a.re
shared by a.11tasks. Some of t,he resources can be
used by only one task at a. t,ime. As a. result, ta.sks
may be forced to wa.it (blocX:ed) if a. resource in need
has been locked by another ta.sk. In a. fixed priorit,y
real-time system, priority inversion [SR90] ma.y occur
when a high-priority
task is blocked by a. low-priority
task due to resource sharing. The p~ior&~ ceili7j.g protocol (PCP) [SR90] ha,s been proposed to control t,he
unpredictable priority inversion delays. PCP reduces
the number of priority inversions and limits t*heir ma.ximum duration; it thus ma.kes the syst*em’s beha.vior
predictable.
Using PCF’, a. priority ceiling is defined
for every resource a.s the priority of t,lie highest, pri0rit.y
455
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE
Proceedings of the 29th Annual Hawaii International
15
(a)
I:lAl~~,/~lD/~~~//$$$$$
(b)
ml--i
aAAbBBCD
‘1
aAAbBBDE
1 1 1
1
1
.
17
Conference on System Sciences -
. 19
21
1
l/AlAlBlBlClDlDhl
1
111aAAbBBCD
1 1 1
. 23
.
25
. 27
. 29
AlAjBlB
1
1
1996
. 31
.
,
,
,
,
,
,
,
,
,
,
,
1
1 Il-lIrllll-11
aAAbBBDE
Resource conflicts between D and B at times 12 and 28.
AAbBBCD
AAbBBCD
(c)
{AIAIBIBIc[DIDIEIIA/AIBIBIEI
,
,
1[~1~1~1~1~1~1~~~[
Resource conflict between E and A at time 9.
Resource conflict bet,ween E a.nd B at time 11.
AlAlBjBjClDlDlEjl
,
,
~[A~A~B~B~CT~D~D
Figure G: Schedules for Example 3 (a.) No CS (1~) No jitter
Example
periodic job is a.llowed t,o esecut,e). If a.ny is used the
scheduler assigns the job holding the resource with
the priority of the job t,o be scheduled (priority inheritance).
Tasks t,ha.t execut,ed with t,he inherited
priority must be delayed, for t,he length of time they
had executed with the inherited priority, a.t the end
of their execution before completion. This gua.ra.ntees
the exa.ct dista.nce constra.int*s. In a.11a.bove voluntary
waiting periods a,periodic jobs can execute and ma.ke
use of the available ba.ndwidth.
B(8,2.
Cl
c2
ci
c; -
(c) Jitter
allowed
3 Give71 a set of tasks T = {A(8,2,
[SI,
Sz&
C(lR
1,
[Sl,
&I),
D(16,2,
[S,]),
[S21),
C(lG, 2), D(lG, 2), E(32,2,}
and Tb = {A(8,3),
B(.8,2)? C(16,2),
D(16,2),
E(32,2)}.
The schedvies 7l.sin.g diflerent schem.es are shown in Figure 6.
FigTrre 6(a) sh.ows the originnl DC schedule. Figure 6(b) shows the schedule with time reserved for resource sharing. Boxes with lowercase task names denote times a task is idling to m.aintain its jitterless
collsiraint.
Figure 6(c) sh.ows th.e DC sch,edule with
delcryed execution for tasks A and B.
3.2
Handling
Tasks
Non-Distance-Constrained
In some rea.l-time systems, in a.ddition to tasks with
distance constraints (DC tasks), there may be tasks
t$hat need to be run in a fixed rate, i.e. exactly once in
each of their periods (FR tasks). For exa.mple, many
of the sensors (like ra.da.rs) have mechanical components t)hat can produce da.ta. only at a fixed rate. If
we schedule a task to be executed a,t a rate higher than
the da.ta arrival rate, there will be some wasted extra
executions since new da.ta. a.re not yet available. We
therefore want to schedule such tasks exactly once in
ea.& of their original period.
Unfortuna.tely, it, is impossible to find a jitterless
schedule for fixed rate tasks in general, as in the following theorem.
bound in this case is t,hen
‘Jif 1_< i -< 12
, 2 + ez+ ...5 + !! < qp/i -
solution
E(32,2,
[Sl, Sz])} with, CS le7zgth.s of ISll = 1, l&l =
1 HUEh.ave the resdtin.g sets of T, = {A($, 3), B(8,3),
(b) Jitter solution
In the ca.se tha.t a. slight. jitter is a.llowed, we can
reduce the increa.se in execution time for the jobs. The
possible jitter for each job is t,he masimum length of a
CS of higher priority jobs or of the job itself If Bi is
the worst-case blocking of T! then di, the contributed
delay of Ti, is defined by:
The schedulability
/A/A~B~B~
1) (4)
To construct the task set for t,hese a.lgorithms we
first determine the ma.ximum blocking lengths bi a,nd
contributed
dela.ys d; respect,ively.
They a.re then
a.dded to the execution times of t.he t.a.sks (bi in ca.se (a.)
and da in the case (b)) f or scheduling. With the result,ing specialized ta.sk set we caa check the schedulabi1it.y
of the set and then execute t#he syst,em (t.he utilizat,ion
after specia.liza.tion must be 5 1 to be schedula.ble).
Theorem
456
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE
3 Given t,wo fixed ra.te tasks, if their peri-
Proceedings qf the 29th Annual Hawaii International
123450’
pq-q-qm
Figure 7: Schedule for non-multiple
Conference on System Sciences -
1996
Example
4 T = ((6, l), (7,2), (8,2), (11,l)).
The
first frc~otasks A and B are defined with distance constroints alad the second two tasks C and D with fixed
raie. Affer specialization by Sr, Tl becomes ((6, l),
(6,2), (6,2), (6, 1)). We then reassign th.e original
periods to the FR tasks, T2 = ((6, l), (6,2), (8,2),
(11,l)).
The schedules for Tl and T2 are shown in
Figure 8.
At time 16, C is scheduled in Tl but is n.ot ready
for execution until time 17. So the third period of C
is executed at time 17-18 in Tz. Similarly, the third
instance of D is executed at time 23 in Tz, since it
is not ready until then.. Th.e resulting schedule T2 has
no jitter for tasks A an,d B. For C and D, they are
guaranteed to be executed owe in each period.
0
ra.te ta.sks
ods are not multiple numbers, it is impossible to find
a jitterless schedule for both tasks.
A simple exa,mple is two unit,-time tSa.skswith periods 2 and 3 (Figure 7). If ‘Tl is scheduled a.t time 1, 3,
5, etc. The first time Tz ca.11be scheduled is at t,ime
2. Ideally, T2 then should be scheduled a.t 5, which
is occupied by Tl. ThereTore, T:! must. he scheduled
at 4, and then 6, etc. In other words, Tz caa only be
scheduled as a ta,sk of period 2. Anot.her example is
two unit-time ta.sks with periods 2 a.nd 5. Again Tl
is scheduled at time 1, 3, 5, 7, et%c. T2 is t,hen schecluled at time 2. But the next time 7 is a.lrea.dy used.
So Tz will have to be scheduled a.t 6, with a dist,a.nce
constraint 4, not 5.
On the other ha.nd, if T? is scheduled as a. periodic
task, i.e. jitter is allowed, we ca.n use the schedule
for an equiva.lent ta.sk T: wit.11 the periocl of Tt, a.s the
distance constra.int for T$ We can prove tha.t t,here
will be enough time slots reserved f’or TJ to meet, itSs
periodic constra.int [IIL941.
In some applica.tions not a.11DC tasks have shorter
periods than FR ta.sks. In tha.t ca.se, we still need
t,o schedule DC tasks wit,11 higher priorities to satisfy
t,he no-jit.ter requirement.
There a.re two basic approaches for this problem. The first is to promote the
priorities of long-period DC tasks by splitting their
comput.a.tions into two or more subtasks with shorter
periods. The other is to a.ssign a.11DC tasks with priorit.ies higher tha.n those of a.ll FR tasks. The latter
approach may ca.use the FR t,a.sks to miss their deadlines since the nice property of ra.te monotonicity does
not. hold a.ny more.
Theorem
4 For a DC task set T, if ci 1 cj for all
i < j and p(T) 5 1, then the schedrtle prod,uced by th.e
DC scheduling algorithm satis,fies fhni during any time
interval of length. ci, the total processor lime nllocaied
to task Ti is ei, for all i.
3.3
Support
of Aperiodic
Tasks
In most rea.l-time systems t.here a.re aperiodic ta.sks
in a.ddition to periodic t.asks. These aperiodic tasks
still sl~ould be finished as soon a.s possible. Compa.red
wit,11 the RM model it. is more difficult to ha.ve short
response times for a,periodic ta.sks in the DC model
since a.11DC tasks a.re executed a.t fixed times. Moreover, clel aying a.ny of t,he DC t,a.sks in favor of a.periodic
jobs (as in t,he sla.ck stea.ling protocol [RL93]) will creat~ejitt.ers for DC tasks. In this section, we discuss
some possible st,ra.tegies.
In the following, we discuss how to schedule a. system with both DC a.nd FT1 &Its. W ’e want, t,o guarantee that a.11DC tasks will not ha.\:e auy jitt,er a.nd FR
tasks will have enough esecuhion t.ime in each of t,heir
periods.
When scheduling such a, t.a.slc set., we first ident,ify
the tasks in ea.ch group. In t,he first. subset TD~ are
tasks with shorter periodls a.nd distance constraints.
Their constra,ints will be gua.ra.nt,eed by t*he DC scheduler. In the second subset TFR a.re t.a.sks tha.t ha.ve
longer periods and need to be ruu once in ea,ch of
their periods. The whole set T is t-hen specia.lized a.ccording to the DC model. Aft,er specializa.tion the
tasks in the subset T.PR a.re rea.ssigned their original periods. If T = {IT;. . ,T,,, ?;,+I,.
;T,,,} then
TDC = {Tl,...
,T,,} and TFR = {'L+1,...,T,,,}
for
some n. Since the DC scheduler a.ssigus t,ime slot,s
for the FR tasks in perio’ds short,er t,hau or equal to
their original periods t,hey will a.lways ha,ve time slots
available in their periade .and can meet. t.heir deadline.
Thus, the modified task set is schedulable.
(a) Aperiodic
Server
As in [LS87], 1‘t 1s
. possible t,o include a periodic polling
server for aperiodic jobs in t,he DC task set. The server
is schrduled like a. periodic job with a predefined period and execution time. When the server is executing,
it, checks if say a.periodic ta.sk is wa.iting to be served.
If there a.re several, the highest priority ta,sk among
t,liem is run. Ot,lierwise, the server ca.n either return
t.hp “unused” time to the syst,em to execute other nondist,ance-constra.ined jobs or the processor is left idle.
457
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE
Proceedings of the 29th Annual Hawaii International
E7
Tl :
1
...
AlBlBlClClDl
T2:
A~l?~B~C~C~D~
12 13
AjBlBlC
CID
.4~B~B~G~C~D~
...
lA]B
id
19
ElClCIDI
Conference on System Sciences -
...
24 25
. ..
AIBIAICICIDIIAIBIBIClClDI
AlBIB
AIf?lL?
30
31
1996
.,.
36
AIBIBICICID
CIC h/AJBIBIcIcID
Figure 8: Schedules for Tl a.nd T? in Exa.mple 4
When implementing a.11aperiodic server in t,he DC
model we ca,n first specialize t,he given set. of periodic
tasks. This results in the minimunl ut.ilizat.ion possible for the periodic t&&s. The renlaining ut,iliza.tion
can then be a.ssigned t.o t,he aperiodic server. The
server can be given a. harmonic period c, as required
to provide a.n a.ccepta.ble response time for a.periodic
tasks. This approach gives a. guaranteed response time
to a.periodic jobs but does not, give t.he best a.vera.ge
responsiveness. This is beca.use a.ny job tl1a.t a.rrives
shortly after the server’s t,ime-slice must. wait, uutil t,he
next period of the server.
(b) The
Priority
Exchange
Protocol
b. IA~BIBIBIBIBIBIBI~~!!
BlBlBlBlBllAlXlXlBlBlBlClC
d. [AIBIBIBIBIBIBI~IA]XIXIBICIC~T~
e. IA~BJBIxIsIBIBIBIIAIB~BIB~CIC~
Figure 9: Schedules for Exa.mple 5 (a) DC only (b)
Background (c) AS (d) PEP (e) DS
(PEP)
st.ea.d the a.periodic server keeps its high priority run
time until the end of t,he server period, This method
is a.gain not directly a.pplica.ble to the DC model but
we can use it in a. modified form to improve the responsiveness of the a.periodic jobs.
The sporadic server is assigned a, priority, run time
and period as in the PEP. It, does not trade run time,
inst.ea.d it keeps its high priority run time until the
end of it,s period. The DS a.lso gives up its run time
when 110other task is running (i.e. the system is idle).
Since the bandwidth of the periodic jobs is preserved
in t,he period they always ha.ve the sa.me gua.ranteed
bandwidt,h in t,he period no matter when the server is
running in the period a.nd will t.herefore f&h
execut.ion before their clea.dline.
To overcome the shortcomings of I,he aperiodic server
the Priority Exchange Prot,ocol (PEP) [LS87] was introduced for the RM model. The PEP allows the aperiodic server to exchasge its high priorit,y run time for
the lower priority run time of a periodic task. T, uses
its run time when t,here are aperiodic requests pending. When there are no aperiodic request,s TO t,ra.des
its time with the highest. priority periodic ta.sk rea.dy
to be executed.
In the DC model it, is not. possible t,o t,racle t,ime because then the distance const,ra.int,s ma? be viola.ted.
To a,pply the PEP to t,he DC model we can split. to
ta.sk set in two su1~set.sby t.he same> met.hocl used t,o
combine the DC ta.sks wit,11 t,he fixed-rate t,asks. The
aperiodic server’s period c, is chosen so tl1a.t it,s priority is between the subsets (i.e. we get. { rl! T? 1 ?T,, ,
,.-.I t’ion time e, can he set.
. . ,T,}).
Tl ie evcu
T,, Z+I,.
so that the server uses up all t,he ut.ilization not, used
by the periodic jobs.
Using PEP does not change t,he schedulabilit,y of
the origina. schedule. The tra.ding of run time a.dva,nces the RM ta.sks execut.ions and thus st,ill guarantees their dea.dlines.
(c) Deferrable
Server
, 1
(cl) Comparison
All a.pproa&es have their pros a.nd cons. Overall,
DS gives the best a.vera.ge response time for aperiodic
tasks. It a.lso utilizes the resources (CPU time) best.
kloreover, it ca.n gua.rantee a. 1naxima.l response time
to a.periodic jobs as is possible wit,h the polling server.
However, the gua.ranteed bound on response time can
1% larger.
Example
5 We have Ihe task set (A(8, l), B(16,8),
c’(30,2)}
which is specialized to (A(8, l), B(16,8),
C( llj, 2)). The aperiodic server is X(8,2).
The resultwg sef is (A(8,l):
X(8,2), B(lG, 8), C(lG,2)}.
V&en
there are 11.0aperiodic requests th,e schedule is as Figwe 9(a). When an aperiodic job will1 a run time of
2 arrkes af the beginning of period 4, the schedules
(D S)
The deferrable server (DS) [LSP.i] was introduced t.o
preserve the bandwidth for the a.periodic jobs. The
DS a.lgorithm is simi1a.r t,o t,he PEP but. easier to inplement. Unlike t,he PEP, t,he DS algorithm does not,
tra.de time when no a.periodic t.asl;s a.re pending. In-
458
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE
Proceedings of the 29th Annual Hawaii International Conference on System Sciences - 1996
Integer Reduction”, IEEE Transactions on Comporters, Vol. 41, No. 6, pp. 755-768, June 1992
C.
l$D7J
d. c$zJ
I
[CC931 M.Y. Ghan and F. Chin, “Schedulers for
La.rger Cla.sses of Pinwheel Instances”, Algorithmica, Vol. 9, pp. 425-462, 1993.
pEJ----,
I $1//////////////1
[I-11,92] C.-C. H a,n and K.J. Lin “Scheduling Distance
Constra.ined Rea.l-Time Tasks” , Proc. IEEE 13th
Real- Time Systems Sym.posium, Phoenix, AZ, pp.
300-308, December 1992
Figure 10: Ava.ila.ble time in Exa.mple 5 (a,) DC only
(b) Background (c) AS (d) PEP (e) DS
[HL94] C.-C. Ha.n, K.J. Lin a,nd C-J Hou, “Distance
Const,ra.ined Scheduling a.nd Its Applications in
R.ea.l-Time Systems”, submitted for publication,
1994.
produced using d@erent protocols o,re shv.(~~n ia. Figure 9(b-e). The ina~ii~~.w)~ a~cri/nb/~ the [r‘an,t~ for
aperiodic jobs using di.@el~enfp~v~.ocol.~ are ~/JK~IJ~ tv
Figure 10.
cl
4
[HA1891 R. Holte, A. Mok, L. Rosier, I. Tulchinsky,
and D. Va.rvel, “The Pinwheel: A Real-Time
Scheduling Problem”, Proc. of the 221&d Hawaii
Iilterirntion.al Conference on System Science, pp.
693-702, .Janua,ry 1989
[KG941 1-I. Kopet,z a.nd G. Grunsteidl, “TTP- A Protocol for Fa.ult-Tolerant
Real-,Time Systems”,
IEEE Computer, pp. 14-23, Ja.nua.ry 1994.
Conclusions
Many rea.l-time systems must1 have low jit,ters but,
also ha.ndle pra.ctica.1 applica.tions. ‘i\‘e ha.ve discussed
some of the issues using t,he DC sclleduling model t,o
reduce jitters in time-t,riggmered syst,ems. In gcnera.l, we
believe that the DCTS scheduling has some a.dvantage
over the fixed priorit,y scheduling. III t,he mean time, it
has removed the uncertair1t.y of esecut#ion jitters. The
DC model provides a, det,erminist.ic schedule by t,ransforming tasks to have ha.rmonic periods. Thus the DC
model can provide a. determinist,ic schedule much like
the cyclic executive model, yet, may use ma.ny of t,he
extension protocols a.s discussed in this pa,per. Although some jitters a.re st,ill una\.oidable, in genera.1,
jitters in real-time system can be l&l.er controlled.
We are still working on some other approaches on reducing jitters.
[LS89] J.P. Lehoczky, L. Sha., Y. Ding, “The Rate
Monot#onic Scheduling Algorithm: Exa.ct Charact,eriza.tion And Avera.ge Case Beha.vior” , Proceedi11g.s of the 10th IEEE
R,eal-Time Systems Symposiu~~~,pp. 166-171, December 1989
[LS87] J.P. Lehoczky, L. Sha., J.K. Strosnider, “Enhanced Aperiodic Responsiveness in Hard RealTime Environments”,
Proceedings of Eighth
IEEE Real- The Systems Symposium., pp. 26l270, 1987
[LL73] C.L. Liu and J.W. La.yla.nd, “Scheduling Algorithms for niult,iprogra.mmilIg in a Hard RealTime Environments” , Journ.al of ACM, Vol. 20,
No. 1, pp. 46-61, .Janua.ry 1973
[R.L93] S. Ra.mos-Thuel and J .P. Lehoczky,
line scheduling of ha.rd deadline a,periodic
in fixed-priority
syst,ems”, Proceedings of
Real- Time j’ystenas SynJ.posiana, December
References
[BS89] T.P. Baker aad A. Sha.w, “The cyclic executive Model and Ada.“, The Jou~~rnl of Ilen/-Time
Systems, Vol. 1, No. 1, pp. ‘i-25, June 1989
[BuSl] A. Burns, “Scheduling
terns”, Software E1J~gimW~JJ.g
3, pp. 116-128, 1991
“Ontasks
IEEE
1993.
[SG90] L. Sha., J .B. Goodenough,
“Real-Time
Scheduling Theory and Ada?‘, IEEE Computer,
pp. 53-62, April 1990
ha.rd rea.l-t,ime sysJour~~al, Vol. 6, No.
[SRBO] L. Sha., R. Rajkuma,r a,nd J.P. Lehoczky, “Priorit,y Inheritance Protocol:
An Approa.ch To
Real-Time synchroniza.t,ion” , IEEE Tran,s. Com1)2lfer.s. Vo1.39, No. 9, pp. 1175-1185, Sept,ember
1990
[CC921 M.Y. Ghan and F. Chin, “Genera.1 Scheclulers for the Pinwheel Problem 13ased on Double-
459
Proceedings of the 1996 Hawaii International Conference on System Sciences (HICSS-29)
1060-3425/96 $10.00 © 1996 IEEE