Handling Sporadic Tasks in Real-time Systems - Combined ... - MRTC
Handling Sporadic Tasks in Real-time Systems - Combined ... - MRTC
Handling Sporadic Tasks in Real-time Systems - Combined ... - MRTC
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Handl<strong>in</strong>g</strong> <strong>Sporadic</strong> <strong>Tasks</strong> <strong>in</strong> <strong>Real</strong>-<strong>time</strong><br />
<strong>Systems</strong><br />
- Comb<strong>in</strong>ed Offl<strong>in</strong>e and Onl<strong>in</strong>e Approach -<br />
Damir Isović<br />
Department of Computer Eng<strong>in</strong>eer<strong>in</strong>g<br />
Mälardalen University, Sweden<br />
damir.isovic@mdh.se
ZA MOJE RODITELJE<br />
(to my parents)
Abstract<br />
Many <strong>in</strong>dustrial applications with real-<strong>time</strong> demands are composed of mixed<br />
sets of tasks with a variety of requirements. These can be <strong>in</strong> the form of standard<br />
tim<strong>in</strong>g constra<strong>in</strong>ts, such as period and deadl<strong>in</strong>e, or complex, e.g., to express<br />
application specific or non temporal constra<strong>in</strong>ts, reliability, performance,<br />
etc. Arrival patterns determ<strong>in</strong>e whether tasks will be treated as periodic, sporadic,<br />
or aperiodic. As many algorithms focus on specific sets of task types and<br />
constra<strong>in</strong>ts only, system design has to focus on those supported by a particular<br />
algorithm, at the expense of the rest.<br />
In this work, we present a set of algorithms to deal with a comb<strong>in</strong>ation of<br />
mixed sets of tasks and constra<strong>in</strong>ts: periodic tasks with complex and simple<br />
constra<strong>in</strong>ts, soft and firm aperiodic, and <strong>in</strong> particular sporadic tasks. Instead of<br />
provid<strong>in</strong>g algorithms tailored for a specific set of constra<strong>in</strong>ts, we propose an<br />
EDF based run<strong>time</strong> algorithm, and the use of an offl<strong>in</strong>e scheduler for complexity<br />
reduction to transform complex constra<strong>in</strong>ts <strong>in</strong>to the EDF model. At run<strong>time</strong>,<br />
an extension to EDF, two level EDF, ensures feasible execution of tasks with<br />
complex constra<strong>in</strong>ts <strong>in</strong> the presence of additional tasks or overloads.<br />
We present a comb<strong>in</strong>ed offl<strong>in</strong>e and onl<strong>in</strong>e approach for handl<strong>in</strong>g sporadic<br />
tasks. First, the sporadic tasks are guaranteed offl<strong>in</strong>e, dur<strong>in</strong>g design <strong>time</strong>,<br />
which allows reschedul<strong>in</strong>g or redesign <strong>in</strong> the case of failure. S<strong>in</strong>ce we do not<br />
know the arrival <strong>time</strong> of sporadics we need to perform the worst-case offl<strong>in</strong>e<br />
guarantee. Second, we try onl<strong>in</strong>e to reduce the pessimism <strong>in</strong>toduced by worstcase<br />
assumption. An onl<strong>in</strong>e algorithm keeps track of arrivals of <strong>in</strong>stances of<br />
sporadic tasks to reduce pessimism about future sporadic arrivals and improve<br />
response <strong>time</strong>s and acceptance of firm aperiodic tasks.<br />
A simulation study underl<strong>in</strong>es the effectiveness of the proposed approach.
Acknowledgements<br />
Without support of some people, this work would not have been possible. I<br />
am grateful to them all, not only for their technical support, but also good <strong>time</strong><br />
I have shared with them.<br />
I would like first to thank my supervisor Gerhard Fohler (if I put the title<br />
professor before his name, I’m afraid he will freak out so I won’t :) Thank you<br />
Gerhard for beliv<strong>in</strong>g <strong>in</strong> me and tak<strong>in</strong>g me as your student. I know that I need to<br />
be “pushed” some<strong>time</strong>s and you certa<strong>in</strong>ly know how to do that, always po<strong>in</strong>t<strong>in</strong>g<br />
me <strong>in</strong>to the right direction. Thank you for not only be<strong>in</strong>g my supervisor, but<br />
also my friend. Prost!<br />
I would like to express my gratitude to Radu Dobr<strong>in</strong> and Tomas Lenvall<br />
for useful discussions and reviews of my work. I also want to thank my colleagues<br />
at the Department of Computer Eng<strong>in</strong>eer<strong>in</strong>g at Mälardalen University,<br />
specially the members of the System Design Lab.<br />
I am grateful to my parents and family for always encourag<strong>in</strong>g me to pursue<br />
my ideas and desires and for their unfail<strong>in</strong>g support and love throughout my<br />
entire education. Lastly, my greatest thanks go to my beloved fiancé Em<strong>in</strong>a for<br />
her love and support dur<strong>in</strong>g the long night hours when complet<strong>in</strong>g this thesis.<br />
Väster˙as, May 2001<br />
Damir Isović
Contents<br />
1 Introduction 10<br />
1.1 What are real-<strong>time</strong> systems? . ................. 10<br />
1.2 Deal<strong>in</strong>g with <strong>time</strong> ........................ 11<br />
1.3 <strong>Real</strong>-<strong>time</strong> schedul<strong>in</strong>g policies . ................. 11<br />
1.3.1 Offl<strong>in</strong>e vs Onl<strong>in</strong>e . . . ................. 12<br />
1.3.2 Resource sufficient vs resource <strong>in</strong>sufficient . . . . . . 12<br />
1.3.3 Event-trigged vs Time-trigged ............. 12<br />
1.4 Task model . . . ........................ 13<br />
1.4.1 Periodic <strong>Tasks</strong> . . . . ................. 13<br />
1.4.2 Dynamic Arrivals . . . ................. 13<br />
1.4.3 Simple and Complex Constra<strong>in</strong>ts . . . ......... 14<br />
1.5 This thesis ............................ 16<br />
1.5.1 Motivation and Approach . . ............. 16<br />
1.5.2 Comb<strong>in</strong>ed Offl<strong>in</strong>e and Onl<strong>in</strong>e Approach . . . . . . . . 17<br />
1.5.3 <strong>Handl<strong>in</strong>g</strong> sporadic tasks . . . ............. 18<br />
1.5.4 Conclusions . . . . . . ................. 19<br />
1.6 Results . . ............................ 19<br />
1.6.1 Paper A . ........................ 20<br />
1.6.2 Paper B . ........................ 20<br />
1.6.3 Paper C . ........................ 21<br />
1.6.4 Paper D . ........................ 22<br />
2 Paper A: <strong>Handl<strong>in</strong>g</strong> <strong>Sporadic</strong> <strong>Tasks</strong> <strong>in</strong> Offl<strong>in</strong>e Scheduled Distributed<br />
<strong>Real</strong>-Time <strong>Systems</strong> 26<br />
2.1 Introduction . . . ........................ 28<br />
2.2 System description and task model . . ............. 29<br />
2.2.1 Time model . . . . . . ................. 29
4 CONTENTS<br />
2.2.2 Off-l<strong>in</strong>e periodic schedule . . ............. 30<br />
2.2.3 Task model . . . . . . ................. 30<br />
2.3 Integrated off-l<strong>in</strong>e and on-l<strong>in</strong>e Schedul<strong>in</strong>g . . ......... 30<br />
2.3.1 Off-l<strong>in</strong>e preparations . ................. 31<br />
2.3.2 On-L<strong>in</strong>e mechanisms . ................. 32<br />
2.4 Acceptance test for a set of sporadic tasks . . ......... 32<br />
2.4.1 <strong>Sporadic</strong> set . . . . . . ................. 33<br />
2.4.2 Critical slots . . . . . ................. 33<br />
2.4.3 Off-l<strong>in</strong>e feasibility test for sporadic tasks . . . . . . . 37<br />
2.5 On-l<strong>in</strong>e mechanism . . . . . . ................. 38<br />
2.5.1 Ma<strong>in</strong>tenance of spare capacities . . . ......... 39<br />
2.6 Example . ............................ 40<br />
2.7 Conclusion . . . ........................ 44<br />
3 Paper B: Onl<strong>in</strong>e <strong>Handl<strong>in</strong>g</strong> of Firm Aperiodic <strong>Tasks</strong> <strong>in</strong> Time Triggered<br />
<strong>Systems</strong> 47<br />
3.1 Introduction . . . ........................ 49<br />
3.2 Slot Shift<strong>in</strong>g: Flexibility for Time Triggered <strong>Systems</strong> . . . . . 50<br />
3.3 Motivation and Approach . . . ................. 51<br />
3.3.1 Shortcomm<strong>in</strong>gs of Previous Version . ......... 52<br />
3.3.2 Basic Idea ........................ 52<br />
3.4 Algorithm Description . . . . ................. 53<br />
3.4.1 Acceptance Test for a Set of Aperiodic and Offl<strong>in</strong>e<br />
Scheduled <strong>Tasks</strong> . . . ................. 54<br />
3.4.2 Pseudo Code . . . . . ................. 55<br />
3.4.3 Resource Reservation . ................. 57<br />
3.4.4 Rejection Strategies and Overload <strong>Handl<strong>in</strong>g</strong> . . . . . . 57<br />
3.4.5 Resource Reclaim<strong>in</strong>g . ................. 58<br />
3.5 Example . ............................ 58<br />
3.6 Summary and Outlook . . . . ................. 60<br />
4 Paper C: Efficient Schedul<strong>in</strong>g of <strong>Sporadic</strong>, Aperiodic, and Periodic<br />
<strong>Tasks</strong> with Complex Constra<strong>in</strong>ts 63<br />
4.1 Introduction . . . ........................ 65<br />
4.2 Task and System Assumptions ................. 67<br />
4.2.1 Complex constra<strong>in</strong>ts . ................. 67<br />
4.2.2 Task types ........................ 68<br />
4.2.3 System assumptions . ................. 69<br />
4.2.4 Task handl<strong>in</strong>g - overview . . . ............. 69
CONTENTS 5<br />
4.3 Periodic <strong>Tasks</strong> - Offl<strong>in</strong>e Complexity Reduction . . . . . . . . 70<br />
4.3.1 Offl<strong>in</strong>e complexity reduction . ............. 70<br />
4.3.2 Run<strong>time</strong> guarantee of complex constra<strong>in</strong>ts . . . . . . . 71<br />
4.4 Aperiodic <strong>Tasks</strong> . ........................ 73<br />
4.4.1 Acceptance test . . . . ................. 73<br />
4.4.2 Algorithm ........................ 74<br />
4.5 <strong>Sporadic</strong> <strong>Tasks</strong> . ........................ 75<br />
4.5.1 <strong>Handl<strong>in</strong>g</strong> sporadic tasks . . . ............. 76<br />
4.5.2 Interference w<strong>in</strong>dow . ................. 76<br />
4.5.3 Algorithm description ................. 80<br />
4.6 Simulation Analysis . . . . . . ................. 82<br />
4.7 Summary and Outlook . . . . ................. 83<br />
4.8 Acknowledgements ....................... 84<br />
5 Paper D – Simulation Analysis of <strong>Sporadic</strong> and Aperiodic Task<br />
<strong>Handl<strong>in</strong>g</strong> 88<br />
5.1 Introduction . . . ........................ 90<br />
5.2 Simulation environment . . . . ................. 90<br />
5.3 Experiment 1: Firm aperiodic guarantee . . . ......... 90<br />
5.3.1 Experimental setup . . ................. 90<br />
5.3.2 Results . ........................ 91<br />
5.4 Experiment 2: Firm aperiodic guarantee with sporadics . . . . 94<br />
5.4.1 Experimental setup . . ................. 94<br />
5.4.2 Results . ........................ 95<br />
5.5 Summary ............................ 98
List of Figures<br />
2.1 Example of a critical slot. . . . ................. 34<br />
2.2 <strong>Sporadic</strong> arival after critical slot. . . . ............. 35<br />
2.3 <strong>Sporadic</strong> arrival shifted to the right. . ............. 35<br />
2.4 <strong>Sporadic</strong> arrival before critical slot. . . ............. 36<br />
2.5 <strong>Sporadic</strong> arrival shifted to the left. . . ............. 36<br />
2.6 Example offl<strong>in</strong>e sporadic guarantee – periodic tasks and offl<strong>in</strong>e<br />
schedule. ............................ 40<br />
2.7 Example offl<strong>in</strong>e sporadic guarantee – schedule with <strong>in</strong>tervals. . 41<br />
2.8 Example offl<strong>in</strong>e sporadic guarantee – steps <strong>in</strong> guarantee algorithm.<br />
. . ............................ 41<br />
2.9 Example offl<strong>in</strong>e sporadic guarantee – offl<strong>in</strong>e schedule after redesign.<br />
. . ............................ 42<br />
2.10 Example offl<strong>in</strong>e sporadic guarantee – guarantee<strong>in</strong>g after redesign. 43<br />
2.11 Example offl<strong>in</strong>e sporadic guarantee – onl<strong>in</strong>e execution. . . . . 43<br />
3.1 Onl<strong>in</strong>e acceptance test for firm aperiodic tasks – algorithm<br />
complexity . . . ........................ 57<br />
3.2 Example onl<strong>in</strong>e firm aperiodic guarantee– static schedule . . . 58<br />
3.3 Example onl<strong>in</strong>e firm aperiodic guarantee – execution without<br />
new task. ............................ 59<br />
4.1 A sporadic task. . ........................ 77<br />
4.2 Guarantee Ratio for Firm Aperiodic <strong>Tasks</strong> . . ......... 83<br />
5.1 Guarantee ratio for aperiodic tasks – Background . . . . . . . 91<br />
5.2 Guarantee ratio for aperiodic tasks – SSE . . ......... 92<br />
5.3 Guarantee ratio for aperiodic tasks, dl=MAXT – SSE vs Background<br />
. . ............................ 93
5.4 Guarantee ratio for aperiodic tasks, dl=2*MAXT – SSE vs Bgr 93<br />
5.5 Guarantee ratio for aperiodic tasks, dl=3*MAXT – SSE vs Bgr 94<br />
5.6 Guarantee ratio for aperiodic tasks with sporadics, dl=MAX:<br />
load variation . . ........................ 96<br />
5.7 Guarantee ratio for aperiodic tasks with sporadics, dl=2*MAXT:<br />
load variation . . ........................ 96<br />
5.8 Guarantee ratio for aperiodic tasks with sporadics, dl=MAXT:<br />
variation of MINT ........................ 97<br />
5.9 Guarantee ratio for aperiodic tasks with sporadics, dl=2*MAXT:<br />
variation of MINT ........................ 97<br />
5.10 Guarantee ratio for aperiodic tasks with sporadics - F<strong>in</strong>al results 98
List of Publications<br />
The follow<strong>in</strong>g articles are <strong>in</strong>cluded <strong>in</strong> this licentiate 1 thesis:<br />
A <strong>Handl<strong>in</strong>g</strong> <strong>Sporadic</strong> <strong>Tasks</strong> <strong>in</strong> Off-l<strong>in</strong>e Scheduled Distributed <strong>Real</strong>-Time <strong>Systems</strong>,<br />
Damir Isovic and Gerhard Fohler, In Proceed<strong>in</strong>gs of 11th EU-<br />
ROMICRO Conference on <strong>Real</strong>-Time <strong>Systems</strong> York, England , July<br />
1999.<br />
B Onl<strong>in</strong>e <strong>Handl<strong>in</strong>g</strong> of Firm Aperiodic <strong>Tasks</strong> <strong>in</strong> Time Triggered <strong>Systems</strong>, Damir<br />
Isovic and Gerhard Fohler, In WiP proceed<strong>in</strong>gs of 12th EUROMICRO<br />
Conference on <strong>Real</strong>-Time <strong>Systems</strong>, Stockholm, Sweden , June 2000.<br />
C Efficient Schedul<strong>in</strong>g of <strong>Sporadic</strong>, Aperiodic, and Periodic <strong>Tasks</strong> with Complex<br />
Constra<strong>in</strong>ts, Damir Isovic and Gerhard Fohler, In Proceed<strong>in</strong>gs of<br />
the 21st IEEE <strong>Real</strong>-Time <strong>Systems</strong> Symposium, Walt Disney World, Orlando,<br />
Florida, USA , November 2000.<br />
D Simulation Analysis of <strong>Sporadic</strong> and Aperiodic Task <strong>Handl<strong>in</strong>g</strong>, Damir Isovic<br />
and Gerhard Fohler, Technical Report , Mälardalen <strong>Real</strong>-Time Research<br />
Centre, Mälardalen University, May 2001.<br />
Besides the above articles, I have written and published the follow<strong>in</strong>g scientific<br />
papers:<br />
I System Development with <strong>Real</strong>-Time Components, Damir Isovic, Markus<br />
L<strong>in</strong>dgren and Ivica Crnkovic, In Proc. of ECOOP2000 Workshop 22<br />
- Pervasive Compont Sophia Antipolis and Cannes, France , June 2000.<br />
1 A licenciate degree is a Swedish graduate degree halfway between MSc and PhD.
LIST OF FIGURES 9<br />
II <strong>Real</strong>-Time Components, Damir Isovic and Markus L<strong>in</strong>dgren, Technical Report<br />
, Mälardalen <strong>Real</strong>-Time Research Centre, Mälardalen University,<br />
March 2000.<br />
III Fault Conta<strong>in</strong>ment <strong>in</strong> Hive OS, Damir Isovic and Magnus Sund<strong>in</strong>, Technical<br />
Report , Mälardalen <strong>Real</strong>-Time Research Centre, Mälardalen University,<br />
January 1999.<br />
IV Kompendium i Distribuerade System Damir Isovic, Technical Report , Mälardalen<br />
<strong>Real</strong>-Time Research Centre, Mälardalen University, ( 110 pages), March<br />
2001.<br />
V On <strong>Handl<strong>in</strong>g</strong> Mul<strong>time</strong>dia <strong>Tasks</strong> Damir Isovic, Technical Report , Mälardalen<br />
<strong>Real</strong>-Time Research Centre, Mälardalen University, April 2001.
Chapter 1<br />
Introduction<br />
1.1 What are real-<strong>time</strong> systems?<br />
<strong>Real</strong>-<strong>time</strong> systems are comput<strong>in</strong>g systems <strong>in</strong> which meet<strong>in</strong>g tim<strong>in</strong>g constra<strong>in</strong>ts<br />
is essential to correctness. Usually, real-<strong>time</strong> systems are used to control or<br />
<strong>in</strong>teract with a physical system, where tim<strong>in</strong>g constra<strong>in</strong>ts are imposed by the<br />
environment. As a consequence, the correct behaviour of these systems depends<br />
not only on the result of the computation but also at which <strong>time</strong> the<br />
results are produced [1]. If the system delivers the correct answer, but after a<br />
certa<strong>in</strong> deadl<strong>in</strong>e, it could be regarded as hav<strong>in</strong>g failed.<br />
Many application are <strong>in</strong>herently of real-<strong>time</strong> nature; examples <strong>in</strong>clude aircraft<br />
and car control systems, chemical plants, automated factories, medical<br />
<strong>in</strong>tensive care devices and numerous others. Most of these systems <strong>in</strong>teract<br />
directly or <strong>in</strong>directly with electronical and mechanical devices. Sensors provide<br />
<strong>in</strong>formation to the system about the state of its external environment. For<br />
example, medical monitor<strong>in</strong>g devices, such as ECG, use sensors to monitor<br />
patient and mach<strong>in</strong>e status. Air speed, attitude and altitude sensors provide<br />
aircraft <strong>in</strong>formation for proper execution of flight control plans etc.<br />
The design of safety-critical real-<strong>time</strong> systems has to put focus on demands<br />
on predictability, flexibility, and reliability. If we have an application with<br />
completely known characteristics, we can achieve predictable behaviour of the<br />
system, e.g., l<strong>in</strong>ear and angular position sensors that read a robot’s arm position<br />
every 20 ms and adjust it via stepper motors. On the other hand, many external<br />
events are not predictable, for example, an external stimulus such as press<strong>in</strong>g a<br />
button. <strong>Systems</strong> must react to these sporadic events when they occur rather than
Deal<strong>in</strong>g with <strong>time</strong> 11<br />
when it might be conv<strong>in</strong>ient. By tak<strong>in</strong>g care of them we <strong>in</strong>troduce flexibility to<br />
the systems.<br />
In this work, we provide mechanisms to handle unpredictable sporadic<br />
events together with predictable ones.<br />
1.2 Deal<strong>in</strong>g with <strong>time</strong><br />
Design of real-<strong>time</strong> systems must make sure that the system reacts to external<br />
events <strong>in</strong> a <strong>time</strong>ly way. The reaction may be a simple state change, such as<br />
switch<strong>in</strong>g from red to green light, or a complicated controll loop control<strong>in</strong>g<br />
many actuators simultaneously.<br />
<strong>Real</strong>-<strong>time</strong> systems can be constructed out of sequential programs, but are<br />
typically built of concurrent programs, called tasks. A typical tim<strong>in</strong>g constra<strong>in</strong>t<br />
on a real-<strong>time</strong> task is the deadl<strong>in</strong>e, i.e., the maximum <strong>time</strong> <strong>in</strong>terval with<strong>in</strong> which<br />
the task must complete its execution. Depend<strong>in</strong>g on the consequences that may<br />
occur due to a missed deadl<strong>in</strong>e, real-<strong>time</strong> systems are dist<strong>in</strong>guished <strong>in</strong>to two<br />
classes, hard and soft. In hard real-<strong>time</strong> systems all task deadl<strong>in</strong>es must be<br />
met, while <strong>in</strong> soft real-<strong>time</strong> systems the deadl<strong>in</strong>es are desirable but not necessary.<br />
In hard real-<strong>time</strong> systems, late data is bad data. Soft real-<strong>time</strong> systems are<br />
constra<strong>in</strong>ed only by average <strong>time</strong> constra<strong>in</strong>ts, e.g. handl<strong>in</strong>g <strong>in</strong>put data from the<br />
keyboard. In these systems, late data is still good data. Many systems consist<br />
of both hard and soft real-<strong>time</strong> subsystems, and from now on we will refer to<br />
them as mixed real-<strong>time</strong> systems.<br />
<strong>Real</strong>-<strong>time</strong> systems span a large part of computer <strong>in</strong>dustry. So far most of<br />
the real-<strong>time</strong> systems research has been mostly conf<strong>in</strong>ed to s<strong>in</strong>gle node systems<br />
and ma<strong>in</strong>ly for processor schedul<strong>in</strong>g. This needs to be extended for multiple<br />
resources and distributed nodes. In our work, we consider a distributed system,<br />
i.e., one that consist of several process<strong>in</strong>g and communication nodes [2].<br />
1.3 <strong>Real</strong>-<strong>time</strong> schedul<strong>in</strong>g policies<br />
When a processor has to execute a set of concurrent tasks, the CPU has to be assigned<br />
to the various tasks accord<strong>in</strong>g to a predef<strong>in</strong>ed criterion, called a schedul<strong>in</strong>g<br />
policy. There is a great variety of algorithms proposed for schedul<strong>in</strong>g of<br />
real-<strong>time</strong> systems today. In this subsection we will give a brief <strong>in</strong>troduction to<br />
some most common classifications, which have been adopted <strong>in</strong> our research.
12 <strong>Real</strong>-<strong>time</strong> schedul<strong>in</strong>g policies<br />
1.3.1 Offl<strong>in</strong>e vs Onl<strong>in</strong>e<br />
<strong>Real</strong>-<strong>time</strong> schedul<strong>in</strong>g algorithms fall <strong>in</strong>to two categories [3]: offl<strong>in</strong>e and onl<strong>in</strong>e<br />
schedul<strong>in</strong>g. In offl<strong>in</strong>e schedul<strong>in</strong>g, the scheduler has complete knowledge of the<br />
task set and its constra<strong>in</strong>ts, such as deadl<strong>in</strong>es, computation <strong>time</strong>s, precedence<br />
consta<strong>in</strong>ts etc. Schedul<strong>in</strong>g decisions are based on fixed parameters, assigned<br />
to tasks before their activation. The offl<strong>in</strong>e guaranteed schedule is stored and<br />
dispached later dur<strong>in</strong>g run<strong>time</strong> of the system. Offl<strong>in</strong>e schedul<strong>in</strong>g is also refered<br />
as static or pre-run<strong>time</strong> schedul<strong>in</strong>g.<br />
On the other hand, onl<strong>in</strong>e schedul<strong>in</strong>g algorithms make their schedul<strong>in</strong>g decisions<br />
at run<strong>time</strong>. Onl<strong>in</strong>e schedulers are flexible and adaptive, but they can<br />
<strong>in</strong>cur significant overheads because of run<strong>time</strong> process<strong>in</strong>g. Besides, onl<strong>in</strong>e<br />
schedul<strong>in</strong>g algorithms do not need to have the complete knowledge of the task<br />
set or its tim<strong>in</strong>g constra<strong>in</strong>ts. For example, an external event that arrives at the<br />
run<strong>time</strong> of the system: we need to deal with it upon its arrival. Schedul<strong>in</strong>g decisions<br />
are based on dynamic parameters that may change dur<strong>in</strong>g system evolution.<br />
Onl<strong>in</strong>e schedul<strong>in</strong>g is often refered to as dynamic or run<strong>time</strong> schedul<strong>in</strong>g.<br />
1.3.2 Resource sufficient vs resource <strong>in</strong>sufficient<br />
Onl<strong>in</strong>e schedul<strong>in</strong>g can be further divided <strong>in</strong>to schedul<strong>in</strong>g algorithms that work<br />
<strong>in</strong> resource sufficient and those that work <strong>in</strong>to resource <strong>in</strong>sufficient environments<br />
[4], i.e., <strong>in</strong> overload situations. In resource sufficient environments,<br />
even though tasks arrive dynamically, at any given <strong>time</strong> all tasks are schedulable.<br />
Earliest Deadl<strong>in</strong>e First (EDF) [5] is proven to be optimal dynamic<br />
schedul<strong>in</strong>g policy <strong>in</strong> resource sufficient environments.<br />
1.3.3 Event-trigged vs Time-trigged<br />
There are two fundamentally different pr<strong>in</strong>ciples of how to control the activity<br />
of a real-<strong>time</strong> system, event-trigged and <strong>time</strong>-trigged. Inevent-trigged systems<br />
all activities are carried out <strong>in</strong> response to relevant events external to the system.<br />
When a significant event <strong>in</strong> the outside world happens, it is detected by<br />
some sensor, which then causes the attached device (CPU) to get an <strong>in</strong>terrupt.<br />
For soft real-<strong>time</strong> systems with lots of comput<strong>in</strong>g power to spare, this approach<br />
is simple, and works well. The ma<strong>in</strong> problem with event-trigged systems is that<br />
they can fail under conditions of heavy load, i.e., when many events are happen<strong>in</strong>g<br />
at once. As an example of an event-trigged system we can mention the
Task model 13<br />
SPRING system [6], which applies an onl<strong>in</strong>e guarantee algorithm with complex<br />
task models <strong>in</strong> distributed environments.<br />
In a <strong>time</strong>-trigged system, all activities are carried out at certa<strong>in</strong> po<strong>in</strong>ts <strong>in</strong><br />
<strong>time</strong> known a priori. Accord<strong>in</strong>gly, all nodes <strong>in</strong> <strong>time</strong>-trigged systems have a<br />
common notion of <strong>time</strong>, based on approximately synchronized clocks. One<br />
of the most important advantages of <strong>time</strong>-trigged control are predictable temporal<br />
behaviour of the system, which eases system validation and verification<br />
considerably. An example of a <strong>time</strong>-trigged system is the MARS system [7].<br />
In summary, event-triggered designs give faster response at low load but<br />
more overhead and chance of failure at high load. This approach is most suitable<br />
for dynamic environments, where dynamic activites can arrive at any <strong>time</strong>.<br />
Time triggered systems have the opposite properties and are suitable <strong>in</strong> relatively<br />
static environment <strong>in</strong> which a great deal is known about the system<br />
behaviour <strong>in</strong> advance.<br />
We will show <strong>in</strong> this work how event-triggered methods can be comb<strong>in</strong>ed<br />
with <strong>time</strong>-triggered systems to provide for efficient <strong>in</strong>clusion of dynamic activities,<br />
<strong>in</strong> particular sporadic ones.<br />
1.4 Task model<br />
Our methods deal with mixed sets of tasks and constra<strong>in</strong>ts.<br />
1.4.1 Periodic <strong>Tasks</strong><br />
There are several def<strong>in</strong>itions of periodic tasks. The most common one, that has<br />
also been adopted <strong>in</strong> our work, is that a periodic tasks consist of an <strong>in</strong>f<strong>in</strong>ite<br />
sequence of identical activities, called <strong>in</strong>stances, that are <strong>in</strong>voked with<strong>in</strong> regular<br />
<strong>time</strong> periods. Periodic tasks are commonly found <strong>in</strong> applications such as<br />
avionics and process control accurate control requires cont<strong>in</strong>ual sampl<strong>in</strong>g and<br />
process<strong>in</strong>g data. Periodic tasks have usually explicit deadl<strong>in</strong>es that must be<br />
met, i.e., they are usaually hard. We also refer to the periodic tasks as static,<br />
which <strong>in</strong>dicates their exclusive treatment by the offl<strong>in</strong>e scheduler.<br />
1.4.2 Dynamic Arrivals<br />
A dynamic task is a sequential program that is <strong>in</strong>voked by the occurrence of an<br />
event. An event is a stimulus that may be generated by processes external to the<br />
system (e.g., an <strong>in</strong>terrupt from a device) or by processes <strong>in</strong>ternal to the system
14 Task model<br />
(e.g., the arrival of a message). Dynamically arriv<strong>in</strong>g tasks can be categorised<br />
on their criticality and knowledge about their occurence <strong>time</strong>s.<br />
Aperiodic <strong>Tasks</strong> usually arise from asynchronous events outside the system,<br />
such as operator request. Those events have specified response <strong>time</strong>s associated<br />
with them. In general, aperiodic tasks are viewed as be<strong>in</strong>g activated randomly,<br />
follow<strong>in</strong>g a certa<strong>in</strong> statistical distribution (for example, a Poisson distribution).<br />
Aperiodic tasks cannot be fitted <strong>in</strong>to a fixed periodic framework, i.e., their<br />
handl<strong>in</strong>g has to be prepared explicitly for unknown arrival <strong>time</strong>s.<br />
Furthermore, aperiodic tasks can be hard, soft and firm. Hard aperiodic<br />
tasks have str<strong>in</strong>gent tim<strong>in</strong>g constra<strong>in</strong>t that must be met, while soft aperiodic<br />
do not have deadl<strong>in</strong>es at all. A firm aperiodic task has a deadl<strong>in</strong>e that must be<br />
met once the task is guaranteed onl<strong>in</strong>e. The difference between firm and hard<br />
aperiodic tasks is that hard tasks are guaranteed offl<strong>in</strong>e, while firm tasks are<br />
guaranteed onl<strong>in</strong>e, upon their arrival. Methods presented <strong>in</strong> this work provide<br />
for <strong>in</strong>clusion of both firm and soft aperiodic tasks. Firm tasks must be guaranteed<br />
while the soft ones do nor require any acceptance test: they are executed<br />
if there are no ready scheduled or guaranteed tasks.<br />
<strong>Sporadic</strong> <strong>Tasks</strong> handle events that arrive at the system at arbitrary po<strong>in</strong>ts <strong>in</strong><br />
<strong>time</strong>, but with def<strong>in</strong>ed maximum frequency. They are <strong>in</strong>voked repeatedly with<br />
a (non-zero) lower bound on the duration between consecutive occurrences<br />
of the same event. Therefore, each sporadic task will be <strong>in</strong>voked repeatedly<br />
with a lower bound on the <strong>in</strong>terval between consecutive <strong>in</strong>vocations i.e., m<strong>in</strong>imum<br />
<strong>in</strong>ter-arrival <strong>time</strong> between two consecutive <strong>in</strong>vocations. For example, a<br />
sporadic task with a m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong> of 50 ms will not <strong>in</strong>voke its<br />
<strong>in</strong>stances more often than each 50 ms. In reality, it may arrive much less frequent<br />
than once every 50 ms, but if we want to schedule such a task we need<br />
to assume that it will <strong>in</strong>voke its <strong>in</strong>stances with m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong>, i.e.,<br />
maximum frequency.<br />
1.4.3 Simple and Complex Constra<strong>in</strong>ts<br />
In this work, we dist<strong>in</strong>guish between simple constra<strong>in</strong>ts, i.e., period, start-<strong>time</strong>,<br />
and deadl<strong>in</strong>e, for the earliest deadl<strong>in</strong>e first schedul<strong>in</strong>g model, and complex constra<strong>in</strong>ts.<br />
We refer to such relations or attributes of tasks as complex constra<strong>in</strong>ts,<br />
which cannot be expressed directly <strong>in</strong> the earliest deadl<strong>in</strong>e first schedul<strong>in</strong>g<br />
model us<strong>in</strong>g period, start-<strong>time</strong>, and deadl<strong>in</strong>e. In most of the cases, offl<strong>in</strong>e<br />
transformations are needed to schedule these at run<strong>time</strong> (some can be resolved
Task model 15<br />
onl<strong>in</strong>e at the cost of the higher overhead). Here are some examples of complex<br />
constra<strong>in</strong>ts:<br />
Synchronization – Many execution sequences require a precedence order of<br />
task executions. An algoritm for the transformation of precedence constra<strong>in</strong>ts<br />
on s<strong>in</strong>gle processor to suit the EDF schedul<strong>in</strong>g model has been presented <strong>in</strong><br />
[8]. However, many <strong>in</strong>dustrial applications require allocation of tasks with<br />
precedence constra<strong>in</strong>ts on different nodes, i.e., a distributed system with <strong>in</strong>ternode<br />
communication. The transformation of precedence constra<strong>in</strong>ts with an<br />
end-to-end deadl<strong>in</strong>e <strong>in</strong> this case requires subtask deadl<strong>in</strong>e assignment to create<br />
execution w<strong>in</strong>dows on the <strong>in</strong>dividual nodes so that precedence is fulfilled, e.g.,<br />
[9]. A schedulability analysis for pairs of tasks communicat<strong>in</strong>g via a network<br />
<strong>in</strong>stead of decomposition has been presented <strong>in</strong> [10].<br />
Non-periodic execution – Constra<strong>in</strong>ts such as some forms of jitter, e.g., for<br />
feedback loop delay <strong>in</strong> control systems [11], require <strong>in</strong>stances of tasks to be<br />
separated by non-constant length <strong>in</strong>tervals. In order to fit these constra<strong>in</strong>ts <strong>in</strong>to<br />
the periodic task model, it can easily happen that we end up with an overconstra<strong>in</strong>ed<br />
specification.<br />
Non-temporal constra<strong>in</strong>ts – Usually come from the system demands, e.g.,<br />
not to allocate two tasks to the same node, or to have m<strong>in</strong>imum separation<br />
<strong>time</strong>s etc.<br />
Jitter – The execution start or end of a certa<strong>in</strong> task is constra<strong>in</strong>ed by maximum<br />
variations. Strictly periodic execution can solve some <strong>in</strong>stances of this<br />
problem, but over-constra<strong>in</strong>s the specification. Algorithms are computationaly<br />
expensive [12].<br />
Application specific constra<strong>in</strong>ts – Come from application demands, e.g.<br />
dupplicated messages on a bus may need to follow a certa<strong>in</strong> pattern. They<br />
are usually imposed by eng<strong>in</strong>eer<strong>in</strong>g practice: an eng<strong>in</strong>er may want to improve<br />
schedules, creat<strong>in</strong>g new constra<strong>in</strong>ts that reflect his/her practical experience.<br />
Our method uses a general technique, capable of <strong>in</strong>corporat<strong>in</strong>g various types<br />
of constra<strong>in</strong>ts and their comb<strong>in</strong>ations. Those are resolved <strong>in</strong> the offl<strong>in</strong>e part of<br />
the method, without degrad<strong>in</strong>g the system performance under run<strong>time</strong>.
16 This thesis<br />
1.5 This thesis<br />
Dynamically arriv<strong>in</strong>g tasks cannot be fitted <strong>in</strong>to a fixed periodic framework,<br />
i.e., their handl<strong>in</strong>g has to be prepared explicitly for unknown occurence <strong>time</strong>s.<br />
Offl<strong>in</strong>e schedules will generally not be tight, i.e., there will be <strong>time</strong>s where<br />
resources are unused. In this work we try to efficiently reclaim those resources,<br />
and use it for dynamic arrivals, i.e., aperiodic and sporadic tasks.<br />
1.5.1 Motivation and Approach<br />
A variety of algorithms have been presented to handle periodic and aperiodic<br />
tasks, e.g., [13], [14], [15]. An onl<strong>in</strong>e algorithm for schedul<strong>in</strong>g sporadic tasks<br />
with shared resources <strong>in</strong> hard real-<strong>time</strong> systems has been presented <strong>in</strong> [16].<br />
Schedul<strong>in</strong>g of sporadic requests with periodic tasks on an earliest-deadl<strong>in</strong>efirst<br />
(EDF) basis has been presented <strong>in</strong> [17]. An offl<strong>in</strong>e guarantee algorithm<br />
for sporadic tasks based on bandwidth reservation has been presented <strong>in</strong> [18]<br />
for s<strong>in</strong>gle processor systems. <strong>Handl<strong>in</strong>g</strong> of firm aperiodic requests us<strong>in</strong>g a Total<br />
Bandwidth Server has been presented <strong>in</strong> [13]. Onl<strong>in</strong>e guarantees of aperiodic<br />
tasks <strong>in</strong> firm periodic environments, where tasks can skip some <strong>in</strong>stances, have<br />
been described <strong>in</strong> [19].<br />
The slot shift<strong>in</strong>g algorithm to comb<strong>in</strong>e offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g was<br />
presented <strong>in</strong> [20]. It focuses on <strong>in</strong>sert<strong>in</strong>g aperiodic tasks <strong>in</strong>to offl<strong>in</strong>e schedules<br />
by modify<strong>in</strong>g the run<strong>time</strong> representation of available resources. While appropriate<br />
for <strong>in</strong>clud<strong>in</strong>g sequences of aperiodic tasks, the overhead for sporadic<br />
task handl<strong>in</strong>g becomes too high. The use of <strong>in</strong>formation about amount and distribution<br />
of unused resources for non periodic activities is similar to the basic<br />
idea of slack steal<strong>in</strong>g [15], [21] which applies to fixed priority schedul<strong>in</strong>g. The<br />
work presented <strong>in</strong> this thesis is based on slot shift<strong>in</strong>g.<br />
These methods can generally be classified as latest start <strong>time</strong> methods,<br />
s<strong>in</strong>ce they all share the characteristic of postpon<strong>in</strong>g the execution of hard tasks<br />
<strong>in</strong> order to give more resources to the soft tasks. Normally, as long as all<br />
guaranteed tasks meet their deadl<strong>in</strong>es, it doesn’t matter if they complete their<br />
execution <strong>in</strong> advance of their deadl<strong>in</strong>e or just before it.<br />
However, the methods described above concentrate most on particular types<br />
of constra<strong>in</strong>ts. As mentione before, a real-<strong>time</strong> system might need to fullfill<br />
some complex constra<strong>in</strong>ts, <strong>in</strong> addition to basic temporal constra<strong>in</strong>ts of tasks,<br />
such as periods, start-<strong>time</strong>s and deadl<strong>in</strong>es. Those complex constra<strong>in</strong>ts can not<br />
be expressed as generally as the simple ones. Add<strong>in</strong>g complex constra<strong>in</strong>ts to a<br />
chosen schedul<strong>in</strong>g strategy <strong>in</strong>creases schedul<strong>in</strong>g overhead [22] or requires new,
This thesis 17<br />
specific schedulability tests which may have to be developed.<br />
Besides, most of the exist<strong>in</strong>g methods for handl<strong>in</strong>g sporadic tasks perform<br />
only an onl<strong>in</strong>e acceptance test, which <strong>in</strong>troduces extra overhead to the system.<br />
When a set of sporadic tasks arrives at run<strong>time</strong>, a scheduler performs an acceptance<br />
test. The test succeeds if each sporadic task <strong>in</strong> the set can be scheduled<br />
to meet its deadl<strong>in</strong>e, without caus<strong>in</strong>g any previously guaranteed tasks to miss<br />
its deadl<strong>in</strong>e, else it is rejected. A disadvantage with this approach is that if the<br />
set has been rejected, it is too late for countermeasures.<br />
Our method provides an offl<strong>in</strong>e schedulability test for sporadic tasks, based<br />
on slot shift<strong>in</strong>g. It constructs a worst case scenario for the arrival of the sporadic<br />
task set and tries to guarantee it on the top of the offl<strong>in</strong>e schedule. The<br />
guarantee algorithm is applied at selected slots only. At run<strong>time</strong>, it uses the<br />
slot shift<strong>in</strong>g mechanisms to feasibly schedule sporadic tasks <strong>in</strong> union with the<br />
offl<strong>in</strong>e scheduled periodic tasks, while allow<strong>in</strong>g resources to be reclaimed for<br />
aperiodic tasks. S<strong>in</strong>ce the major part of preparations is performed offl<strong>in</strong>e, the<br />
<strong>in</strong>volved onl<strong>in</strong>e mechanisms are simple. Furthermore, the reuse of resources<br />
allows for high resource utilization.<br />
1.5.2 Comb<strong>in</strong>ed Offl<strong>in</strong>e and Onl<strong>in</strong>e Approach<br />
Offl<strong>in</strong>e schedul<strong>in</strong>g methods can accomodate many specific constra<strong>in</strong>ts but at<br />
the expense of run<strong>time</strong> flexibility, <strong>in</strong> particular <strong>in</strong>ability to handle dynamic<br />
activities such as aperiodic and sporadic tasks. On the other hand, if we only<br />
use onl<strong>in</strong>e schedul<strong>in</strong>g, then we might <strong>in</strong>troduce high overhead for resolv<strong>in</strong>g<br />
complex constra<strong>in</strong>ts, or, <strong>in</strong> the worst case, we cannot resolve them at all.<br />
Our method is a comb<strong>in</strong>ed offl<strong>in</strong>e and onl<strong>in</strong>e approach: it <strong>in</strong>tegrates offl<strong>in</strong>e,<br />
<strong>time</strong>-trigged schedul<strong>in</strong>g and dynamic, event-trigged schedul<strong>in</strong>g. We use<br />
slot shift<strong>in</strong>g to elim<strong>in</strong>ate all types of complex constra<strong>in</strong>ts before the run<strong>time</strong> of<br />
the system. They are transformed <strong>in</strong>to a simple EDF model, i.e., periodic tasks<br />
with start <strong>time</strong>s and deadl<strong>in</strong>es. Dynamic activities are <strong>in</strong>corporated <strong>in</strong>to offl<strong>in</strong>e<br />
schedule by mak<strong>in</strong>g use of the unused resources and leeways <strong>in</strong> the schedule.<br />
We assume a resurce <strong>in</strong>sufficient environment, where dynamic activities have<br />
to be guaranteed to fit <strong>in</strong>to the offl<strong>in</strong>e schedule, without affect<strong>in</strong>g any of previously<br />
scheduled or guaranteed activities. We provide both offl<strong>in</strong>e and onl<strong>in</strong>e<br />
mechanisms for deal<strong>in</strong>g with such a priori unknown activities.<br />
The method requires a small run<strong>time</strong> data structure, simple run<strong>time</strong> mechanisms,<br />
go<strong>in</strong>g through a list with <strong>in</strong>crements and decrements, provides Ç Æ<br />
acceptance tests and facilitates changes <strong>in</strong> the set of tasks, for example to handle<br />
overloads. Furthermore, our method provides for handl<strong>in</strong>g of slack of non
18 This thesis<br />
periodic tasks as well, e.g., <strong>in</strong>stances of tasks can be separated by <strong>in</strong>tervals<br />
other than periods.<br />
As a f<strong>in</strong>al result of this work, we provide an algorithms to deal with a<br />
comb<strong>in</strong>ation of mixed sets of tasks and constra<strong>in</strong>ts: periodic tasks with complex<br />
and simple constra<strong>in</strong>ts, soft and firm aperiodic, and <strong>in</strong> particular sporadic<br />
tasks. Instead of provid<strong>in</strong>g algorithms tailored for a specific set of constra<strong>in</strong>ts,<br />
we propose an EDF based run<strong>time</strong> algorithm, and the use of an offl<strong>in</strong>e scheduler<br />
for complexity reduction to transform complex constra<strong>in</strong>ts <strong>in</strong>to the EDF<br />
model. At run<strong>time</strong>, an extension to EDF, two level EDF, ensures feasible execution<br />
of tasks with complex constra<strong>in</strong>ts <strong>in</strong> the presence of additional tasks or<br />
overloads.<br />
1.5.3 <strong>Handl<strong>in</strong>g</strong> sporadic tasks<br />
Offl<strong>in</strong>e schedul<strong>in</strong>g is not suitable for handl<strong>in</strong>g sporadic tasks due to the unknown<br />
arrival <strong>time</strong>s. One approach could be to transform sporadic tasks <strong>in</strong>to<br />
equvalent pseudo-periodic tasks [23] offl<strong>in</strong>e, which can be scheduled simply<br />
at run<strong>time</strong>. However, this may lead to significant under-utilization of the processor<br />
<strong>time</strong>, especially when the deadl<strong>in</strong>e of the pseudo-periodic task is small<br />
compared to the m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong> of sporadic task. That because<br />
a great amount of <strong>time</strong> has to be reserved offl<strong>in</strong>e, before the run<strong>time</strong> of the<br />
system, for servic<strong>in</strong>g dynamic request from sporadic tasks. In extreme cases,<br />
a task handl<strong>in</strong>g an event which is rare, but has a tight deadl<strong>in</strong>e, may require<br />
reservation of all resources.<br />
We present a comb<strong>in</strong>ed offl<strong>in</strong>e and onl<strong>in</strong>e approach for handl<strong>in</strong>g sporadic<br />
tasks. The offl<strong>in</strong>e transformation determ<strong>in</strong>es resource usage and distribution<br />
as well, which we use to handle sporadic tasks. Offl<strong>in</strong>e we assume the worst<br />
case scenario for arrival patterns for sporadic tasks, and onl<strong>in</strong>e we try to reduce<br />
this pessimism by us<strong>in</strong>g the current <strong>in</strong>formation about the system. Dynamic<br />
activites are accomodated without affect<strong>in</strong>g the feasible execution of statically<br />
scheduled tasks.<br />
Offl<strong>in</strong>e part – The offl<strong>in</strong>e transformation determ<strong>in</strong>es resource usage and distribution<br />
as well, which we use to handle sporadic tasks. The sporadic tasks are<br />
guaranteed offl<strong>in</strong>e, dur<strong>in</strong>g design <strong>time</strong>, which allows reschedul<strong>in</strong>g or redesign<br />
<strong>in</strong> the case of failure. An offl<strong>in</strong>e test determ<strong>in</strong>es and allocates resources for<br />
sporadic tasks such that worst case arrivals can be accommodated at any <strong>time</strong>.
Results 19<br />
Onl<strong>in</strong>e part – S<strong>in</strong>ce we do not know when sporadic tasks will arrive at the<br />
system, we need to assume the worst case schenario when guarantee<strong>in</strong>g them<br />
offl<strong>in</strong>e, i.e., we need to assume that sporadic tasks will <strong>in</strong>voke their <strong>in</strong>stances<br />
at the maximum frequency. This is a too pesimistic but neccessary assumption<br />
and we try onl<strong>in</strong>e to reduce this pesimism. At run<strong>time</strong>, an onl<strong>in</strong>e algorithm<br />
keeps track of arrivals of <strong>in</strong>stances of sporadic tasks to reduce pessimism about<br />
future sporadic arrivals and improve response <strong>time</strong>s and acceptance of firm<br />
aperiodic tasks. If a sporadic tasks <strong>in</strong>vokes its <strong>in</strong>stances with less frequency<br />
than the wors case one, then we can easily reclaim its reserved resources for<br />
other dynamic activities, i.e., firm and soft aperiodic tasks. When a sporadic<br />
task arrives, we do not need to account for the <strong>in</strong>vocation of its next <strong>in</strong>stance<br />
at least for the period of its m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong> and reuse its allocated<br />
resources for aperiodic tasks.<br />
1.5.4 Conclusions<br />
We present a method for <strong>in</strong>tegrated offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g of mixed<br />
sets of tasks and constra<strong>in</strong>ts. A complete offl<strong>in</strong>e schedule can be constructed,<br />
transformed <strong>in</strong>to EDF tasks, and scheduled at run<strong>time</strong> together with other EDF<br />
tasks. The transformation is performed to maximize flexibility of task executions.<br />
Dur<strong>in</strong>g offl<strong>in</strong>e analysis our algorithm determ<strong>in</strong>es the amount and location<br />
of unused resources, which we use to <strong>in</strong>clude dynamic activities dur<strong>in</strong>g the<br />
run<strong>time</strong> of the system. In particular, we presented an efficient method to handle<br />
sporadic tasks, provid<strong>in</strong>g for Ç Æ onl<strong>in</strong>e acceptance test for firm aperiodic<br />
tasks.<br />
The sporadic tasks are guaranteed dur<strong>in</strong>g design <strong>time</strong>, allow<strong>in</strong>g reschedul<strong>in</strong>g<br />
or redesign <strong>in</strong> the case of failure. At run<strong>time</strong>, resources reserved for sporadic<br />
tasks can be reclaimed and used for efficient aperiodic task handl<strong>in</strong>g.<br />
Thus, our method comb<strong>in</strong>es handl<strong>in</strong>g of complex constra<strong>in</strong>ts, efficient and<br />
flexible run<strong>time</strong> schedul<strong>in</strong>g, as well as offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g, provid<strong>in</strong>g<br />
a basis for predictably flexible real-<strong>time</strong> systems<br />
1.6 Results<br />
This section sumarizes the ma<strong>in</strong> contribution of each paper <strong>in</strong> the thesis.
20 Results<br />
1.6.1 Paper A<br />
Damir Isovic and Gerhard Fohler, <strong>Handl<strong>in</strong>g</strong> <strong>Sporadic</strong> <strong>Tasks</strong> <strong>in</strong> Offl<strong>in</strong>e Scheduled<br />
Distributed <strong>Real</strong>-Time <strong>Systems</strong>, In Proceed<strong>in</strong>gs of 11th EUROMICRO<br />
Conference on <strong>Real</strong>-Time <strong>Systems</strong> York, England , July 1999.<br />
Summary In this paper, we presented an algorithm to handle event-triggered<br />
sporadic tasks, i.e., with unknown arrival <strong>time</strong>s, but known maximum arrival<br />
frequencies, <strong>in</strong> the context of <strong>time</strong>-triggered, distributed schedules with general<br />
constra<strong>in</strong>ts. The sporadic tasks are guaranteed dur<strong>in</strong>g design <strong>time</strong>, allow<strong>in</strong>g<br />
reschedul<strong>in</strong>g or redesign <strong>in</strong> the case of failure. At run<strong>time</strong>, resources reserved<br />
for sporadic tasks can be reclaimed and used for efficient aperiodic task handl<strong>in</strong>g.<br />
Our algorithm is based on the slot shift<strong>in</strong>g method, which provides for the<br />
comb<strong>in</strong>ation of <strong>time</strong>-triggered offl<strong>in</strong>e schedule construction and onl<strong>in</strong>e schedul<strong>in</strong>g<br />
of aperiodic activities. It analyzes constructed schedules for unused resources<br />
and leeway <strong>in</strong> task executions first. The run<strong>time</strong> scheduler uses this<br />
<strong>in</strong>formation to <strong>in</strong>clude aperiodic tasks, shift<strong>in</strong>g other task executions (”slots”)<br />
to reduce response <strong>time</strong>s without affect<strong>in</strong>g feasibility. It can also be used to<br />
perform onl<strong>in</strong>e guarantees.<br />
We provided an offl<strong>in</strong>e schedulability test for sporadic tasks based on slot<br />
shift<strong>in</strong>g. It constructs a worst case scenario for the arrival of the sporadic task<br />
set and tries to guarantee it <strong>in</strong> the offl<strong>in</strong>e schedule. The guarantee algorithm is<br />
applied at selected slots only. At run<strong>time</strong>, it uses the slot shift<strong>in</strong>g mechanisms<br />
to feasibly schedule sporadic tasks <strong>in</strong> union with the offl<strong>in</strong>e scheduled periodic<br />
tasks, while allow<strong>in</strong>g resources to be reclaimed for aperiodic tasks.<br />
S<strong>in</strong>ce the major part of preparations is performed offl<strong>in</strong>e, the <strong>in</strong>volved onl<strong>in</strong>e<br />
mechanisms are simple. Furthermore, the reuse of resources allows for<br />
high resource utilization.<br />
1.6.2 Paper B<br />
Damir Isovic and Gerhard Fohler, Onl<strong>in</strong>e <strong>Handl<strong>in</strong>g</strong> of Firm Aperiodic <strong>Tasks</strong> <strong>in</strong><br />
Time Triggered <strong>Systems</strong>, In WiP proceed<strong>in</strong>gs of 12th EUROMICRO Conference<br />
on <strong>Real</strong>-Time <strong>Systems</strong>, Stockholm, Sweden , June 2000.<br />
Summary In this paper we presented an algorithm for the flexible handl<strong>in</strong>g<br />
of firm aperiodic tasks <strong>in</strong> offl<strong>in</strong>e scheduled systems. It is based on slot shift<strong>in</strong>g,<br />
a method to comb<strong>in</strong>e offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g methods.
Results 21<br />
First, a standard offl<strong>in</strong>e scheduler constructs a schedule, resolv<strong>in</strong>g complex<br />
task constra<strong>in</strong>ts such as precedence, distribution, and end-to-end deadl<strong>in</strong>es.<br />
This is then analyzed for unused resources and leeway <strong>in</strong> task executions.<br />
The run<strong>time</strong> scheduler uses this <strong>in</strong>formation to handle aperiodic tasks,<br />
shift<strong>in</strong>g other task executions (”slots”) to reduce response <strong>time</strong>s without affect<strong>in</strong>g<br />
feasibility. We provided an Ç Æ acceptance test for a set of aperiodic<br />
tasks on the offl<strong>in</strong>e schedule and guarantee tasks without explicit reservation<br />
of resources. Our method supports flexible, value based selections of tasks to<br />
reject or remove <strong>in</strong> overload situations, and simple resource reclaim<strong>in</strong>g.<br />
While the current algorithm enables the rejection and removal of tasks, it<br />
does not address the issue of selection. We are <strong>in</strong>vestigat<strong>in</strong>g <strong>in</strong>to provid<strong>in</strong>g a<br />
number of overload handl<strong>in</strong>g strategies, e.g., [24], [25].<br />
In a previous paper [26], we presented an offl<strong>in</strong>e test for sporadic tasks<br />
based on worst case arrival assumptions. It cannot utilize less frequent arrivals<br />
for firm aperiodic tasks s<strong>in</strong>ce the run<strong>time</strong> overheads to reflect the cont<strong>in</strong>uous<br />
changes <strong>in</strong> resource availability are prohibitively high. We are look<strong>in</strong>g <strong>in</strong>to<br />
apply<strong>in</strong>g the algorithm presented here to handle sporadic tasks at run<strong>time</strong>.<br />
1.6.3 Paper C<br />
Damir Isovic and Gerhard Fohler, Efficient Schedul<strong>in</strong>g of <strong>Sporadic</strong>, Aperiodic,<br />
and Periodic <strong>Tasks</strong> with Complex Constra<strong>in</strong>ts, In Proceed<strong>in</strong>gs of the 21st IEEE<br />
<strong>Real</strong>-Time <strong>Systems</strong> Symposium, Walt Disney World, Orlando, Florida, USA ,<br />
November 2000.<br />
Summary In this paper we have presented methods to schedule sets of mixed<br />
types of tasks with complex constra<strong>in</strong>ts, by us<strong>in</strong>g earliest deadl<strong>in</strong>e first schedul<strong>in</strong>g<br />
and offl<strong>in</strong>e complexity reduction. In particular, we have proposed an algorithm<br />
to handle sporadic tasks to improve response <strong>time</strong>s and acceptance of<br />
firm aperiodic tasks.<br />
We have presented the use of an offl<strong>in</strong>e scheduler to transform complex<br />
constra<strong>in</strong>ts of tasks <strong>in</strong>to start<strong>time</strong>s and deadl<strong>in</strong>es of tasks for simple EDF run<strong>time</strong><br />
schedul<strong>in</strong>g. We provided an extension to EDF, two level EDF, to ensure<br />
feasible execution of these tasks <strong>in</strong> the presence of additional tasks or overloads.<br />
Dur<strong>in</strong>g offl<strong>in</strong>e analysis our algorithm determ<strong>in</strong>es the amount and location<br />
of unused resources, which we use to provide Ç Æ onl<strong>in</strong>e acceptance<br />
tests for firm aperiodic tasks. We presented an algorithm for handl<strong>in</strong>g offl<strong>in</strong>e<br />
guaranteed sporadic tasks, which keeps track of arrivals of <strong>in</strong>stances of sporadic<br />
tasks at run<strong>time</strong>. It uses this updated <strong>in</strong>formation to reduce pessimism
22 Results<br />
about future sporadic arrivals and improve response <strong>time</strong>s and acceptance of<br />
firm aperiodic tasks. Results of simulation study show the effectiveness of the<br />
algorithms.<br />
Future research will deal with extend<strong>in</strong>g the algorithm to <strong>in</strong>clude <strong>in</strong>terrupts,<br />
overload handl<strong>in</strong>g, and aperiodic and sporadic tasks with complex constra<strong>in</strong>ts<br />
as well. We are study<strong>in</strong>g the <strong>in</strong>clusion of server algorithms, e.g., [27] <strong>in</strong>to<br />
our schedul<strong>in</strong>g model by <strong>in</strong>clud<strong>in</strong>g bandwidth as additional requirement <strong>in</strong> the<br />
offl<strong>in</strong>e transformation.<br />
1.6.4 Paper D<br />
Damir Isovic and Gerhard Fohler, Efficient Schedul<strong>in</strong>g of <strong>Sporadic</strong>, Aperiodic,<br />
and Periodic <strong>Tasks</strong> with Complex Constra<strong>in</strong>ts – Simulation Analysis, Technical<br />
Report , Mälardalen <strong>Real</strong>-Time Research Centre, Mälardalen University, May<br />
2001.<br />
Summary In this paper we present the simulation results for proposed algorithms<br />
to handle mixed sets of tasks and sonstra<strong>in</strong>ts: periodic tasks with<br />
complex and simple constra<strong>in</strong>ts, soft and firm aperiodics, and sporadic tasks.<br />
In particular, we simulated the algorithms to efficently handle sporadic<br />
tasks <strong>in</strong> order to <strong>in</strong>crease acceptance ratio for onl<strong>in</strong>e arriv<strong>in</strong>g firm aperiodic<br />
tasks. We have simulated the proposed guarantee algorithms and the results<br />
underl<strong>in</strong>es the effectiveness of the proposed approach.
Bibliography<br />
[1] John Stankovic and Krithi Ramamritham. Tutorial on hard real-<strong>time</strong> systems.<br />
IEEE Computer Society Press, 1988.<br />
[2] J.A. Stankovic, K. Ramamritham, and C.-S. Cheng. Evaluation of a<br />
flexible task schedul<strong>in</strong>g algorithm for distributed hard real-<strong>time</strong> systems.<br />
IEEE Trans. on comp., 34(12), Dec 1995.<br />
[3] J.A. Stankovic et. al. Implications of classical schedul<strong>in</strong>g results for real<strong>time</strong><br />
systems. IEEE Computer, Vol. 28, No. 6, pp. 16-25, June 1995.<br />
[4] J.A. Stankovic, C. Lu, and S.H. Son. The case for feedback control <strong>in</strong><br />
real-<strong>time</strong> schedul<strong>in</strong>g. In Proc. 11th IEEE Euromicro Conference on <strong>Real</strong>-<br />
Time, York, England, 1998.<br />
[5] C.L. Liu and J.W. Layland. Schedul<strong>in</strong>g algorithms for multiprogramm<strong>in</strong>g<br />
<strong>in</strong> hard real-<strong>time</strong> environment. Journ. of the ACM, 20, 1, Jan. 1973.<br />
[6] J. A. Stankovic and K. Ramamritham. The Spr<strong>in</strong>g kernel: A new<br />
paradigm for real-<strong>time</strong> operat<strong>in</strong>g systems. IEEE Software, pages 62–72,<br />
May 1991.<br />
[7] A. Damm, J. Reis<strong>in</strong>ger, W. Schwabl, and H. Kopetz. The real-<strong>time</strong> operat<strong>in</strong>g<br />
system of MARS. ACM Operat<strong>in</strong>g <strong>Systems</strong> Review, SIGOPS,<br />
23(3):141–157, 1989.<br />
[8] H. Chetto, M. Silly, and T. Bouchentouf. Dynamic schedul<strong>in</strong>g of real<strong>time</strong><br />
tasks under precedence constra<strong>in</strong>ts. <strong>Real</strong>-Time <strong>Systems</strong> Journal,<br />
2(3):181–194, Sept. 1990.<br />
[9] M. DiNatale and J.A. Stankovic. Applicability of simulated anneal<strong>in</strong>g<br />
methods to real-<strong>time</strong> schedul<strong>in</strong>g and jitter control. In Proceed<strong>in</strong>gs of<br />
<strong>Real</strong>-Time <strong>Systems</strong> Symposium, Dec. 1995.
24 BIBLIOGRAPHY<br />
[10] K. T<strong>in</strong>dell and J. Clark. Holistic schedulability analysis for distributed<br />
hard real-<strong>time</strong> systems. Microprocess<strong>in</strong>g and Microprogramm<strong>in</strong>g, 50(2-<br />
3), 1994.<br />
[11] M. Törngren. Fundamentals of implement<strong>in</strong>g real-<strong>time</strong> control applications<br />
<strong>in</strong> distributed computer systems. <strong>Real</strong>-Time <strong>Systems</strong>, 1997.<br />
[12] S. Baruah, G. Buttazzo, S. Gor<strong>in</strong>sky, and G. Lipari. Schedul<strong>in</strong>g periodic<br />
task systems to m<strong>in</strong>imize output jitter. In Sixth International Conference<br />
on <strong>Real</strong>-Time Comput<strong>in</strong>g <strong>Systems</strong> and Applications, Dec. 1999.<br />
[13] M. Spuri, Giorgio C. Buttazzo, and F. Sens<strong>in</strong>i. Robust aperiodic schedul<strong>in</strong>g<br />
under dynamic priority systems. In Proc. of the IEEE RTSS, Dec.<br />
1995.<br />
[14] B. Sprunt, L. Sha, and J. Lehoczky. Aperiodic task schedul<strong>in</strong>g for hard<br />
real-<strong>time</strong> systems. <strong>Real</strong>-Time <strong>Systems</strong> Journal, 1(1):27–60, June 1989.<br />
[15] S. R. Thuel and J.P. Lehoczky. Algorithms for schedul<strong>in</strong>g hard aperiodic<br />
tasks <strong>in</strong> fixed-priority systems us<strong>in</strong>g slack steal<strong>in</strong>g. In Procedd<strong>in</strong>gs of the<br />
<strong>Real</strong>-Time Symposium, pages 22–33, San Juan, Puerto Rico, Dec. 1994.<br />
[16] K. Jeffay. Schedul<strong>in</strong>g sporadic tasks with shared resources <strong>in</strong> hard real<strong>time</strong><br />
systems. Dept. of Comp. Sci., Univ. of North Carol<strong>in</strong>a at Chapel<br />
Hill, 1992.<br />
[17] T. Tia, W.S. Liu, J. Sun, and R. Ha. A l<strong>in</strong>ear-<strong>time</strong> optimal acceptance<br />
test for schedul<strong>in</strong>g of hard real-<strong>time</strong> tasks. Dept. of Comp. Sc., Univ. of<br />
Ill<strong>in</strong>ois at Urbana-Champaign, 1994.<br />
[18] G.C. Buttazzo, G. Lipari, and L. Abeni. A bandwidth reservation algorithm<br />
for multi-application systems. Proc. of the Intl. Conf. on <strong>Real</strong>-<strong>time</strong><br />
Comput<strong>in</strong>g <strong>Systems</strong> and Applications, Japan, 1998.<br />
[19] M. Caccamo and Giorgio C. Buttazzo. Exploit<strong>in</strong>g skips <strong>in</strong> periodic tasks<br />
for enhanc<strong>in</strong>g aperiodic responsiveness. Proc. of the 18th <strong>Real</strong>-Time <strong>Systems</strong><br />
Symposium, USA, Dec. 1997.<br />
[20] G. Fohler. Jo<strong>in</strong>t schedul<strong>in</strong>g of distributed complex periodic and hard aperiodic<br />
tasks <strong>in</strong> statically scheduled systems. In Proc. 16th <strong>Real</strong>-<strong>time</strong> <strong>Systems</strong><br />
Symposium, Pisa, Italy, 1995.
BIBLIOGRAPHY 25<br />
[21] R.I. Davis, K.W. T<strong>in</strong>dell, and A. Burns. Schedul<strong>in</strong>g slack <strong>time</strong> <strong>in</strong> fixed<br />
priority pre-emptive systems. In Procedd<strong>in</strong>gs of the <strong>Real</strong>-Time Symposium,<br />
pages 222–231, Dec. 1993.<br />
[22] V. Yodaiken. Rough notes on priority <strong>in</strong>heritance. Technical report, New<br />
Mexico Institut of M<strong>in</strong><strong>in</strong>g, 1998.<br />
[23] A. K. Mok. Fundamental Design Problems of Distributed <strong>Systems</strong> for<br />
the Hard <strong>Real</strong>-Time Environment. PhD thesis, MIT, 1983. Report<br />
MIT/LCS/TR-297.<br />
[24] G. Buttazzo and J. Stankovic. Add<strong>in</strong>g Robustness <strong>in</strong> Dynamic Preemptive<br />
Schedul<strong>in</strong>g. Kluwer Academic Publishers, 1995.<br />
[25] S. A. Aldarmi and A. Burns. Dynamic value-density for schedul<strong>in</strong>g real<strong>time</strong><br />
systems. In Proceed<strong>in</strong>gs 11th Euromicro Conference on <strong>Real</strong>-Time<br />
<strong>Systems</strong>, Dec 1999.<br />
[26] Damir Isovic and Gerhard Fohler. <strong>Handl<strong>in</strong>g</strong> sporadic tasks <strong>in</strong> off-l<strong>in</strong>e<br />
scheduled distributed hard real-<strong>time</strong> systems. Proc. of 11th EUROMICRO<br />
conf. on RT systems, York, UK, June 1999.<br />
[27] L. Abeni and G. Buttazzo. Integrat<strong>in</strong>g mul<strong>time</strong>dia applications <strong>in</strong> hard<br />
real-<strong>time</strong> systems. In Proceed<strong>in</strong>gs of <strong>Real</strong>-Time <strong>Systems</strong> Symposium, Dec.<br />
1998.
Chapter 2<br />
Paper A: <strong>Handl<strong>in</strong>g</strong> <strong>Sporadic</strong><br />
<strong>Tasks</strong> <strong>in</strong> Offl<strong>in</strong>e Scheduled<br />
Distributed <strong>Real</strong>-Time<br />
<strong>Systems</strong><br />
Damir Isovic and Gerhard Fohler<br />
In Proceed<strong>in</strong>gs of 11th EUROMICRO Conference on <strong>Real</strong>-Time <strong>Systems</strong> York,<br />
England, July 1999
Abstract<br />
Many <strong>in</strong>dustrial applications mandate the use of a <strong>time</strong>-triggered paradigm<br />
and consequently the use of off-l<strong>in</strong>e schedul<strong>in</strong>g for reasons such as predictability,<br />
certification, cost, or product reuse. The construction of an off-l<strong>in</strong>e schedule<br />
requires complete knowledge about all temporal aspects of the application.<br />
The acquisition of this <strong>in</strong>formation may <strong>in</strong>volve unacceptable cost or be impossible.<br />
Often, only partial <strong>in</strong>formation is available from the controlled environment.<br />
In this paper, we present an algorithm to handle event-triggered sporadic<br />
tasks, i.e., with unknown arrival <strong>time</strong>s, but known maximum arrival frequencies,<br />
<strong>in</strong> the context of distributed, off-l<strong>in</strong>e scheduled systems. <strong>Sporadic</strong> tasks<br />
are guaranteed dur<strong>in</strong>g design <strong>time</strong>, allow<strong>in</strong>g reschedul<strong>in</strong>g or redesign <strong>in</strong> the<br />
failure case. At run-<strong>time</strong>, the sporadic tasks are scheduled dynamically, allow<strong>in</strong>g<br />
the reuse of resources reserved for, but not consumed by the sporadic<br />
tasks. We provide an off-l<strong>in</strong>e schedulability test for sporadic tasks and apply<br />
the method to perform on-l<strong>in</strong>e schedul<strong>in</strong>g on top of off-l<strong>in</strong>e schedules. S<strong>in</strong>ce<br />
the major part of preparations is performed off-l<strong>in</strong>e, the <strong>in</strong>volved on-l<strong>in</strong>e mechanisms<br />
are simple. The on-l<strong>in</strong>e reuse of resources allows for high resource<br />
utilization.
28 Introduction<br />
2.1 Introduction<br />
Off-l<strong>in</strong>e schedul<strong>in</strong>g is mandated by a number of <strong>in</strong>dustrial applications. Predictability,<br />
cost, product reuse, and ma<strong>in</strong>tenance are examples for reasons advocat<strong>in</strong>g<br />
a <strong>time</strong>-triggered approach. The off-l<strong>in</strong>e construction of schedules,<br />
however, requires complete knowledge about application characteristics before<br />
the run-<strong>time</strong> of the system. Often, such comprehensive <strong>in</strong>formation is<br />
<strong>in</strong>accessible due to high cost of acquisition or unavailability. Rather, <strong>in</strong>complete<br />
characteristics are available. One typical, partially known property is the<br />
arrival <strong>time</strong> of activities. Instead of exact arrival patterns, bounds on the arrival<br />
frequencies are known, e.g., derived from a model of a physical process. One<br />
such limit is the m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong> between subsequent <strong>in</strong>stances of<br />
tasks. <strong>Tasks</strong> for which it is known are called sporadic tasks [1].<br />
The use of off-l<strong>in</strong>e schedul<strong>in</strong>g for sporadic tasks is problematic; they can<br />
be transformed <strong>in</strong>to pseudo-periodic tasks [1], but with potentially prohibitive<br />
overhead.<br />
An on-l<strong>in</strong>e algorithm for schedul<strong>in</strong>g sporadic tasks with shared resources<br />
<strong>in</strong> hard real-<strong>time</strong> systems has been presented <strong>in</strong> [2]. Schedul<strong>in</strong>g of sporadic<br />
requests with periodic tasks on an earliest-deadl<strong>in</strong>e-first (EDF) basis [3] has<br />
been presented <strong>in</strong> [4]. <strong>Handl<strong>in</strong>g</strong> of firm aperiodic requests us<strong>in</strong>g a Total Bandwidth<br />
Server has been presented <strong>in</strong> [5]. On-l<strong>in</strong>e guarantees of aperiodic tasks<br />
<strong>in</strong> firm periodic environments, where tasks can skip some <strong>in</strong>stances, have been<br />
described <strong>in</strong> [6]. <strong>Systems</strong> conta<strong>in</strong><strong>in</strong>g hard real-<strong>time</strong> sporadic tasks have been<br />
analyzed for their worst case behavior <strong>in</strong> [7].<br />
These algorithms above perform on-l<strong>in</strong>e guarantees. When a set of sporadic<br />
tasks arrives at run-<strong>time</strong> to the system, a scheduler performs an acceptance<br />
test. The test succeeds if each sporadic task <strong>in</strong> the set can be scheduled to<br />
meet its deadl<strong>in</strong>e, without caus<strong>in</strong>g any off-l<strong>in</strong>e guaranteed periodic tasks or<br />
previously accepted non-periodic tasks to miss its deadl<strong>in</strong>e, else it is rejected.<br />
A disadvantage with this approach is that if the set has been rejected, it is too<br />
late for countermeasures.<br />
An off-l<strong>in</strong>e guarantee algorithm for sporadic tasks based on bandwidth<br />
reservation has been presented <strong>in</strong> [8] for s<strong>in</strong>gle processor systems.<br />
In this paper, we present a method provid<strong>in</strong>g an off-l<strong>in</strong>e feasibility test<br />
for sporadic tasks on top of an off-l<strong>in</strong>e scheduled, distributed periodic task<br />
set with general constra<strong>in</strong>ts, e.g., precedence; reschedul<strong>in</strong>g or redesign can be<br />
performed, should the test fail. Given the deadl<strong>in</strong>e, maximum frequency and<br />
execution <strong>time</strong> for each task <strong>in</strong> the sporadic task set, we can create a worst case<br />
load pattern. Then, we try to guarantee this worst case sporadic demand with<strong>in</strong>
System description and task model 29<br />
the periodic schedule before the system starts its execution. We have to account<br />
for arrivals at any <strong>time</strong>; it is, however, sufficient to <strong>in</strong>vestigate only some<br />
selected po<strong>in</strong>ts <strong>in</strong> <strong>time</strong>. Our method is based on the slot shift<strong>in</strong>g [9] method,<br />
which provides for the comb<strong>in</strong>ation of off-l<strong>in</strong>e and on-l<strong>in</strong>e schedul<strong>in</strong>g. After a<br />
static schedule for the distributed periodic tasks has been created off-l<strong>in</strong>e <strong>in</strong> a<br />
first step, the amount and distribution of unused resources and leeways <strong>in</strong> it is<br />
determ<strong>in</strong>ed. These are then used to <strong>in</strong>corporate aperiodic tasks <strong>in</strong>to the schedule<br />
by shift<strong>in</strong>g the off-l<strong>in</strong>e scheduled tasks’ execution, without violat<strong>in</strong>g their<br />
feasibility. An on-l<strong>in</strong>e mechanism is used to guarantee and schedule aperiodic<br />
tasks. Us<strong>in</strong>g the on-l<strong>in</strong>e schedul<strong>in</strong>g algorithm of slot shift<strong>in</strong>g, the resources reserved<br />
for, but not consumed by sporadic tasks can be reused. Should sporadic<br />
tasks arrive at less than their guaranteed maximum frequency, their resources<br />
can be reclaimed, e.g., for aperiodic tasks. Furthermore, the on-l<strong>in</strong>e algorithm<br />
of slot shift<strong>in</strong>g has been modified to schedule guaranteed sporadic requests.<br />
The method presented <strong>in</strong> this paper allows for the handl<strong>in</strong>g of distributed<br />
periodic tasks with general constra<strong>in</strong>ts, such as precedence, based on the <strong>time</strong>triggered<br />
paradigm, together with the event-triggered schedul<strong>in</strong>g of guaranteed<br />
sporadic tasks and onl<strong>in</strong>e aperiodic tasks, possibly reclaim<strong>in</strong>g resources.<br />
The rest of this paper is organized as follows: First, a description of system<br />
and task model is given <strong>in</strong> section 2.2, and a brief summary of the slot shift<strong>in</strong>g<br />
method <strong>in</strong> section 2.3. The off-l<strong>in</strong>e guarantee test for the sporadic tasks is<br />
presented <strong>in</strong> section 2.4, followed by the onl<strong>in</strong>e mechanisms <strong>in</strong> section 2.5. An<br />
example <strong>in</strong> section 2.6 illustrates the discussed mechanisms. F<strong>in</strong>ally, section<br />
2.7 concludes the paper.<br />
2.2 System description and task model<br />
The system is considered to be distributed, i.e., one that consists of several<br />
process<strong>in</strong>g and communication nodes [10].<br />
2.2.1 Time model<br />
We assume a discrete <strong>time</strong> model [11]. Time ticks are counted globally, by a<br />
synchronized clock with granularity of slot length, and assigned numbers from<br />
0to . The <strong>time</strong> between the start and the end of a slot i is def<strong>in</strong>ed by the<br />
<strong>in</strong>terval �×ÐÓØÐ�Ò�Ø� £ �� ×ÐÓØÐ�Ò�Ø� £ � ℄. Slots have uniform length and<br />
start and end at the same <strong>time</strong> for all nodes <strong>in</strong> the system. Task periods and<br />
deadl<strong>in</strong>es must be multiples of the slot length.
30 Integrated off-l<strong>in</strong>e and on-l<strong>in</strong>e Schedul<strong>in</strong>g<br />
2.2.2 Off-l<strong>in</strong>e periodic schedule<br />
A schedule is a sequence of n slots. For static schedules the number of slots is<br />
typically equal to the least common multiple (LCM) of all <strong>in</strong>volved periods.<br />
2.2.3 Task model<br />
All tasks <strong>in</strong> the system are fully preemptive and communicate with the rest<br />
of the system via data read at the beg<strong>in</strong>n<strong>in</strong>g and written at the end of their<br />
executions.<br />
Periodic tasks execute their <strong>in</strong>vocations with<strong>in</strong> regular <strong>time</strong> <strong>in</strong>tervals. A periodic<br />
task ÌÈ is characterized by its maximum execution <strong>time</strong> (Å��Ì) [12],<br />
period (È ) and relative deadl<strong>in</strong>e of (�Ð).<br />
The � Ø� <strong>in</strong>vocation of ÌÈ is denoted Ì � È<br />
and is characterized by its earliest<br />
start <strong>time</strong> (�×Ø) and absolute deadl<strong>in</strong>e (�Ð). The absolute deadl<strong>in</strong>e of the � Ø�<br />
<strong>in</strong>vocation of ÌÈ is equal to the sum of the earliest start <strong>time</strong> of its preced<strong>in</strong>g<br />
<strong>in</strong>vocation and the relative deadl<strong>in</strong>e.<br />
Aperiodic tasks are <strong>in</strong>voked only once. Their arrival <strong>time</strong>s are unknown at<br />
design <strong>time</strong>. A hard aperiodic task � has the follow<strong>in</strong>g set of parameters: the<br />
arrival <strong>time</strong> (�), maximum execution <strong>time</strong> and relative deadl<strong>in</strong>e. Soft aperiodic<br />
tasks have no deadl<strong>in</strong>e constra<strong>in</strong>ts.<br />
<strong>Sporadic</strong> tasks arrive to the system at random po<strong>in</strong>ts <strong>in</strong> <strong>time</strong>, but with def<strong>in</strong>ed<br />
m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong>s between two consecutive <strong>in</strong>vocations. We<br />
do not know when they arrive to the system, but we do know their maximum<br />
frequency. A sporadic task ÌË is characterized by its relative deadl<strong>in</strong>e, m<strong>in</strong>imum<br />
<strong>in</strong>ter-arrival <strong>time</strong> (�) and maximum execution <strong>time</strong>.<br />
The attributes above are known before the run-<strong>time</strong> of the system. The additional<br />
<strong>in</strong>formation that becomes available on-l<strong>in</strong>e, upon the arrival <strong>time</strong> of the<br />
� � <strong>in</strong>vocation is its arrival <strong>time</strong> and its absolute deadl<strong>in</strong>e.<br />
2.3 Integrated off-l<strong>in</strong>e and on-l<strong>in</strong>e Schedul<strong>in</strong>g<br />
In this section, we briefly describe the slot shift<strong>in</strong>g method which we use as<br />
a basis to comb<strong>in</strong>e off-l<strong>in</strong>e and on-l<strong>in</strong>e schedul<strong>in</strong>g. It provides for the efficient<br />
handl<strong>in</strong>g and possibly on-l<strong>in</strong>e guarantee of aperiodic tasks on top of a
Integrated off-l<strong>in</strong>e and on-l<strong>in</strong>e Schedul<strong>in</strong>g 31<br />
distributed schedule with general task constra<strong>in</strong>ts. Slot shift<strong>in</strong>g extracts <strong>in</strong>formation<br />
about unused resources and leeway <strong>in</strong> an off-l<strong>in</strong>e schedule and uses this<br />
<strong>in</strong>formation to add tasks feasibly, i.e., without violat<strong>in</strong>g requirements on the<br />
already scheduled tasks. A detailed description can be found <strong>in</strong> [9].<br />
2.3.1 Off-l<strong>in</strong>e preparations<br />
First, an off-l<strong>in</strong>e scheduler [13] creates schedul<strong>in</strong>g tables for the periodic tasks.<br />
It allocates tasks to nodes and resolves precedence constra<strong>in</strong>ts by order<strong>in</strong>g task<br />
executions.<br />
Start-<strong>time</strong>s and deadl<strong>in</strong>es The schedul<strong>in</strong>g tables list fixed start- and end<br />
<strong>time</strong>s of task executions, that are less flexible than possible. The only assignments<br />
fixed by specification, however, are the <strong>in</strong>itiat<strong>in</strong>g and conclud<strong>in</strong>g tasks<br />
<strong>in</strong> the precedence graph, and, as we assume message transmission <strong>time</strong>s to be<br />
fixed here 1 , tasks send<strong>in</strong>g or receiv<strong>in</strong>g <strong>in</strong>ter-node messages. These are the only<br />
fixed start-<strong>time</strong>s and deadl<strong>in</strong>es, all others are calculated recursively, as the execution<br />
of all other tasks may vary with<strong>in</strong> the precedence order, i.e., they can<br />
be shifted.<br />
Intervals and spare capacities The deadl<strong>in</strong>es of tasks are then sorted for<br />
each node and the schedule is divided <strong>in</strong>to a set of disjo<strong>in</strong>t execution <strong>in</strong>tervals<br />
for each node. Spare capacities are def<strong>in</strong>ed for these <strong>in</strong>tervals.<br />
Each deadl<strong>in</strong>e calculated for a task def<strong>in</strong>es the end of an <strong>in</strong>terval Á �, �Ò� Á� .<br />
Several tasks with the same deadl<strong>in</strong>e constitute one <strong>in</strong>terval.<br />
The spare capacities of an <strong>in</strong>terval Á� are calculated as given <strong>in</strong> formula 2.1:<br />
× Á� � �Á�� �<br />
Ì Á�<br />
Å��Ì Ì Ñ�Ò × Á� � (2.1)<br />
The length of Á� m<strong>in</strong>us the sum of the activities assigned to it is the amount of<br />
idle <strong>time</strong>s <strong>in</strong> that <strong>in</strong>terval. These have to be decreased by the amount “lent” to<br />
subsequent <strong>in</strong>tervals: <strong>Tasks</strong> may execute <strong>in</strong> <strong>in</strong>tervals prior to the one they are<br />
assigned to. Then they “borrow” spare capacity from the “earlier” <strong>in</strong>terval.<br />
1We apply the same mechanisms to the network as well, i.e., shift<strong>in</strong>g messages, as detailed <strong>in</strong><br />
[9].
32 Acceptance test for a set of sporadic tasks<br />
2.3.2 On-L<strong>in</strong>e mechanisms<br />
Dur<strong>in</strong>g system operation, the on-l<strong>in</strong>e scheduler is <strong>in</strong>voked after each slot. It<br />
checks whether aperiodic tasks have arrived, performs the guarantee algorithm,<br />
and selects a task for execution. This decision is then used to update the spare<br />
capacities. F<strong>in</strong>ally the schedul<strong>in</strong>g decision is executed <strong>in</strong> the next slot.<br />
Guarantee Algorithm Assume that an aperiodic task Ì � is tested for guarantee.<br />
We identify three parts of the total spare capacities available:<br />
¯ × Á Ø, the rema<strong>in</strong><strong>in</strong>g spare capacity of the current <strong>in</strong>terval,<br />
¯ È × Á� � ��� Ð� �Ò� ÁÐ � �Ð Ì� ��Ò� ÁÐ ��Ð Ì� �× Á� �<br />
, the positive spare capacities of all full <strong>in</strong>tervals between Ø and �Ð Ì � ,<br />
and<br />
¯ Ñ�Ò × ÁÐ ��Ð Ì� ×Ø�ÖØ ÁÐ , the spare capacity of the last <strong>in</strong>terval,<br />
or the execution need of Ì � before its deadl<strong>in</strong>e <strong>in</strong> this <strong>in</strong>terval,<br />
whichever is smaller.<br />
If the sum of all three is larger than Å��Ì Ì� , Ì� can be accommodated,<br />
and therefore guaranteed. Upon guarantee of a task, the spare capacities are<br />
updated to reflect the decrease <strong>in</strong> available resources. This guarantee algorithm<br />
is Ç Æ , N be<strong>in</strong>g the number of <strong>in</strong>tervals. It is shown <strong>in</strong> [14], that this<br />
acceptance test has equivalent results – but with simpler run-<strong>time</strong> handl<strong>in</strong>g – as<br />
to the ones presented <strong>in</strong> [15] and [16], which are optimal for s<strong>in</strong>gle processors.<br />
On-l<strong>in</strong>e schedul<strong>in</strong>g On-l<strong>in</strong>e schedul<strong>in</strong>g is performed locally for each node.<br />
If the spare capacities of the current <strong>in</strong>terval × Á � , EDF is applied on<br />
the set of ready tasks. × Á � <strong>in</strong>dicates that a guaranteed task has to be<br />
executed or else a deadl<strong>in</strong>e violation <strong>in</strong> the task set will occur. Soft aperiodic<br />
tasks, i.e., without deadl<strong>in</strong>e, can be executed immediately if × Á � . After<br />
each schedul<strong>in</strong>g decision, the spare capacities of the affected <strong>in</strong>tervals are<br />
updated.<br />
2.4 Acceptance test for a set of sporadic tasks<br />
In this section we will <strong>in</strong>troduce an off-l<strong>in</strong>e guarantee algorithm for a set of<br />
sporadic tasks. The set is said to be feasible with the already scheduled task set<br />
if it is possible to schedule all tasks <strong>in</strong> the sporadic set such that no scheduled
Acceptance test for a set of sporadic tasks 33<br />
periodic task misses its deadl<strong>in</strong>e.<br />
Firstly, the off-l<strong>in</strong>e periodic schedule is created and analyzed for slot shift<strong>in</strong>g.<br />
Secondly, the set of sporadic tasks is tried to fit <strong>in</strong>to the periodic schedule, by<br />
<strong>in</strong>vestigat<strong>in</strong>g only selected <strong>time</strong> slots. If the sporadic set is not accepted, it is<br />
up to designer to redesign the system, i.e., reschedule periodic tasks or change<br />
the sporadic set.<br />
2.4.1 <strong>Sporadic</strong> set<br />
All tasks <strong>in</strong> the sporadic set are assumed to be <strong>in</strong>voked with their maximum frequency,<br />
creat<strong>in</strong>g the worst case scenario for the scheduler. If the deadl<strong>in</strong>e of a<br />
sporadic task can be guaranteed for the release with their maximum frequency,<br />
then all subsequent deadl<strong>in</strong>es are guaranteed. Examples of this approach are<br />
given <strong>in</strong> [17]. The m<strong>in</strong>imum <strong>time</strong> difference between successive releases of a<br />
sporadic task is its m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong>. It has been shown [7] that a<br />
sporadic task which is released with its maximum frequency behaves exactly<br />
like a periodic task with period equal to its m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong>. Now<br />
we know the deadl<strong>in</strong>e, the maximum execution <strong>time</strong> and the ’period’ of each<br />
sporadic task <strong>in</strong> the set and we can use that <strong>in</strong>formation to try to guarantee the<br />
set for its worst load pattern.<br />
2.4.2 Critical slots<br />
One way of <strong>in</strong>vestigat<strong>in</strong>g if the sporadic set fits <strong>in</strong>to the periodic schedule is<br />
to <strong>in</strong>vestigate if it fits at each <strong>time</strong> slot of the periodic schedule, but this is<br />
impractical. It is sufficient to <strong>in</strong>vestigate only some selected po<strong>in</strong>ts <strong>in</strong> <strong>time</strong>,<br />
called critical slots (Ø ). There is only one critical slot per <strong>in</strong>terval 2 , and if the<br />
sporadic set can be guaranteed at the critical slot, it will be guaranteed at every<br />
other slot with<strong>in</strong> the same <strong>in</strong>terval.<br />
The worst case for arrival of the sporadic set to an <strong>in</strong>terval Á is the slot where<br />
the execution of the sporadic tasks can be delayed maximally by the execution<br />
of the off-l<strong>in</strong>e scheduled tasks. This gives:<br />
Proposition 1 Critical slot Ø for an <strong>in</strong>terval Á is calculated as:<br />
Ø Á �×Ø�ÖØ Á × Á<br />
2 Intervals are calculated as described <strong>in</strong> section 2.3.
34 Acceptance test for a set of sporadic tasks<br />
sc=5<br />
start(I) Ø end(I)<br />
Figure 2.1: Example of a critical slot.<br />
as depicted <strong>in</strong> figure 2.1. If a sporadic task Ì Ë can be guaranteed at the critical<br />
slot, it will be guaranteed at each other slot with<strong>in</strong> the same <strong>in</strong>terval Á:<br />
Proof. Let:<br />
�Ø Á�ÌË �Ù�Ö�ÒØ��� �Ø Ø ÌË �Ù�Ö�ÒØ��� �Ø Ø<br />
Ø Á �×Ø�ÖØ Á × Á - the critical slot of Á.<br />
Ø Á�Ø �� Ø - some other slot <strong>in</strong> Á.<br />
Assume the follow<strong>in</strong>g is correct:<br />
Assumption 1. There is a slot Ø <strong>in</strong> <strong>in</strong>terval Á such that a sporadic task ÌË can<br />
be guaranteed at the critical slot Ø , but not at Ø:<br />
�Ø Á� ÌË �Ù�Ö�ÒØ��� �Ø Ø � ÌË��Ù�Ö�ÒØ��� �Ø Ø<br />
Let Æ denote the difference between spare capacities available for Ì Ë at Ø<br />
and Ø, i.e., the amount of spare capacity that we may get or lose by shift<strong>in</strong>g the<br />
arrival <strong>time</strong> of ÌË from Ø to Ø. Assumption 1 states that ÌË can be guaranteed<br />
at Ø but not at Ø, which means that there is more spare capacity available at Ø<br />
than at Ø and we lose spare capacity if we shift. This implies that Æ is negative:<br />
� (2.2)<br />
There are two possibilities for the arrival of the sporadic task Ì Ë, Ø � � ÌË ,<br />
before or after the critical slot Ø :<br />
Case 1: Ø�Ø , ÌË arrives after Ø , as depicted <strong>in</strong> figure 2.2.<br />
The requirement for ÌË to be accepted is that the spare capacity available for<br />
ÌË at its arrival <strong>time</strong> has to be greater or equal to the maximum execution <strong>time</strong><br />
of ÌË.<br />
Let « and ¬ denote the change of spare capacity caused by shift<strong>in</strong>g <strong>in</strong> the arrival<br />
and deadl<strong>in</strong>e, resp., <strong>in</strong>terval as depicted <strong>in</strong> figure 2.3:
Acceptance test for a set of sporadic tasks 35<br />
scheduled or guaranteed tasks<br />
ÌË<br />
start(I) Ø Ø end(I)<br />
Figure 2.2: <strong>Sporadic</strong> arival after critical slot.<br />
¯ « - the difference <strong>in</strong> spare capacity of the arrival <strong>in</strong>terval caused by shift<strong>in</strong>g<br />
the arrival <strong>time</strong> of ÌË from Ø to Ø.<br />
¯ ¬ - the difference <strong>in</strong> spare capacity of the deadl<strong>in</strong>e <strong>in</strong>terval caused by<br />
shift<strong>in</strong>g the deadl<strong>in</strong>e of ÌË.<br />
This gives:<br />
Æ � « ¬ (2.3)<br />
Shift<strong>in</strong>g the arrival <strong>time</strong> of ÌË from Ø to Ø means that the deadl<strong>in</strong>e of ÌË<br />
is shifted to the right. In the arrival <strong>in</strong>terval, Á �ÖÖ�Ú�Ð, slots from Ø to Ø are<br />
reserved for the execution of the scheduled periodic tasks, giv<strong>in</strong>g « � . In the<br />
deadl<strong>in</strong>e <strong>in</strong>terval, Á����Ð�Ò�, shift<strong>in</strong>g the deadl<strong>in</strong>e of ÌË may only <strong>in</strong>crease the<br />
portion of available spare capacities <strong>in</strong> that <strong>in</strong>terval. This gives that ¬ has to be<br />
greater or equal to zero (¬ � ).<br />
Á�ÖÖ�Ú�Ð<br />
Á����Ð�Ò�<br />
« ¬<br />
Ø Ø �Ð Ø �Ð Ø<br />
×���Ø<br />
Figure 2.3: <strong>Sporadic</strong> arrival shifted to the right.<br />
The maximum value of Æ occurs when the deadl<strong>in</strong>e of Ì Ë does not <strong>in</strong>tersect<br />
with any other activity, that is, execution of some other task. In other words,<br />
¬ � Ø Ø � . If so, then:<br />
Æ � « ¬� � « � �¬ � (2.4)
36 Acceptance test for a set of sporadic tasks<br />
Otherwise, if �Ð ÌË occurs dur<strong>in</strong>g the execution of some other task, the worst<br />
case scenario is that we do not get any new resources for Ì Ë, that is:<br />
� � � gives:<br />
Æ � « ¬ � � « � �¬ � (2.5)<br />
Æ �<br />
which is contradictory to , mak<strong>in</strong>g assumption 1 false.<br />
Case 2: Ø�Ø , ÌË arrives before Ø , as depicted <strong>in</strong> figure 2.4.<br />
ÌË<br />
start(I) Ø Ø end(I)<br />
Figure 2.4: <strong>Sporadic</strong> arrival before critical slot.<br />
Now we shift the arrival <strong>time</strong> of ÌË to the left, that is before the critical po<strong>in</strong>t<br />
Ø . This is shown <strong>in</strong> figure 2.5.<br />
Á�ÖÖ�Ú�Ð<br />
« ¬<br />
Ø Ø<br />
×���Ø<br />
�Ð Ø �Ð Ø<br />
Á����Ð�Ò�<br />
Figure 2.5: <strong>Sporadic</strong> arrival shifted to the left.<br />
Let « and ¬ denote the same as <strong>in</strong> case 1. Shift<strong>in</strong>g the arrival <strong>time</strong> of Ì Ë<br />
results <strong>in</strong> a positive « that is equal to the difference between Ø and Ø, i.e.,<br />
« � Ø Ø� . In the deadl<strong>in</strong>e <strong>in</strong>terval, the amount of lost spare capacities<br />
caused by shift<strong>in</strong>g can maximally be the same as the amount of ga<strong>in</strong>ed spare<br />
capacities <strong>in</strong> the arrival <strong>in</strong>terval, giv<strong>in</strong>g ¬ÛÓÖ×Ø � «. This implies:<br />
Æ � « ¬ � « « � � ¬ � ¬ÛÓÖ×Ø (2.6)
Acceptance test for a set of sporadic tasks 37<br />
In a more optimistic scenario, we can even lose less spare capacities <strong>in</strong> the<br />
deadl<strong>in</strong>e <strong>in</strong>terval than we get <strong>in</strong> the arrival <strong>in</strong>terval, that is ¬�«. In that case,<br />
we get:<br />
Æ � « ¬� � �¬� �« (2.7)<br />
� � � implies:<br />
Æ �<br />
which is contradictory to . This implies the assumption 1 doesn’t hold for<br />
case 2.<br />
Assumption 1 doesn’t hold either for case 1 or case 2. Therefore proposition 1<br />
is true. This concludes the proof.<br />
Critical po<strong>in</strong>ts are calculated off-l<strong>in</strong>e for each <strong>in</strong>terval, and only those po<strong>in</strong>ts<br />
are checked for the feasibility of the sporadic task set.<br />
2.4.3 Off-l<strong>in</strong>e feasibility test for sporadic tasks<br />
The feasibility test for the set of sporadic tasks works by creat<strong>in</strong>g a worst case<br />
load demand of the sporadic tasks as described <strong>in</strong> section 2.4.1. We assume that<br />
all sporadic tasks arrive with their maximum frequency and test if the demand<br />
created can be accommodated <strong>in</strong>to the static schedule at all critical slots. Here<br />
follows the off-l<strong>in</strong>e guarantee algorithm for a set of sporadic tasks Ë:<br />
Let:<br />
� = <strong>in</strong>dex of Á�ÖÖ�Ú�Ð<br />
� = <strong>in</strong>dex of Á����Ð�Ò�<br />
× �<br />
= available sc for a sporadic task ÌË<br />
from � ÌË to �Ð ÌË<br />
Ê = an array conta<strong>in</strong><strong>in</strong>g slots reserved for<br />
previously guaranteed sporadic tasks<br />
�Ò�ØÊ = <strong>in</strong>itiates Ê to empty set<br />
ÓÙÒØÊ Ü� Ý = returns number of reserved slots<br />
between slot Ü and slot Ý.<br />
Ö�×�ÖÚ�Ê Ò� � = reserves Ò slots as close to � as<br />
possible (as late as possible)<br />
1: �Ø<br />
2: �Ò�ØÊ<br />
3: �ÌË Ë
38 On-l<strong>in</strong>e mechanism<br />
4: �Ì Ò Ë Ä�ÅË<br />
5: × � Ì Ò Ë � È �<br />
��� × Á�<br />
6: Ñ�Ò × Á� ��Ð Ì Ò Ë ×Ø�ÖØ Á�<br />
7: ÓÙÒØÊ � Ì Ò Ë ��Ð Ì Ò Ë<br />
8: �� × � Ì Ò Ë � Å��Ì ÌË<br />
9: Ø��Ò Ö�×�ÖÚ�Ê Å��Ì ÌË ��Ð Ì Ò Ë<br />
10: �Ð×� abort (set rejected)<br />
Comments:<br />
1: Investigate every critical slot.<br />
2: No slots reserved yet.<br />
3: Guarantee every sporadic task ÌË <strong>in</strong> the set.<br />
4: Guarantee every <strong>in</strong>vocation Ì Ò Ë<br />
of ÌË.<br />
5: Calculate sc available for ÌË from its arrival until its deadl<strong>in</strong>e. It is equal<br />
to the sum of sc for all full <strong>in</strong>tervals between Á�ÖÖ�Ú�Ð and the Á����Ð�Ò� of Ì Ò Ë ,<br />
<strong>in</strong>creased by<br />
6: the rema<strong>in</strong><strong>in</strong>g sc of the Á����Ð�Ò� available until �Ð Ì Ò Ë , decreased by<br />
7: the amount of sc reserved for other, previously guaranteed sporadics that<br />
<strong>in</strong>tersect with Ì Ò Ë .<br />
8: If the available sc is greater or equal to the maximum execution <strong>time</strong> of Ì Ë,<br />
then<br />
9: reserve slots needed for Ì Ò Ë as close to its dl as possible, and cont<strong>in</strong>ue.<br />
10: If not enough spare capacity, abort the guarantee algorithm and report that<br />
the guarantee<strong>in</strong>g failed.<br />
2.5 On-l<strong>in</strong>e mechanism<br />
Dur<strong>in</strong>g the system operation, the on-l<strong>in</strong>e scheduler is <strong>in</strong>voked after each slot.<br />
It checks whether new dynamic tasks have arrived dur<strong>in</strong>g the last slot. When<br />
a set of sporadic tasks arrives to the system, the ready set of slot shift<strong>in</strong>g is<br />
expanded by sporadic tasks that are ready to execute. Soft aperiodic tasks can<br />
be executed if the spare capacity of the current <strong>in</strong>terval is greater than zero, and<br />
there are no ready sporadic tasks.<br />
Let:<br />
Ø = current <strong>time</strong><br />
× Á Ø = spare capacity of the current<br />
<strong>in</strong>terval at <strong>time</strong> Ø.<br />
Ê Ø = the ready set that consists of all periodic
On-l<strong>in</strong>e mechanism 39<br />
and guaranteed sporadic tasks that have<br />
earliest start <strong>time</strong> less or equal to the<br />
current <strong>time</strong>.<br />
We identify the follow<strong>in</strong>g cases:<br />
1. Ê Ø ���: There are no tasks ready to be executed, the CPU rema<strong>in</strong>s<br />
idle.<br />
2. Ê Ø �� �� � �Ì�� Ì� soft aperiodic:<br />
(a) × Á Ø � ��ÌË ÊØ �ÌË sporadic execute ÌË.<br />
(b) × Á Ø � ���ÌË ÊØ execute Ì�.<br />
(c) × Á Ø � : a periodic task from ready set has to be executed. Zero<br />
spare capacities <strong>in</strong>dicate that add<strong>in</strong>g further activities will result <strong>in</strong><br />
a deadl<strong>in</strong>e violation of the guaranteed task set.<br />
3. Ê Ø �� �� � ��Ì��Ì� soft aperiodic: The task of ready set with the<br />
shortest deadl<strong>in</strong>e is executed.<br />
2.5.1 Ma<strong>in</strong>tenance of spare capacities<br />
The decision of the scheduler is now used to update spare capacities, depend<strong>in</strong>g<br />
on which type of task was selected for execution:<br />
¯ Aperiodic execution: one slot of the spare capacities is used to execute a<br />
slot of dynamic task. The spare capacity of the current <strong>in</strong>terval has to be<br />
decremented by one.<br />
¯ Periodic execution: Execut<strong>in</strong>g a static task only swaps spare capacities.<br />
Depend<strong>in</strong>g on the <strong>in</strong>terval to which the executed task belongs to, the<br />
current <strong>in</strong>terval Á�, or a subsequent one Á��� ��is affected. The amount<br />
of total spare capacities is unchanged.<br />
¯ <strong>Sporadic</strong> execution: The spare capacity of the current <strong>in</strong>terval is decremented<br />
by one.<br />
¯ No execution: One slot of spare capacity is used without dynamic process<strong>in</strong>g.<br />
Spare capacity has to be decremented by one.
40 Example<br />
2.6 Example<br />
Assume the follow<strong>in</strong>g periodic tasks with execution <strong>time</strong>s and precedence constra<strong>in</strong>ts<br />
as described <strong>in</strong> figure 2.6.<br />
�<br />
Ì<br />
Ì Ì<br />
�� ��<br />
Node 0<br />
Node 1<br />
�<br />
�<br />
�<br />
�� ��<br />
Task MAXT dl<br />
Ì 2 5<br />
Ì 1 8<br />
Ì 1 9<br />
� 1 9<br />
� 2 9<br />
Ì Ì� Ì�<br />
0 1 2 3 4 5 6 7 8 9<br />
Ì Ì<br />
0 1 2 3 4 5 6 7 8 9<br />
Figure 2.6: Example offl<strong>in</strong>e sporadic guarantee – periodic tasks and offl<strong>in</strong>e<br />
schedule.<br />
We calculate <strong>in</strong>tervals and spare capacities, as described <strong>in</strong> 2.3.1, and critical<br />
slots as described <strong>in</strong> 2.4.2:<br />
ÁÒØ�ÖÚ�Ð ÆÓ�� ×Ø�ÖØ �Ò� × Ø<br />
Á �<br />
Á � � �<br />
Á � � �<br />
Á � � �<br />
Intervals with their assigned tasks and critical slots are depicted <strong>in</strong> figure 2.7.<br />
Now assume a sporadic set Ë � �Ë � � �Ë � � where the first parameter<br />
is maximum execution <strong>time</strong> and the other one the m<strong>in</strong>imum <strong>in</strong>ter-arrival<br />
<strong>time</strong> at node 0. If we assume that sporadic tasks arrive with their maximum<br />
frequencies, then the deadl<strong>in</strong>e of each <strong>in</strong>vocation is equal to the release of the<br />
next <strong>in</strong>vocation. Now we apply the off-l<strong>in</strong>e guarantee algorithm on each task<br />
<strong>in</strong> the sporadic set Ë. First, we try to guarantee Ë and Ë at critical slot 3, and<br />
if they can be guaranteed, we proceed with <strong>in</strong>vestigation of slot 6. The LCM<br />
of Ë is 10, which means that Ë is <strong>in</strong>voked twice and Ë once before the pattern<br />
is repeated. We now illustrate the guarantee test for Ë and Ë . Numbers
Example 41<br />
Node 0<br />
Node 1<br />
Á Á<br />
Ì Ì� Ì�<br />
0 1 2 3 4 5 6 7 8 9<br />
Ì Ì<br />
0 1 2 3 4 5 6 7 8 9<br />
Figure 2.7: Example offl<strong>in</strong>e sporadic guarantee – schedule with <strong>in</strong>tervals.<br />
above columns represent steps <strong>in</strong> the guarantee algorithm described <strong>in</strong> 2.4.3<br />
(see figure 2.8 <strong>in</strong> parallel):<br />
1 3 4 5 8 9 10<br />
Ø ÌË Inv. × � � Å��Ì � Ê<br />
3 Ë 1 1 � � �5�<br />
2 3 � � �5,11�<br />
Ë 1 2 � � abort<br />
Á Á<br />
Next sch. <strong>in</strong>stance<br />
Á Á<br />
reserve<br />
Ì Ë Ì� Ì� Ë Ì Ì� Ì�<br />
���������� � ßÞ �<br />
reserve<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18<br />
Á<br />
ÒÓØ �ÒÓÙ�� × � ÓÖ Ë<br />
Figure 2.8: Example offl<strong>in</strong>e sporadic guarantee – steps <strong>in</strong> guarantee algorithm.<br />
The sporadic set cannot be guaranteed at critical slot 3. What we can do now<br />
is to redesign the system and try aga<strong>in</strong>. S<strong>in</strong>ce we support distributed systems,<br />
we could reallocate some of the periodic tasks from node 0 to node 1, or allocate<br />
some of sporadics on node 1. In this example, we decide to schedule the<br />
periodic task � on node 1 <strong>in</strong>stead of node 0. The new periodic schedule is<br />
depicted <strong>in</strong> figure 2.9. Intervals rema<strong>in</strong> the same, spare capacities and critical<br />
slots have to be recalculated for Á and Á :<br />
Á � × Á = 1+1=2 Á � × Á = 1-1=0<br />
Ø Á = 5+2=7 Ø Á = 6+0=6<br />
Á
42 Example<br />
Node 0<br />
Node 1<br />
Ì<br />
Á Á<br />
0 1 2 3 4 5 6 7 8 9<br />
�<br />
�<br />
Á Á<br />
Ì Ì<br />
0 1 2 3 4 5 6 7 8 9<br />
Figure 2.9: Example offl<strong>in</strong>e sporadic guarantee – offl<strong>in</strong>e schedule after redesign.<br />
We try to guarantee Ë on node 0 aga<strong>in</strong>, but this <strong>time</strong> one critical po<strong>in</strong>t has<br />
changed; we got 7 <strong>in</strong>stead for 6:<br />
1 3 4 5 8 9<br />
Ø Task Inv. × � � � Ê<br />
3 Ë 1 2 � � �6�<br />
2 3 � � �6,11�<br />
Ë 1 3 � � �5,6,9,10,11�<br />
7 Ë 1 3 � � �11�<br />
2 2 � � �11,15�<br />
Ë 1 3 � � �9,10,11,14,15�<br />
The sporadic set is guaranteed at both critical slots and we can accept it.<br />
Next follows the description of on-l<strong>in</strong>e execution (as described <strong>in</strong> section 2.5)<br />
on node 0 for the periodic and sporadic tasks described above, extended with<br />
one soft aperiodic task, � � , where the first parameter is arrival <strong>time</strong>, and<br />
the other one is execution <strong>time</strong>. Assume Ë arrives at slot 3. Ê Ø conta<strong>in</strong>ts<br />
tasks that are ready to execute <strong>in</strong> slot Ø. The execution trace is depicted <strong>in</strong><br />
figure 2.11 (“case” refers to the cases described <strong>in</strong> 2.5):
Example 43<br />
Á Á Á Á<br />
Ì Ë Ë Ì� Ë Ë Ì Ì�<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18<br />
a) Critical slot 3<br />
Á Á Á Á<br />
Ì Ì� Ë Ë Ì Ë Ë Ì�<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18<br />
b) Critical slot 7<br />
Figure 2.10: Example offl<strong>in</strong>e sporadic guarantee – guarantee<strong>in</strong>g after redesign.<br />
Ø Ê Ø case exe. sc<br />
0 �Ì �Ì�� 3 Ì unchanged<br />
1 �Ì �Ì�� 3 Ì unchanged<br />
2 �Ì��� �, 2b � × Á decreased<br />
3 �Ì��Ë �Ë �� � 2a Ë × Á decreased<br />
4 �Ì��Ë �� � 2a Ë × Á decreased<br />
5 �Ì��Ë �� � 2a Ë × Á decreased<br />
6 �Ì��� � 2b � × Á decreased<br />
7 ��� 3 � unchanged<br />
8 �Ì��Ë � 2c Ì� unchanged<br />
Á Á<br />
Ì � Ë Ë � Ì�<br />
Node 0<br />
0 1 2 3 4 5 6 7 8 9<br />
Next sch.<br />
<strong>in</strong>stance<br />
Figure 2.11: Example offl<strong>in</strong>e sporadic guarantee – onl<strong>in</strong>e execution.
44 Conclusion<br />
2.7 Conclusion<br />
In this paper, we presented an algorithm to handle event-triggered sporadic<br />
tasks, i.e., with unknown arrival <strong>time</strong>s, but known maximum arrival frequencies,<br />
<strong>in</strong> the context of <strong>time</strong>-triggered, distributed schedules with general constra<strong>in</strong>ts.<br />
The sporadic tasks are guaranteed dur<strong>in</strong>g design <strong>time</strong>, allow<strong>in</strong>g reschedul<strong>in</strong>g<br />
or redesign <strong>in</strong> the case of failure. At run-<strong>time</strong>, resources reserved for sporadic<br />
tasks can be reclaimed and used for efficient aperiodic task handl<strong>in</strong>g.<br />
Our algorithm is based on the slot shift<strong>in</strong>g method, which provides for<br />
the comb<strong>in</strong>ation of <strong>time</strong>-triggered off-l<strong>in</strong>e schedule construction and on-l<strong>in</strong>e<br />
schedul<strong>in</strong>g of aperiodic activities. It analyzes constructed schedules for unused<br />
resources and leeway <strong>in</strong> task executions first. The run-<strong>time</strong> scheduler uses this<br />
<strong>in</strong>formation to <strong>in</strong>clude aperiodic tasks, shift<strong>in</strong>g other task executions (”slots”)<br />
to reduce response <strong>time</strong>s without affect<strong>in</strong>g feasibility. It can also be used to<br />
perform onl<strong>in</strong>e guarantees.<br />
We provided an off-l<strong>in</strong>e schedulability test for sporadic tasks based on slot<br />
shift<strong>in</strong>g. It constructs a worst case scenario for the arrival of the sporadic task<br />
set and tries to guarantee it <strong>in</strong> the off-l<strong>in</strong>e schedule. The guarantee algorithm is<br />
applied at selected slots only. At run-<strong>time</strong>, it uses the slot shift<strong>in</strong>g mechanisms<br />
to feasibly schedule sporadic tasks <strong>in</strong> union with the off-l<strong>in</strong>e scheduled periodic<br />
tasks, while allow<strong>in</strong>g resources to be reclaimed for aperiodic tasks.<br />
S<strong>in</strong>ce the major part of preparations is performed off-l<strong>in</strong>e, the <strong>in</strong>volved onl<strong>in</strong>e<br />
mechanisms are simple. Furthermore, the reuse of resources allows for<br />
high resoure utilization.<br />
Acknowledgements<br />
The authors wish to thank the reviewers for their fruitful comments which<br />
helped to improve the quality of the paper. Further thanks go to Jukka Mäki-<br />
Turja and Björn L<strong>in</strong>dberg for their careful review<strong>in</strong>g and stimulat<strong>in</strong>g discussions.
Bibliography<br />
[1] A.K. Mok. Fundamental Design Problems for the Hard <strong>Real</strong>-Time Envs.<br />
PhD thesis, MIT, May 1983.<br />
[2] K. Jeffay. Schedul<strong>in</strong>g sporadic tasks with shared resources <strong>in</strong> hard real<strong>time</strong><br />
systems. Dept. of Comp. Sci., Univ. of North Carol<strong>in</strong>a at Chapel<br />
Hill, 1992.<br />
[3] C.L. Liu and J.W. Layland. Schedul<strong>in</strong>g algorithms for multiprogramm<strong>in</strong>g<br />
<strong>in</strong> hard real-<strong>time</strong> environment. Journ. of the ACM, 20, 1, Jan. 1973.<br />
[4] T. Tia, W.S. Liu, J. Sun, and R. Ha. A l<strong>in</strong>ear-<strong>time</strong> optimal acceptance<br />
test for schedul<strong>in</strong>g of hard real-<strong>time</strong> tasks. Dept. of Comp. Sc., Univ. of<br />
Ill<strong>in</strong>ois at Urbana-Champaign, 1994.<br />
[5] M. Spuri, Giorgio C. Buttazzo, and F. Sens<strong>in</strong>i. Robust aperiodic schedul<strong>in</strong>g<br />
under dynamic priority systems. In Proc. of the IEEE RTSS, Dec.<br />
1995.<br />
[6] M. Caccamo and Giorgio C. Buttazzo. Exploit<strong>in</strong>g skips <strong>in</strong> periodic tasks<br />
for enhanc<strong>in</strong>g aperiodic responsiveness. Proc. of the 18th <strong>Real</strong>-Time <strong>Systems</strong><br />
Symposium, USA, Dec. 1997.<br />
[7] A. Burns, N.C. Audsley, M.F. Richardson, and A.J. Well<strong>in</strong>gs. Hard<br />
real-<strong>time</strong> schedul<strong>in</strong>g: the deadl<strong>in</strong>e monotonic approach. Proc. of the<br />
IFAC/IFIP Workshop, UK, 1992.<br />
[8] G.C. Buttazzo, G. Lipari, and L. Abeni. A bandwidth reservation algorithm<br />
for multi-application systems. Proc. of the Intl. Conf. on <strong>Real</strong>-<strong>time</strong><br />
Comput<strong>in</strong>g <strong>Systems</strong> and Applications, Japan, 1998.
46 BIBLIOGRAPHY<br />
[9] G. Fohler. Jo<strong>in</strong>t schedul<strong>in</strong>g of distributed complex periodic and hard aperiodic<br />
tasks <strong>in</strong> statically scheduled systems. In Proc. 16th <strong>Real</strong>-<strong>time</strong> <strong>Systems</strong><br />
Symposium, Pisa, Italy, 1995.<br />
[10] J.A. Stankovic, K. Ramamritham, and C.-S. Cheng. Evaluation of a<br />
flexible task schedul<strong>in</strong>g algorithm for distributed hard real-<strong>time</strong> systems.<br />
IEEE Trans. on comp., 34(12), Dec 1995.<br />
[11] H. Kopetz. Sparse <strong>time</strong> versus dense <strong>time</strong> <strong>in</strong> distributed real <strong>time</strong> systems.<br />
In Proc. of the Second Int. Workshop on Responsice Comp. Sys., Saitama,<br />
Japan, Oct. 1992.<br />
[12] P. Puschner and C. Koza. Calculat<strong>in</strong>g the maximum execution <strong>time</strong> of<br />
real-<strong>time</strong> programs. RT <strong>Systems</strong> Journal, 1989.<br />
[13] Giorgio C. Buttazzo. Hard <strong>Real</strong>-<strong>time</strong> Comput<strong>in</strong>g <strong>Systems</strong>: Predictable<br />
Schedul<strong>in</strong>g Algorithms and Applications. Kluwer Academic Publishers,<br />
1997.<br />
[14] G. Fohler. Flexibility <strong>in</strong> Statically Scheduled Hard <strong>Real</strong>-Time <strong>Systems</strong>.<br />
PhD thesis, Technische Universität Wien, Austria, Apr. 1994.<br />
[15] M.R. Garey., D.S. Johnson, B.B. Simons, and R.E. Tarjan. Schedul<strong>in</strong>g<br />
unit-<strong>time</strong> tasks with arbitrary release <strong>time</strong>s and deadl<strong>in</strong>es. IEEE Trans.<br />
on Soft. Eng., May 1981.<br />
[16] M. Chetto and H. Chetto. Schedul<strong>in</strong>g periodic and sporadic tasks <strong>in</strong> a<br />
real-<strong>time</strong> system. Inf. Proc. Letters, Feb. 1989.<br />
[17] N.C. Audsley, A. Burns, M.F. Richardson, and A.J. Well<strong>in</strong>gs. Deadl<strong>in</strong>e<br />
monotonic schedul<strong>in</strong>g theory. WRTP’92. Prepr<strong>in</strong>ts of the IFAC Workshop.<br />
Pergamon Press, U.K, 1992.
Chapter 3<br />
Paper B: Onl<strong>in</strong>e <strong>Handl<strong>in</strong>g</strong> of<br />
Firm Aperiodic <strong>Tasks</strong> <strong>in</strong><br />
Time Triggered <strong>Systems</strong><br />
Damir Isovic and Gerhard Fohler<br />
In WiP Proceed<strong>in</strong>gs of 12th EUROMICRO Conference on <strong>Real</strong>-Time <strong>Systems</strong>,<br />
Stockholm, Sweden, June 2000
Abstract<br />
A number of <strong>in</strong>dustrial applications advocate the use of <strong>time</strong> triggered approaches<br />
for reasons of predictability, cost, product reuse, and ma<strong>in</strong>tenance.<br />
The rigid offl<strong>in</strong>e schedul<strong>in</strong>g schemes used for <strong>time</strong> triggered systems, however,<br />
do not provide for flexibility. At run<strong>time</strong>, aperiodic tasks can only be<br />
<strong>in</strong>cluded <strong>in</strong>to the unused resources of the offl<strong>in</strong>e schedule, support<strong>in</strong>g neither<br />
guarantees nor fast response <strong>time</strong>s.<br />
In this paper we present an algorithm for flexible hard aperiodic task handl<strong>in</strong>g<br />
<strong>in</strong> offl<strong>in</strong>e scheduled systems: it provides an O(N) acceptance test to determ<strong>in</strong>e<br />
if a set of aperiodics can be feasibly <strong>in</strong>cluded <strong>in</strong>to the offl<strong>in</strong>e scheduled<br />
tasks, and does not require run<strong>time</strong> handl<strong>in</strong>g of resource reservation for guaranteed<br />
tasks. Thus, it supports flexible schemes for rejection and removal of<br />
aperiodic tasks, overload handl<strong>in</strong>g, and simple reclaim<strong>in</strong>g of resources.<br />
As a result, our algorithm provides for a comb<strong>in</strong>ation of offl<strong>in</strong>e schedul<strong>in</strong>g<br />
and onl<strong>in</strong>e hard aperiodic task handl<strong>in</strong>g.
Introduction 49<br />
3.1 Introduction<br />
Time triggered real-<strong>time</strong> systems have been shown to be appropriate for a variety<br />
of critical applications: they provide verifiable tim<strong>in</strong>g behavior and allow<br />
for distribution, complex application structures, and general constra<strong>in</strong>ts, such<br />
as precedence or end-to-end deadl<strong>in</strong>es. Their benefits are, however, limited for<br />
applications with not completely known characteristics, such as arrival <strong>time</strong>s.<br />
Includ<strong>in</strong>g such non periodic tasks <strong>in</strong> the rigid offl<strong>in</strong>e schedules, as used for<br />
<strong>time</strong> triggered systems, can be resource <strong>in</strong>efficient at best for sporadic tasks,<br />
and impossible for aperiodics, i.e., without knowledge of arrival <strong>time</strong>s.<br />
<strong>Real</strong>-world applications demand flexible handl<strong>in</strong>g of aperiodic tasks: efficient<br />
acceptance tests, resource reservation if a task can be guaranteed, but<br />
also specific rejection strategies for the negative case. Often, aperiodics are<br />
guaranteed on a first-come-first-serve basis, i.e., already guaranteed tasks will<br />
be executed, and only newly arrived ones rejected, imply<strong>in</strong>g that earlier arriv<strong>in</strong>g<br />
tasks are more important. Instead, the selection of which tasks to reject or<br />
remove should be left to the designer, allow<strong>in</strong>g values and importance assigned<br />
to tasks, not on their arrival <strong>time</strong>s.<br />
In this paper, we present methods for the flexible onl<strong>in</strong>e handl<strong>in</strong>g of firm<br />
aperiodic tasks based on offl<strong>in</strong>e constructed schedules for <strong>time</strong> triggered systems.<br />
It is based on slot shift<strong>in</strong>g, [1], a method to comb<strong>in</strong>e offl<strong>in</strong>e and onl<strong>in</strong>e<br />
schedul<strong>in</strong>g by utiliz<strong>in</strong>g unused resources. We provide an EDF based acceptance<br />
test of Ç Æ to determ<strong>in</strong>e the feasible <strong>in</strong>clusion of aperiodic tasks <strong>in</strong>to<br />
the offl<strong>in</strong>e scheduled tasks. The algorithm avoids explicit run<strong>time</strong> handl<strong>in</strong>g<br />
of resource reservations for the guaranteed tasks and their impact on the offl<strong>in</strong>e<br />
scheduled tasks. Therefore, flexible schemes for rejection and removal of<br />
tasks and aperiodic overload handl<strong>in</strong>g can be applied. The resources of tasks<br />
completed earlier can be reclaimed for other aperiodic tasks without further<br />
provisions or explicitly free<strong>in</strong>g them.<br />
Aperiodic task handl<strong>in</strong>g has been studied extensively for many schedul<strong>in</strong>g<br />
schemes. Server based algorithms, for example, have been presented for earliest<br />
deadl<strong>in</strong>e, e.g., [2], and fixed priority systems, e.g., [3]. Example algorithms<br />
for the selection of tasks to reject <strong>in</strong> overload situations have been discussed <strong>in</strong><br />
[4], [5],[6], [7]. These algorithms assume control over all tasks <strong>in</strong> the system<br />
and do not take <strong>in</strong>to account the impact of offl<strong>in</strong>e scheduled tasks. The algorithm<br />
presented <strong>in</strong> [1] for guarantees of s<strong>in</strong>gle firm aperiodic tasks on offl<strong>in</strong>e<br />
schedules does not provide for removal of guaranteed tasks.<br />
The rest of the paper is organized as follows: section 3.2 presents slot shift<strong>in</strong>g,<br />
the method we use to comb<strong>in</strong>e offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g. We <strong>in</strong>troduce
50 Slot Shift<strong>in</strong>g: Flexibility for Time Triggered <strong>Systems</strong><br />
the motivation and basic idea of our algorithm <strong>in</strong> section 3.3, and the detailed<br />
description <strong>in</strong> section 3.4. An example <strong>in</strong> section 3.5 illustrates the algorithm.<br />
Section 3.6 concludes the paper and gives an outlook for further work.<br />
3.2 Slot Shift<strong>in</strong>g: Flexibility for Time Triggered<br />
<strong>Systems</strong><br />
The rigid offl<strong>in</strong>e schedul<strong>in</strong>g schemes used for <strong>time</strong> triggered systems do not<br />
provide for flexibility. Includ<strong>in</strong>g non periodic tasks <strong>in</strong> the offl<strong>in</strong>e schedule<br />
can be impossible for aperiodics, i.e., without any knowledge or restriction<br />
on arrival <strong>time</strong>s. At run<strong>time</strong>, aperiodic tasks can only be <strong>in</strong>cluded <strong>in</strong>to the<br />
unused resources of the offl<strong>in</strong>e schedule, support<strong>in</strong>g neither guarantees nor<br />
short response <strong>time</strong>s.<br />
In this section, we briefly describe the slot shift<strong>in</strong>g method [1] which we<br />
use as a basis to comb<strong>in</strong>e offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g. It provides for the efficient<br />
handl<strong>in</strong>g of aperiodic tasks on top of a distributed schedule with general<br />
task constra<strong>in</strong>ts. Slot shift<strong>in</strong>g extracts <strong>in</strong>formation about unused resources and<br />
leeway <strong>in</strong> an offl<strong>in</strong>e schedule and uses this <strong>in</strong>formation to add tasks feasibly,<br />
i.e., without violat<strong>in</strong>g requirements on the already scheduled tasks. A detailed<br />
description can be found <strong>in</strong> [1].<br />
First, a standard offl<strong>in</strong>e scheduler, e.g., [8], or [9] creates schedul<strong>in</strong>g tables<br />
for the periodic tasks. It allocates tasks to nodes and resolves precedence<br />
constra<strong>in</strong>ts by order<strong>in</strong>g task executions.<br />
Start-<strong>time</strong>s and deadl<strong>in</strong>es The schedul<strong>in</strong>g tables list fixed start- and end<br />
<strong>time</strong>s of task executions, elim<strong>in</strong>at<strong>in</strong>g all flexibility. The only assignments fixed<br />
by the specification of the tasks’ feasibility, however, are the <strong>in</strong>itiat<strong>in</strong>g and conclud<strong>in</strong>g<br />
tasks <strong>in</strong> the precedence graph, and, as we assume message transmission<br />
<strong>time</strong>s to be fixed here 1 , tasks send<strong>in</strong>g or receiv<strong>in</strong>g <strong>in</strong>ter-node messages. These<br />
are the only fixed start-<strong>time</strong>s and deadl<strong>in</strong>es, all others are calculated recursively<br />
dur<strong>in</strong>g offl<strong>in</strong>e preparations. The execution of all other tasks may vary with<strong>in</strong><br />
the precedence order, i.e., they can be shifted.<br />
Intervals and spare capacities The deadl<strong>in</strong>es of tasks are then sorted for<br />
each node and the schedule is divided <strong>in</strong>to a set of disjo<strong>in</strong>t execution <strong>in</strong>tervals<br />
1We apply the same mechanisms to the network as well, i.e., shift<strong>in</strong>g messages, as detailed <strong>in</strong><br />
[1].
Motivation and Approach 51<br />
for each node. Spare capacities are def<strong>in</strong>ed for these <strong>in</strong>tervals.<br />
Each deadl<strong>in</strong>e calculated for a task def<strong>in</strong>es the end of an <strong>in</strong>terval Á �, �Ò� Á� .<br />
Several tasks with the same deadl<strong>in</strong>e constitute one <strong>in</strong>terval.<br />
The spare capacities of an <strong>in</strong>terval Á� are calculated as given <strong>in</strong> formula 3.1:<br />
× Á� � �Á�� �<br />
Ì Á�<br />
Å��Ì Ì Ñ�Ò × Á� � (3.1)<br />
The length of Á� m<strong>in</strong>us the sum of the activities assigned to it is the amount of<br />
idle <strong>time</strong>s <strong>in</strong> that <strong>in</strong>terval. These have to be decreased by the amount “lent” to<br />
subsequent <strong>in</strong>tervals: <strong>Tasks</strong> may execute <strong>in</strong> <strong>in</strong>tervals prior to the one they are<br />
assigned to. Then they “borrow” spare capacity from the “earlier” <strong>in</strong>terval.<br />
After determ<strong>in</strong>ation of <strong>in</strong>tervals and spare capacities, the offl<strong>in</strong>e preparations<br />
are completed and the amount and location of unused resources is available<br />
for onl<strong>in</strong>e use.<br />
Onl<strong>in</strong>e schedul<strong>in</strong>g Onl<strong>in</strong>e schedul<strong>in</strong>g is performed locally for each node. If<br />
the spare capacities of the current <strong>in</strong>terval × Á � , EDF is applied on the set<br />
of ready tasks. × Á � <strong>in</strong>dicates that a guaranteed task has to be executed<br />
or else a deadl<strong>in</strong>e violation <strong>in</strong> the task set will occur. Soft aperiodic tasks,<br />
i.e., without deadl<strong>in</strong>e, can be executed immediately if × Á � . After each<br />
schedul<strong>in</strong>g decision, the spare capacities of the affected <strong>in</strong>tervals are updated.<br />
3.3 Motivation and Approach<br />
Guarantee<strong>in</strong>g and handl<strong>in</strong>g of firm aperiodic tasks <strong>in</strong>volves three steps:<br />
Acceptance test: Upon arrival of a firm aperiodic task, a test determ<strong>in</strong>es<br />
whether there are enough resources available to <strong>in</strong>clude it feasibly <strong>in</strong> the set of<br />
previously guaranteed tasks and if the schedul<strong>in</strong>g strategy will ensure <strong>time</strong>ly<br />
completion.<br />
Reservation of resources: If the task can be accepted, it is guaranteed by<br />
provid<strong>in</strong>g a mechanism which ensures that the resources it requires will be<br />
available for its execution. This can be achieved, e.g., by remov<strong>in</strong>g these resources<br />
from the available ones, or by ensur<strong>in</strong>g that subsequent guarantees will<br />
not remove them. Note that acceptance test and guarantee can be separated.
52 Motivation and Approach<br />
Rejection strategy: A failed acceptance test <strong>in</strong>dicates an overload situation.<br />
The common response, not to guarantee the task under consideration, assumes<br />
that already guaranteed tasks are more important than newly arriv<strong>in</strong>g ones.<br />
This is, however, not generally the case. Rather, the importance order of the<br />
tasks is <strong>in</strong>dependent of their arrival <strong>time</strong>. Consequently, a rejection strategy is<br />
required, which determ<strong>in</strong>es which task or tasks – out of all guaranteed or newly<br />
arrived tasks – to reject or abort.<br />
3.3.1 Shortcomm<strong>in</strong>gs of Previous Version<br />
The orig<strong>in</strong>al version of slot shift<strong>in</strong>g provides an onl<strong>in</strong>e guarantee algorithm of<br />
Ç Æ as well: upon arrival of a firm aperiodic task �, the spare capacities up<br />
to its deadl<strong>in</strong>e are summed up and compared to the execution <strong>time</strong> demand.<br />
If � is accepted, the spare capacities and <strong>in</strong>tervals are recalculated tak<strong>in</strong>g <strong>in</strong>to<br />
account that resources needed for � are not available for other tasks. If the<br />
deadl<strong>in</strong>e of task � does not overlap with one of offl<strong>in</strong>e calculated <strong>in</strong>tervals,<br />
then the <strong>in</strong>terval that conta<strong>in</strong>s �Р� needs to be split. The details how the<br />
onl<strong>in</strong>e slot shift<strong>in</strong>g guarantee algorithm works can be found <strong>in</strong> [1].<br />
However, we want to avoid the creation of new <strong>in</strong>tervals, <strong>in</strong> order to keep<br />
the onl<strong>in</strong>e mechanism as simple as possible. While this algorithm guarantees<br />
s<strong>in</strong>gle aperiodics, it has limited flexibility: only the task currently tested is<br />
possibly rejected; once guaranteed, aperiodics will execute. Changes <strong>in</strong> the set<br />
of guaranteed tasks require costly deletion of <strong>in</strong>tervals, recalculation of spare<br />
capacities, and new guarantees. Thus, flexible schemes for rejections, removal<br />
of guaranteed tasks, and overload handl<strong>in</strong>g <strong>in</strong>duce prohibitively high overhead.<br />
3.3.2 Basic Idea<br />
The new method presented here separates acceptance and guarantee. It elim<strong>in</strong>ates<br />
the onl<strong>in</strong>e modficiation of <strong>in</strong>tervals and spare capacities and thus allows<br />
rejection strategies over the entire aperiodic task set.<br />
The basic idea beh<strong>in</strong>d the method is based on standard earliest deadl<strong>in</strong>e<br />
first guarantee, but sets it to work on top of the offl<strong>in</strong>e schedule: EDF is based<br />
on hav<strong>in</strong>g full availability of the CPU; we have to consider <strong>in</strong>terference from<br />
offl<strong>in</strong>e scheduled tasks and perta<strong>in</strong> their feasibility.<br />
Assume, at <strong>time</strong> Ø , we have a set of guaranteed aperiodic tasks � Ø and an<br />
offl<strong>in</strong>e schedule represented by offl<strong>in</strong>e tasks, <strong>in</strong>tervals, and spare capacities. At<br />
<strong>time</strong> Ø �Ø �Ø , a new aperiodic � arrives. Meanwhile, a number of tasks of<br />
�Ø may have executed; the reman<strong>in</strong><strong>in</strong>g task set at Ø is denoted �Ø . We test if
Algorithm Description 53<br />
� ��Ø can be accepted, consider<strong>in</strong>g offl<strong>in</strong>e tasks. If so, we add � to the set<br />
of guaranteed aperiodics. No explicit reservation of resources is done, which<br />
would require changes <strong>in</strong> the <strong>in</strong>tervals and spare capacities. Rather, resources<br />
are guaranteed by accept<strong>in</strong>g the task only if it can be accepted together with<br />
the previous guaranteed and offl<strong>in</strong>e scheduled ones. This enables the efficient<br />
use of rejection strategies.<br />
3.4 Algorithm Description<br />
Let �Ø denote a set of guaranteed firm aperiodic tasks at <strong>time</strong> Ø .<br />
�Ø � ��� � Ø �� � � Ø ��Ð �� � �Ð �� �<br />
where Ø �� denotes the rema<strong>in</strong><strong>in</strong>g execution <strong>time</strong> of task � � at <strong>time</strong> Ø , and<br />
��� is its absolute deadl<strong>in</strong>e. We keep track of how much each task has<br />
executed, which means we know the rema<strong>in</strong><strong>in</strong>g execution <strong>time</strong>s of each task<br />
at any <strong>time</strong>. If a guaranteed task has not yet started to execute, the rema<strong>in</strong><strong>in</strong>g<br />
execution <strong>time</strong> is equal to its actual execution <strong>time</strong>, i.e., Ø �� � �� .<br />
<strong>Tasks</strong> <strong>in</strong> �Ø are ordered by <strong>in</strong>creas<strong>in</strong>g deadl<strong>in</strong>es, mean<strong>in</strong>g that task � � has<br />
earlier deadl<strong>in</strong>e than task �� . We also know that each task <strong>in</strong> �Ø has a<br />
deadl<strong>in</strong>e later than Ø .<br />
Now assume a new aperiodic task � arrives at <strong>time</strong> Ø , with the execution<br />
<strong>time</strong> � and absolute deadl<strong>in</strong>e �Ð � . From <strong>time</strong> Ø to Ø , some tasks <strong>in</strong> �Ø<br />
could have executed up to Ø , which is reflected as follows:<br />
¯ �� � ���� �� � – tasks completed by Ø :<br />
��� �Ø � Ø �� � � � � � � �<br />
where Ø �� denotes the rema<strong>in</strong><strong>in</strong>g execution <strong>time</strong> of � � at <strong>time</strong> Ø .<br />
¯ �� – task currently ready to run, accord<strong>in</strong>g to EDF. It may have executed<br />
partially before, so we need only to consider its rema<strong>in</strong><strong>in</strong>g execution<br />
<strong>time</strong>, Ø �� � �� .<br />
¯ ��� � ���� �Ò� – not yet started tasks that need to execute fully:<br />
��� �Ø � Ø �� � �� � � � � � Ò�<br />
where Ò is the number of tasks <strong>in</strong> �Ø .
54 Algorithm Description<br />
So, when guarantee<strong>in</strong>g a new aperiodic task � at <strong>time</strong> Ø , we need not consider<br />
already completed tasks, but only the rema<strong>in</strong><strong>in</strong>g portion of the current task and<br />
the tasks that have not started yet:<br />
�Ø ��Ø � �Ø � ������ � ����Ò�<br />
A new aperiodic task � is accepted if the set � � �Ø � � is feasible, consider<strong>in</strong>g<br />
the offl<strong>in</strong>e scheduled and guaranteed tasks.<br />
3.4.1 Acceptance Test for a Set of Aperiodic and Offl<strong>in</strong>e Scheduled<br />
<strong>Tasks</strong><br />
Spare capacities and <strong>in</strong>tervals of slot shift<strong>in</strong>g make sure that all offl<strong>in</strong>e scheduled<br />
tasks are guaranteed to complete before their deadl<strong>in</strong>es. Those offl<strong>in</strong>e<br />
tasks are scheduled to execute as late as possible, but under run-<strong>time</strong> they can<br />
be executed earlier, i.e., we can shift their execution with<strong>in</strong> their feasibility<br />
w<strong>in</strong>dow.<br />
Aperiodic tasks use unused resources <strong>in</strong> the offl<strong>in</strong>e schedule. The amount<br />
and location of available resources are represented as <strong>in</strong>tervals and spare capacities.<br />
So, we want to <strong>in</strong>sert aperiodic tasks without violat<strong>in</strong>g the feasibility<br />
of offl<strong>in</strong>e tasks.<br />
Let � � �Ì �Ì �����ÌÒ� be a set of aperiodic tasks that need to be scheduled<br />
together with the offl<strong>in</strong>e tasks. We accept the aperiodic set if each task <strong>in</strong><br />
� is guaranteed to complete before its deadl<strong>in</strong>e, i.e., the follow<strong>in</strong>g must hold:<br />
�<br />
sc[Ø� �Ð Ì ] ,�� ��� � � � Ò � Ì� �<br />
sc[�Ø Ì� ��Ð Ì� ] ,��<br />
where Ø is current <strong>time</strong> and notation × �Ø �Ø ℄ means the spare capacity from<br />
<strong>time</strong> Ø to <strong>time</strong> Ø . Otherwise, we need to reject some task(s).<br />
Note that the spare capacities are not distributed <strong>in</strong> a uniform way throughout<br />
the schedule. Rather, as described <strong>in</strong> 3.2, the schedule is divided <strong>in</strong>to <strong>in</strong>tervals,<br />
each with an <strong>in</strong>dividual value of spare capacity. Consequently, the amount<br />
of spare capacity <strong>in</strong> a w<strong>in</strong>dow depends on the position of that w<strong>in</strong>dow <strong>in</strong> the<br />
schedule.<br />
The f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of a firm aperiodic task � is calculated with respect to<br />
the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of the previous task, � . Without any offl<strong>in</strong>e tasks, it is<br />
calculated the same as <strong>in</strong> EDF algorithm:<br />
�Ø Ì� ��Ø Ì� Ì�
Algorithm Description 55<br />
S<strong>in</strong>ce we guarantee firm aperiodic tasks on the top of an offl<strong>in</strong>e schedule, we<br />
need to consider the feasibility of offl<strong>in</strong>e tasks. This extends the formula above<br />
with a new term that reflects the amount of resources reserved for offl<strong>in</strong>e tasks:<br />
�Ø Ì� � Ø Ì�<br />
� Ø R[Ø� �Ø Ì ] ,� �<br />
�Ø Ì� R[�Ø Ì� ��Ø Ì� ],��<br />
where Ê�Ø �Ø ℄ stands for the amount of resources (<strong>in</strong> slots) reserved for the<br />
execution of offl<strong>in</strong>e tasks from <strong>time</strong> Ø to <strong>time</strong> Ø . We can access Ê�Ø �Ø ℄ via<br />
spare capacities and <strong>in</strong>tervals at run<strong>time</strong>:<br />
Ê�Ø �Ø ℄� Ø Ø × �Ø �Ø ℄<br />
As �Ø Ì� appears on both sides of the equation, a simple solution is not possible.<br />
Rather, we present an algorithm for computation of f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>s of firm<br />
aperiodic tasks with complexity of Ç Æ , which is further discussed <strong>in</strong> next<br />
subsection.<br />
3.4.2 Pseudo Code<br />
We now present the acceptance test and algorithm for f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> calculation<br />
<strong>in</strong> pseudo code. Read the comments below <strong>in</strong> parallel:<br />
1: �ÓÖ � � ��Ð �� ��Ð � � � ;<br />
2: �Ø � ��Ø�Ì Ñ�Ü �Ø �� �Ø � � ;<br />
3: �� �Ø � �Ð � �<br />
4: �ÓÖ � � � ���Ò� � �<br />
5: �Ø � ��Ø� Ì �Ø� Ø �� ;<br />
6: �� �Ø � �Ð �� not feasible!<br />
�<br />
7: �Ò×�ÖØ �� �Ø ;<br />
�<br />
8: �Ð×� reject �<br />
9: ��Ø� Ì �ØÔ�Ö�Ñ �<br />
10: × Ö � ×Ø�ÖØ Á × Á �ØÔ;<br />
11: Û��Ð� Ö�Ñ � × Ö �<br />
�� × Ö Á �
56 Algorithm Description<br />
Ö�Ñ � Ö�Ñ × Ö;<br />
;<br />
�ØÔ � ×Ø�ÖØ Á<br />
× Ö � × Á ;<br />
12:<br />
�<br />
return �ØÔ Ö�Ñ ;<br />
�<br />
Comments:<br />
1. F<strong>in</strong>d the position of the last task <strong>in</strong> set �Ø, (�� , that has deadl<strong>in</strong>e before<br />
�Р� .<br />
2. Get the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of � based on the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of its predecessor<br />
��, and �’s execution demand.<br />
3. If � can be f<strong>in</strong>ished before its deadl<strong>in</strong>e, then...<br />
4. ...go through all the tasks <strong>in</strong> �Ø with deadl<strong>in</strong>es after �Ð � .<br />
5. Get the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of current task, based on the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of its<br />
predecessor.<br />
6. If any of the <strong>in</strong>vestigated tasks fails to complete before its deadl<strong>in</strong>e, that<br />
means that add<strong>in</strong>g � to �Ø would result <strong>in</strong> a set that is not feasible, i.e.,<br />
not all tasks <strong>in</strong> �Ø will complete before their deadl<strong>in</strong>es. We can either<br />
reject � or some other task(s) <strong>in</strong> �Ø.<br />
7. Otherwise, if all tasks can be f<strong>in</strong>ished by their deadl<strong>in</strong>es even if � added,<br />
then <strong>in</strong>sert � <strong>in</strong>to the set of previously guaranteed firm aperiodic tasks<br />
�Ø.<br />
8. ...otherwise, if � cannot be completed before its deadl<strong>in</strong>e reject it.<br />
9. Function: Calculates the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of a task based on predecessor<br />
task’s f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>, and the execution demand of the <strong>in</strong>vestigated task.<br />
10. Calculate the rema<strong>in</strong><strong>in</strong>g spare capacity of the current <strong>in</strong>terval, i.e., the<br />
<strong>in</strong>terval that conta<strong>in</strong>s the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of the previous task (the earliest<br />
possible start <strong>time</strong> for current task).
Algorithm Description 57<br />
11. Without offl<strong>in</strong>e tasks, �Ø Ì� � �Ø Ì� Ì� . In the presence of<br />
offl<strong>in</strong>e tasks, however, we do not have all CPU <strong>time</strong> available, but only<br />
the spare capacities <strong>in</strong> <strong>in</strong>tervals. This step f<strong>in</strong>ds the number of <strong>in</strong>tervals<br />
needed to accommodate the computation <strong>time</strong> of the task. We “simulate”<br />
the execution of the <strong>in</strong>vestigated task by go<strong>in</strong>g through <strong>in</strong>tervals and “fill<strong>in</strong>g<br />
up free slots”, until the rema<strong>in</strong><strong>in</strong>g execution <strong>time</strong> is exhausted.<br />
12. Return the calculated f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of the current task.<br />
The complexity of algorithm above is Ç Æ , because we go through all tasks<br />
only once, and calculate their f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>s on the way, as depicted <strong>in</strong> figure<br />
3.1. The for-loop picks a task and start the while-loop, which calculates its<br />
f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> by go<strong>in</strong>g through the <strong>in</strong>tervals. Then we pick another task, and<br />
cont<strong>in</strong>ue travers<strong>in</strong>g the <strong>in</strong>tervals at the po<strong>in</strong>t where we got <strong>in</strong>terrupted by forloop,<br />
and so on. We do not have any nested loops, and we always cont<strong>in</strong>ue<br />
forward.<br />
for<br />
Á� Á� Á� Á�<br />
� � � � �<br />
while while while<br />
�� �� �� ��<br />
Figure 3.1: Onl<strong>in</strong>e acceptance test for firm aperiodic tasks – algorithm complexity<br />
3.4.3 Resource Reservation<br />
The method presented here reserves resources implicitly, by only accept<strong>in</strong>g a<br />
new task if it can be guaranteed together with all previously guaranteed ones.<br />
Consequently, removal of guaranteed tasks and changes <strong>in</strong> the set of tasks can<br />
be handled efficiently.<br />
3.4.4 Rejection Strategies and Overload <strong>Handl<strong>in</strong>g</strong><br />
Our method allows for easy changes <strong>in</strong> the set of guaranteed tasks and thus<br />
supports rejection strategies and overload handl<strong>in</strong>g mechanisms. It allows a
58 Example<br />
new set of candidates to be submitted to the acceptance test and does not require<br />
modifications to the reserved resources for guaranteed tasks. We are currently<br />
<strong>in</strong>vestigat<strong>in</strong>g the application of overload handl<strong>in</strong>g schemes, such as presented<br />
<strong>in</strong> [4], [7].<br />
3.4.5 Resource Reclaim<strong>in</strong>g<br />
Should aperiodic tasks use less resources than expressed <strong>in</strong> worst case parameters,<br />
our method directly reclaims these without recalculation of available resources.<br />
Rather, the next <strong>time</strong> the acceptance test is performed, the fact that a<br />
task has an earlier f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> is considered <strong>in</strong> the calculations.<br />
3.5 Example<br />
Assume an offl<strong>in</strong>e schedule with <strong>in</strong>tervals and spare capacities as depicted <strong>in</strong><br />
figure 3.2 (the shaded boxes represent offl<strong>in</strong>e tasks). Let � be the set of previ-<br />
Á ,sc=3 Á ,sc=2 Á ,sc=2 Á�,sc=3<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19<br />
Figure 3.2: Example onl<strong>in</strong>e firm aperiodic guarantee– static schedule<br />
ously guaranteed but not completed firm aperiodic tasks at current <strong>time</strong> Ø � :<br />
� � �� � �� � � �� � � �<br />
where the first parameter is the rema<strong>in</strong><strong>in</strong>g execution <strong>time</strong>, the second absolute<br />
deadl<strong>in</strong>e. <strong>Tasks</strong> is � are ordered by <strong>in</strong>creas<strong>in</strong>g deadl<strong>in</strong>es. At <strong>time</strong> Ø �<br />
we have the execution scenario of both offl<strong>in</strong>e scheduled tasks and guaranteed<br />
aperiodic tasks from � as described <strong>in</strong> figure 3.3. Guaranteed firm aperiodic<br />
tasks will execute <strong>in</strong> the first available slots, <strong>in</strong> EDF order.<br />
Now assume a firm aperiodic task � �� � arrives at run-<strong>time</strong> at Ø � .We<br />
perform the onl<strong>in</strong>e guarantee algorithm to <strong>in</strong>vestigate if we can accept �:<br />
1. Task � has earlier deadl<strong>in</strong>e than �, so� ’s position <strong>in</strong> the set � rema<strong>in</strong>s<br />
unchanged, i.e., before �. We do not need to guarantee it aga<strong>in</strong>.
Example 59<br />
Á Á Á Á�<br />
� � � � �<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19<br />
Figure 3.3: Example onl<strong>in</strong>e firm aperiodic guarantee – execution without new<br />
task.<br />
Á Á Á Á�<br />
� �<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19<br />
2. Task � has a deadl<strong>in</strong>e after the deadl<strong>in</strong>e of �, which means that the �<br />
should execute before � . We must check if there is enough resources<br />
available for � to complete before its deadl<strong>in</strong>e. We calculate the f<strong>in</strong>ish<strong>in</strong>g<br />
<strong>time</strong> of � which is slot 15:<br />
�Ø� � ��Ø� Ì �Ø� � � � � � �<br />
The f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> is less than the deadl<strong>in</strong>e of �, which means that �<br />
could complete <strong>in</strong> <strong>time</strong>.<br />
Á Á Á Á�<br />
� � � � �<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19<br />
3. Now we must check if accept<strong>in</strong>g task � will cause any of other guaranteed<br />
firm aperiodic tasks (� , � ) to miss their deadl<strong>in</strong>es. We calculate<br />
their f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>s:<br />
�Ø� � ��Ø� Ì �Ø�� � � �� �<br />
�Ø� � ��Ø� Ì �Ø� � � � �� �<br />
Both � and � can complete before their deadl<strong>in</strong>es, which means that<br />
the new task � can be guaranteed and therefore <strong>in</strong>serted <strong>in</strong> the set of<br />
guaranteed firm aperiodic tasks � .
60 Summary and Outlook<br />
Á Á Á Á�<br />
� � � � � � �<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19<br />
3.6 Summary and Outlook<br />
In this paper we presented an algorithm for the flexible handl<strong>in</strong>g of firm aperiodic<br />
tasks <strong>in</strong> offl<strong>in</strong>e scheduled systems. It is based on slot shift<strong>in</strong>g, a method<br />
to comb<strong>in</strong>e offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g methods.<br />
First, a standard offl<strong>in</strong>e scheduler constructs a schedule, resolv<strong>in</strong>g complex<br />
task constra<strong>in</strong>ts such as precedence, distribution, and end-to-end deadl<strong>in</strong>es.<br />
This is then analyzed for unused resources and leeway <strong>in</strong> task executions.<br />
The run-<strong>time</strong> scheduler uses this <strong>in</strong>formation to handle aperiodic tasks, shift<strong>in</strong>g<br />
other task executions (”slots”) to reduce response <strong>time</strong>s without affect<strong>in</strong>g<br />
feasibility. We provided an Ç Æ acceptance test for a set of aperiodic tasks<br />
on the offl<strong>in</strong>e schedule and guarantee tasks without explicit reservation of resources.<br />
Our method supports flexible, value based selections of tasks to reject<br />
or remove <strong>in</strong> overload situations, and simple resource reclaim<strong>in</strong>g.<br />
While the current algorithm enables the rejection and removal of tasks, it<br />
does not address the issue of selection. We are <strong>in</strong>vestigat<strong>in</strong>g <strong>in</strong>to provid<strong>in</strong>g a<br />
number of overload handl<strong>in</strong>g strategies, e.g., [4], [7].<br />
In a previous paper [10], we presented an offl<strong>in</strong>e test for sporadic tasks<br />
based on worst case arrival assumptions. It cannot utilize less frequent arrivals<br />
for firm aperiodic tasks s<strong>in</strong>ce the run<strong>time</strong> overheads to reflect the cont<strong>in</strong>uous<br />
changes <strong>in</strong> resource availability are prohibitively high. We are look<strong>in</strong>g <strong>in</strong>to<br />
apply<strong>in</strong>g the algorithm presented here to handle sporadic tasks at run<strong>time</strong>.
Bibliography<br />
[1] G. Fohler. Jo<strong>in</strong>t schedul<strong>in</strong>g of distributed complex periodic and hard aperiodic<br />
tasks <strong>in</strong> statically scheduled systems. In Proc. 16th <strong>Real</strong>-<strong>time</strong> <strong>Systems</strong><br />
Symposium, Pisa, Italy, 1995.<br />
[2] M. Spuri and G. Buttazzo. Efficient aperiodic service under earliest deadl<strong>in</strong>e<br />
schedul<strong>in</strong>g. In Proceed<strong>in</strong>gs of the <strong>Real</strong>-Time <strong>Systems</strong> Symposium,<br />
Dec. 1994.<br />
[3] B. Sprunt, L. Sha, and J. Lehoczky. Aperiodic task schedul<strong>in</strong>g for hardreal-<strong>time</strong><br />
systems. <strong>Real</strong>- Time <strong>Systems</strong>, 1, July 1989.<br />
[4] G. Buttazzo and J. Stankovic. Add<strong>in</strong>g Robustness <strong>in</strong> Dynamic Preemptive<br />
Schedul<strong>in</strong>g. Kluwer Academic Publishers, 1995.<br />
[5] G. Koren and D. Shasha. Skip-over: Algorithms and complexity for overloaded<br />
systems that allow skips. In Proceed<strong>in</strong>gs of the <strong>Real</strong>-Time <strong>Systems</strong><br />
Symposium, Dec. 1992.<br />
[6] S. Baruah, G. Koren, D. Mao, and B. Mishra. On the competitiveness of<br />
on-l<strong>in</strong>e real-<strong>time</strong> task schedul<strong>in</strong>g. <strong>Real</strong>- Time <strong>Systems</strong>, 2(4), June 1992.<br />
[7] S. A. Aldarmi and A. Burns. Dynamic value-density for schedul<strong>in</strong>g real<strong>time</strong><br />
systems. In Proceed<strong>in</strong>gs 11th Euromicro Conference on <strong>Real</strong>-Time<br />
<strong>Systems</strong>, Dec 1999.<br />
[8] K. Ramamritham. Allocation and schedul<strong>in</strong>g of complex periodic tasks.<br />
In 10th Int. Conf. on Distributed Comput<strong>in</strong>g <strong>Systems</strong>, 1990.<br />
[9] G. Fohler and C. Koza. Heuristic schedul<strong>in</strong>g for distributed real-<strong>time</strong> systems.<br />
Technical Report 6/98, Institut für Technische Informatik, Technische<br />
Universität Wien, April 1989.
62 BIBLIOGRAPHY<br />
[10] Damir Isovic and Gerhard Fohler. <strong>Handl<strong>in</strong>g</strong> sporadic tasks <strong>in</strong> off-l<strong>in</strong>e<br />
scheduled distributed hard real-<strong>time</strong> systems. Proc. of 11th EUROMICRO<br />
conf. on RT systems, York, UK, June 1999.
Chapter 4<br />
Paper C: Efficient<br />
Schedul<strong>in</strong>g of <strong>Sporadic</strong>,<br />
Aperiodic, and Periodic<br />
<strong>Tasks</strong> with Complex<br />
Constra<strong>in</strong>ts<br />
Damir Isovic and Gerhard Fohler<br />
In Proceed<strong>in</strong>gs of the 21st IEEE <strong>Real</strong>-Time <strong>Systems</strong> Symposium, Orlando,<br />
Florida, USA, November 2000
Abstract<br />
Many <strong>in</strong>dustrial applications with real-<strong>time</strong> demands are composed of mixed<br />
sets of tasks with a variety of requirements. These can be <strong>in</strong> the form of standard<br />
tim<strong>in</strong>g constra<strong>in</strong>ts, such as period and deadl<strong>in</strong>e, or complex, e.g., to express<br />
application specific or non temporal constra<strong>in</strong>ts, reliability, performance,<br />
etc. Arrival patterns determ<strong>in</strong>e whether tasks will be treated as periodic, sporadic,<br />
or aperiodic. As many algorithms focus on specific sets of task types and<br />
constra<strong>in</strong>ts only, system design has to focus on those supported by a particular<br />
algorithm, at the expense of the rest.<br />
In this paper, we present an algorithm to deal with a comb<strong>in</strong>ation of mixed<br />
sets of tasks and constra<strong>in</strong>ts: periodic tasks with complex and simple constra<strong>in</strong>ts,<br />
soft and firm aperiodic, and sporadic tasks. Instead of provid<strong>in</strong>g an<br />
algorithm tailored for a specific set of constra<strong>in</strong>ts, we propose an EDF based<br />
run<strong>time</strong> algorithm, and the use of an offl<strong>in</strong>e scheduler for complexity reduction<br />
to transform complex constra<strong>in</strong>ts <strong>in</strong>to the EDF model. At run<strong>time</strong>, an extension<br />
to EDF, two level EDF, ensures feasible execution of tasks with complex<br />
constra<strong>in</strong>ts <strong>in</strong> the presence of additional tasks or overloads. We present an<br />
algorithm for handl<strong>in</strong>g offl<strong>in</strong>e guaranteed sporadic tasks, with m<strong>in</strong>imum <strong>in</strong>terarrival<br />
<strong>time</strong>s, <strong>in</strong> this context which keeps track of arrivals of <strong>in</strong>stances of<br />
sporadic tasks to reduce pessimism about future sporadic arrivals and improve<br />
response <strong>time</strong>s and acceptance of firm aperiodic tasks.<br />
A simulation study underl<strong>in</strong>es the effectiveness of the proposed approach.
Introduction 65<br />
4.1 Introduction<br />
Many <strong>in</strong>dustrial applications with real-<strong>time</strong> demands are composed of tasks of<br />
various types and constra<strong>in</strong>ts. Arrival patterns and importance, for example,<br />
determ<strong>in</strong>e whether tasks are periodic, aperiodic, sporadic, and soft, firm, or<br />
hard. The controll<strong>in</strong>g real-<strong>time</strong> system has to provide for a comb<strong>in</strong>ed set of<br />
such task types. The same holds for the various constra<strong>in</strong>ts of tasks. In addition<br />
to basic temporal constra<strong>in</strong>ts, such as periods, start-<strong>time</strong>s, deadl<strong>in</strong>es, and<br />
synchronization demands, e.g., precedence, jitter, or mutual exclusion, a system<br />
has to fulfill complex application demands which cannot be expressed as<br />
generally: Control applications may require constra<strong>in</strong>ts on <strong>in</strong>dividual <strong>in</strong>stances<br />
[1], rather than periods, reliability demands can enforce allocation and separation<br />
patterns, or eng<strong>in</strong>eer<strong>in</strong>g practice may require relations between system<br />
activities, all of which cannot be expressed directly with basic constra<strong>in</strong>ts.<br />
The choice of schedul<strong>in</strong>g algorithm or paradigm determ<strong>in</strong>es the set of types<br />
and constra<strong>in</strong>ts on tasks dur<strong>in</strong>g system design. Earliest deadl<strong>in</strong>e first or fixed<br />
priority schedul<strong>in</strong>g, for example, are chosen for simple dispatch<strong>in</strong>g and flexibility.<br />
Add<strong>in</strong>g constra<strong>in</strong>ts, however, <strong>in</strong>creases schedul<strong>in</strong>g overhead [2] or requires<br />
new, specific schedulability tests which may have to be developed yet.<br />
Offl<strong>in</strong>e schedul<strong>in</strong>g methods can accommodate many specific constra<strong>in</strong>ts and<br />
<strong>in</strong>clude new ones by add<strong>in</strong>g functions, but at the expense of run<strong>time</strong> flexibility,<br />
<strong>in</strong> particular <strong>in</strong>ability to handle aperiodic and sporadic tasks. Consequently, a<br />
designer given an application composed of mixed tasks and constra<strong>in</strong>ts has to<br />
choose which constra<strong>in</strong>ts to focus on <strong>in</strong> the selection of schedul<strong>in</strong>g algorithm;<br />
others have to be accommodated as well as possible.<br />
In this paper we present an algorithm to deal with mixed sets of tasks and<br />
constra<strong>in</strong>ts: periodic tasks with complex and simple constra<strong>in</strong>ts, soft and firm<br />
aperiodic, and sporadic tasks. Instead of provid<strong>in</strong>g an algorithm tailored for a<br />
specific set of constra<strong>in</strong>ts only, we propose an EDF based run<strong>time</strong> algorithm,<br />
and the use of an offl<strong>in</strong>e scheduler for complexity reduction to transform complex<br />
constra<strong>in</strong>ts <strong>in</strong>to the simple EDF model. So, at run<strong>time</strong>, all tasks are constra<strong>in</strong>ed<br />
by start-<strong>time</strong> and deadl<strong>in</strong>e only, which serves as an “<strong>in</strong>terface” between<br />
tasks of mixed constra<strong>in</strong>ts. An extension of EDF, two level EDF ensures<br />
the feasible execution of those tasks, whose complex constra<strong>in</strong>ts have been<br />
transformed offl<strong>in</strong>e, even <strong>in</strong> the presence of additional run<strong>time</strong> activities and<br />
overloads. It serves as a basis for the sporadic task handl<strong>in</strong>g presented.<br />
The offl<strong>in</strong>e transformation determ<strong>in</strong>es resource usage and distribution as<br />
well, which we use to handle sporadic tasks. An offl<strong>in</strong>e test determ<strong>in</strong>es and<br />
allocates resources for sporadic tasks such that worst case arrivals can be ac-
66 Introduction<br />
commodated at any <strong>time</strong>. At run<strong>time</strong>, however, when a sporadic task arrives,<br />
we do not need to account for its arrival at least for its m<strong>in</strong>imum <strong>in</strong>ter-arrival<br />
<strong>time</strong> and reuse its allocated resources for aperiodic tasks. Our algorithm keeps<br />
track of sporadic task arrivals to update the “current worst case” and applies it<br />
for an onl<strong>in</strong>e Ç Æ acceptance test for aperiodic tasks.<br />
Our methods also provides for the <strong>in</strong>tegration of offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g:<br />
A complete offl<strong>in</strong>e schedule can be constructed, transformed <strong>in</strong>to EDF<br />
tasks, and scheduled at run<strong>time</strong> together with other EDF tasks. Thus, our<br />
method comb<strong>in</strong>es handl<strong>in</strong>g of complex constra<strong>in</strong>ts, efficient and flexible run<strong>time</strong><br />
schedul<strong>in</strong>g, as well as offl<strong>in</strong>e and onl<strong>in</strong>e schedul<strong>in</strong>g.<br />
A variety of algorithms have been presented to handle periodic and aperiodic<br />
tasks, e.g., [3], [4], [5]. Most concentrate on particular types of constra<strong>in</strong>ts.<br />
An on-l<strong>in</strong>e algorithm for schedul<strong>in</strong>g sporadic tasks with shared resources<br />
<strong>in</strong> hard real-<strong>time</strong> systems has been presented <strong>in</strong> [6]. Schedul<strong>in</strong>g of<br />
sporadic requests with periodic tasks on an earliest-deadl<strong>in</strong>e-first (EDF) basis<br />
[7] has been presented <strong>in</strong> [8]. The slot shift<strong>in</strong>g algorithm to comb<strong>in</strong>e offl<strong>in</strong>e<br />
and onl<strong>in</strong>e schedul<strong>in</strong>g was presented <strong>in</strong> [9]. It focuses on <strong>in</strong>sert<strong>in</strong>g aperiodic<br />
tasks <strong>in</strong>to offl<strong>in</strong>e schedules by modify<strong>in</strong>g the run<strong>time</strong> representation of available<br />
resources. While appropriate for <strong>in</strong>clud<strong>in</strong>g sequences of aperiodic tasks,<br />
the overhead for sporadic task handl<strong>in</strong>g becomes too high. An offl<strong>in</strong>e test for<br />
sporadic tasks was given <strong>in</strong> [10]. It does not, however, provide for firm aperiodic<br />
tasks, only soft ones. The method presented here is based on the offl<strong>in</strong>e<br />
transformation of slot shift<strong>in</strong>g but provides a new run<strong>time</strong> algorithm, <strong>in</strong> particular<br />
for efficient sporadic task handl<strong>in</strong>g and resource reclaim<strong>in</strong>g at run<strong>time</strong>. It<br />
handles firm and soft aperiodic tasks as well.<br />
The use of <strong>in</strong>formation about amount and distribution of unused resources<br />
for non periodic activities is similar to the basic idea of slack steal<strong>in</strong>g [5], [11]<br />
which applies to fixed priority schedul<strong>in</strong>g. Our method applies this basic idea<br />
<strong>in</strong> the context of offl<strong>in</strong>e and EDF schedul<strong>in</strong>g. It requires a small run<strong>time</strong> data<br />
structure, simple run<strong>time</strong> mechanisms, go<strong>in</strong>g through a list with <strong>in</strong>crements<br />
and decrements, provides Ç Æ acceptance tests and facilitates changes <strong>in</strong> the<br />
set of tasks, for example to handle overloads. Furthermore, our method provides<br />
for handl<strong>in</strong>g of slack of non periodic tasks, as well, e.g., <strong>in</strong>stances of<br />
tasks can be separated by <strong>in</strong>tervals other than periods.<br />
The rest of this paper is organized as follows: The task model is described<br />
<strong>in</strong> section 4.2. The subsequent sections describe the different types of tasks:<br />
section 4.3 describes handl<strong>in</strong>g of periodic tasks, the offl<strong>in</strong>e complexity reduction<br />
of constra<strong>in</strong>ts, and a description of the extended EDF run<strong>time</strong> schedul<strong>in</strong>g<br />
method. Soft and firm aperiodic task handl<strong>in</strong>g is discussed <strong>in</strong> section 4.4. The
Task and System Assumptions 67<br />
algorithm for handl<strong>in</strong>g sporadic task together with the other task types is presented<br />
<strong>in</strong> section 4.5. Simulation results <strong>in</strong> section 4.6 illustrate the effectiveness<br />
of the algorithm. F<strong>in</strong>ally, section 4.7 concludes the paper.<br />
4.2 Task and System Assumptions<br />
In this paper, we dist<strong>in</strong>guish between simple constra<strong>in</strong>ts, i.e., period, start-<strong>time</strong>,<br />
and deadl<strong>in</strong>e, for the earliest deadl<strong>in</strong>e first schedul<strong>in</strong>g model, and complex constra<strong>in</strong>ts.<br />
4.2.1 Complex constra<strong>in</strong>ts<br />
We refer to such relations or attributes of tasks as complex constra<strong>in</strong>ts, which<br />
cannot be expressed directly <strong>in</strong> the earliest deadl<strong>in</strong>e first schedul<strong>in</strong>g model<br />
us<strong>in</strong>g period, start-<strong>time</strong>, and deadl<strong>in</strong>e. Offl<strong>in</strong>e transformations are needed to<br />
schedule these at run<strong>time</strong> with EDF. For some specific constra<strong>in</strong>ts such transformations<br />
have been presented, e.g., [12], [13]. Our method uses a general<br />
technique, capable of <strong>in</strong>corporat<strong>in</strong>g various constra<strong>in</strong>ts and their comb<strong>in</strong>ations.<br />
In the follow<strong>in</strong>g, we list examples to illustrate and motivate the general approach.<br />
Synchronization: Execution sequences, such as sampl<strong>in</strong>g - comput<strong>in</strong>g - actuat<strong>in</strong>g<br />
require a precedence order of task execution. An algorithm for the<br />
transformation of precedence constra<strong>in</strong>ts on s<strong>in</strong>gle processors to suit the EDF<br />
model has been presented <strong>in</strong> [12]. Many <strong>in</strong>dustrial applications, however, demand<br />
the allocation of tasks, <strong>in</strong> particular for sens<strong>in</strong>g and actuat<strong>in</strong>g to different<br />
processors, necessitat<strong>in</strong>g a distributed system with <strong>in</strong>ternode communication.<br />
The transformation of precedence constra<strong>in</strong>ts with an end-to-end deadl<strong>in</strong>e <strong>in</strong><br />
this case requires subtask deadl<strong>in</strong>e assignment to create execution w<strong>in</strong>dows on<br />
the <strong>in</strong>dividual nodes so that precedence is fulfilled, e.g., [14]. The analysis<br />
presented <strong>in</strong> [15] focuses on schedulability analysis for pairs of tasks communicat<strong>in</strong>g<br />
via a network rather than the decomposition of the precedence graph.<br />
Jitter: The execution start or end of certa<strong>in</strong> tasks, e.g., sampl<strong>in</strong>g or actuat<strong>in</strong>g<br />
<strong>in</strong> control systems, is constra<strong>in</strong>ed by maximum variations. Strictly periodic<br />
execution can solve some <strong>in</strong>stances of this problem, but over-constra<strong>in</strong>s the<br />
specification. Algorithms are computationally expensive [16].
68 Task and System Assumptions<br />
Non periodic execution: The commonly used model is periodic, i.e., <strong>in</strong>stances<br />
of tasks are released at constant, periodic <strong>in</strong>tervals of <strong>time</strong>. Non periodic<br />
constra<strong>in</strong>ts, such as some forms of jitter, e.g., for feedback loop delay<br />
<strong>in</strong> control systems [1], which require <strong>in</strong>stances of tasks to be separated by non<br />
constant length <strong>in</strong>tervals cannot be handled <strong>in</strong> this model, or have to be fitted<br />
<strong>in</strong>to the periodic model at the cost of over constra<strong>in</strong>ed specification. Similar<br />
reason<strong>in</strong>g applies to constra<strong>in</strong>ts over more than one <strong>in</strong>stance of a task, e.g., for<br />
iterations, data history or ages. A constra<strong>in</strong>t can be of the type “separate the<br />
execution of <strong>in</strong>stance � and � �by no more than Ñ�Ü and no less than Ñ�Ò”.<br />
Non temporal constra<strong>in</strong>ts: Demands for reliability, performance, or other<br />
system parameters impose demands on tasks from a system perspective, e.g.,<br />
to not allocate two tasks to the same node, or to have m<strong>in</strong>imum separation<br />
<strong>time</strong>s, etc.<br />
Application specific constra<strong>in</strong>ts - eng<strong>in</strong>eer<strong>in</strong>g practice: Applications may<br />
have demands specific to their nature. Duplicated messages on a bus <strong>in</strong> an<br />
automotive environment, for example, may need to follow a certa<strong>in</strong> pattern<br />
due to <strong>in</strong>terferences such as EMI. Wir<strong>in</strong>g can have length limitations, impos<strong>in</strong>g<br />
allocation of certa<strong>in</strong> tasks to nodes accord<strong>in</strong>g to their geographical positions.<br />
An eng<strong>in</strong>eer may want to improve schedules, creat<strong>in</strong>g constra<strong>in</strong>ts reflect<strong>in</strong>g his<br />
practical experience.<br />
4.2.2 Task types<br />
We assume all tasks <strong>in</strong> the system to be fully preemptive and to communicate<br />
with the rest of the system via data read at the beg<strong>in</strong>n<strong>in</strong>g and written at the end<br />
of their executions.<br />
Periodic tasks execute their <strong>in</strong>vocations with<strong>in</strong> regular <strong>time</strong> <strong>in</strong>tervals. A periodic<br />
task ÌÈ is characterized by its worst case execution <strong>time</strong> (Û �Ø) [17],<br />
period (Ô) and relative deadl<strong>in</strong>e (�Ð).<br />
The � Ø� <strong>in</strong>vocation of ÌÈ is denoted Ì � È<br />
and is characterized by its earliest start<br />
<strong>time</strong> (�×Ø) and relative deadl<strong>in</strong>e (�Ð).<br />
We refer to a periodic task with complex constra<strong>in</strong>ts which have been transformed<br />
offl<strong>in</strong>e as an offl<strong>in</strong>e task.
Task and System Assumptions 69<br />
Aperiodic tasks are <strong>in</strong>voked only once. Their arrival <strong>time</strong>s are unknown at<br />
design <strong>time</strong>. A firm aperiodic task � has the follow<strong>in</strong>g set of parameters:<br />
the arrival <strong>time</strong> (�Ö), worst case execution <strong>time</strong> and relative deadl<strong>in</strong>e. Soft<br />
aperiodic tasks have no deadl<strong>in</strong>e constra<strong>in</strong>ts.<br />
<strong>Sporadic</strong> tasks can arrive at the system at arbitrary po<strong>in</strong>ts <strong>in</strong> <strong>time</strong>, but with<br />
def<strong>in</strong>ed m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong>s between two consecutive <strong>in</strong>vocations. A<br />
sporadic task ÌË is characterized by its relative deadl<strong>in</strong>e, m<strong>in</strong>imum <strong>in</strong>ter-arrival<br />
<strong>time</strong> (�) and worst case execution <strong>time</strong>.<br />
These attributes are known before the run-<strong>time</strong> of the system. Additional <strong>in</strong>formation<br />
available on-l<strong>in</strong>e, is its arrival <strong>time</strong> and its absolute deadl<strong>in</strong>e.<br />
4.2.3 System assumptions<br />
Distributed system: We consider a distributed system, i.e., one that consists<br />
of several process<strong>in</strong>g and communication nodes [18]. While we allow for<br />
distributed system and distribution <strong>in</strong> the complex constra<strong>in</strong>ts, we handle those<br />
issues <strong>in</strong> the offl<strong>in</strong>e phase, i.e., at run<strong>time</strong>, no task migration takes place.<br />
Time model: We assume a discrete <strong>time</strong> model [19]. Time ticks are counted<br />
globally, by a synchronized clock with granularity of slotlength, and assigned<br />
numbers from 0 to . The <strong>time</strong> between the start and the end of a slot i<br />
is def<strong>in</strong>ed by the <strong>in</strong>terval �×ÐÓØÐ�Ò�Ø� £ �� ×ÐÓØÐ�Ò�Ø� £ � ℄. Slots have<br />
uniform length and start and end at the same <strong>time</strong> for all nodes <strong>in</strong> the system.<br />
Task periods and deadl<strong>in</strong>es must be multiples of the slot length.<br />
4.2.4 Task handl<strong>in</strong>g - overview<br />
The follow<strong>in</strong>g table gives an overview of when types of tasks are handled by<br />
our method.<br />
soft firm spo- simp. comp.<br />
aper. aper. radic per. per.<br />
offl<strong>in</strong>e sched. x x<br />
test x<br />
onl<strong>in</strong>e sched. x x x x x<br />
test x x
70 Periodic <strong>Tasks</strong> - Offl<strong>in</strong>e Complexity Reduction<br />
4.3 Periodic <strong>Tasks</strong> - Offl<strong>in</strong>e Complexity Reduction<br />
In this section we start describ<strong>in</strong>g the handl<strong>in</strong>g of various types of tasks, with<br />
periodic tasks with complex constra<strong>in</strong>ts. We will present a method for complexity<br />
reduction and onl<strong>in</strong>e schedul<strong>in</strong>g to ensure these transformed constra<strong>in</strong>ts.<br />
4.3.1 Offl<strong>in</strong>e complexity reduction<br />
F<strong>in</strong>d<strong>in</strong>g optimal solutions to most sets of complex constra<strong>in</strong>ts is an NP hard<br />
problem [20]. Consequently algorithms will be heuristic and produce suboptimal<br />
solutions only. Perform<strong>in</strong>g the complexity reduction offl<strong>in</strong>e, however,<br />
allows for elaborate methods, improvement of results and modifications <strong>in</strong> the<br />
non-successfull case. The transformation method should be flexible to <strong>in</strong>clude<br />
new types of constra<strong>in</strong>ts, to accommodate application specific demands and<br />
eng<strong>in</strong>eer<strong>in</strong>g requirements. A number of general methods for the specification<br />
and satisfaction of constra<strong>in</strong>ts can be applied for real-<strong>time</strong> tasks, e.g., [21] or<br />
[22]. Run<strong>time</strong> schedul<strong>in</strong>g has to ensure that tasks execute accord<strong>in</strong>g to their<br />
constra<strong>in</strong>ts, even <strong>in</strong> the presence of additional tasks or overload situations.<br />
We propose to use the offl<strong>in</strong>e transformation and onl<strong>in</strong>e guarantee of complex<br />
constra<strong>in</strong>ts of the slot shift<strong>in</strong>g method [9] 1 . Due to space limitations, we<br />
cannot give a full description here, but conf<strong>in</strong>e to salient features relevant to<br />
our new algorithms. More detailed descriptions can be found <strong>in</strong> [23], [9], [24].<br />
It uses standard offl<strong>in</strong>e schedulers, e.g., [25], [23] to create schedules which<br />
are then analyzed to def<strong>in</strong>e start-<strong>time</strong>s and deadl<strong>in</strong>es of tasks.<br />
First, the offl<strong>in</strong>e scheduler creates schedul<strong>in</strong>g tables for the selected periodic<br />
tasks with complex constra<strong>in</strong>ts. It allocates tasks to nodes and resolves<br />
complex constra<strong>in</strong>ts by construct<strong>in</strong>g sequences of task executions. The result<strong>in</strong>g<br />
offl<strong>in</strong>e schedule is a s<strong>in</strong>gle feasible, likely suboptimal solution. These<br />
sequences consist of subsets of the orig<strong>in</strong>al task set separated by allocation.<br />
Each task <strong>in</strong> a sequence is limited by either send<strong>in</strong>g or receiv<strong>in</strong>g of <strong>in</strong>ternode<br />
messages, predecessor or successor with<strong>in</strong> the sequence, or limits set by the<br />
offl<strong>in</strong>e scheduler. Start <strong>time</strong>s and deadl<strong>in</strong>e are set directly to the <strong>time</strong>s of <strong>in</strong>ternode<br />
messages or offl<strong>in</strong>e scheduler limits, or calculated recursively for tasks<br />
constra<strong>in</strong>ed only with<strong>in</strong> sequences. A more detailed description can be found<br />
<strong>in</strong> [9]. The f<strong>in</strong>al result is a set of <strong>in</strong>dependent tasks on s<strong>in</strong>gle nodes, with start<strong>time</strong>s<br />
and deadl<strong>in</strong>es.<br />
The offl<strong>in</strong>e schedul<strong>in</strong>g algorithm we use [23] is based on heuristic search<br />
to handle complexity reduction, and provide for straightforward <strong>in</strong>clusion of<br />
1 We do not, however, use its run<strong>time</strong> schedul<strong>in</strong>g and handl<strong>in</strong>g of non periodic tasks.
Periodic <strong>Tasks</strong> - Offl<strong>in</strong>e Complexity Reduction 71<br />
additional constra<strong>in</strong>ts by provid<strong>in</strong>g an additional feasibility test. It works with<br />
precedence constra<strong>in</strong>ts as basic model, handles jitter constra<strong>in</strong>ts, and performs<br />
allocation and subtask deadl<strong>in</strong>e assignment. In addition to constra<strong>in</strong>t transformation,<br />
the use of an offl<strong>in</strong>e scheduler provides for <strong>in</strong>tegration of offl<strong>in</strong>e and<br />
onl<strong>in</strong>e schedul<strong>in</strong>g as well.<br />
4.3.2 Run<strong>time</strong> guarantee of complex constra<strong>in</strong>ts<br />
In the previous steps we created tasks with start-<strong>time</strong> and deadl<strong>in</strong>e constra<strong>in</strong>ts,<br />
which can be scheduled by EDF at run<strong>time</strong>. The result<strong>in</strong>g feasible schedules<br />
represent the orig<strong>in</strong>al complex constra<strong>in</strong>ts. Additional run<strong>time</strong> tasks, however,<br />
can create overload situations, result<strong>in</strong>g <strong>in</strong> violations of the complex constra<strong>in</strong>ts.<br />
Thus, a mechanism is needed which ensures the feasible execution of<br />
these tasks, even <strong>in</strong> overload situations.<br />
We propose an extension to EDF, two level EDF for this purpose. The basic<br />
idea is to schedule tasks accord<strong>in</strong>g to EDF - “normal level”, but give priority<br />
-“priority level” to an offl<strong>in</strong>e task when it needs to start at latest, similar to the<br />
basic idea of slack steal<strong>in</strong>g [5] [11] for fixed priority schedul<strong>in</strong>g. Thus, the CPU<br />
is not completely available for run<strong>time</strong> tasks, but reduced by the amount allocated<br />
for offl<strong>in</strong>e tasks. So we need to know amount and location of resources<br />
available after offl<strong>in</strong>e tasks are guaranteed. Run<strong>time</strong> efficiency demands simple<br />
run<strong>time</strong> data structure and run<strong>time</strong> ma<strong>in</strong>tenance.<br />
Offl<strong>in</strong>e preparations After offl<strong>in</strong>e schedul<strong>in</strong>g, and calculation of start-<strong>time</strong>s<br />
and deadl<strong>in</strong>es, the deadl<strong>in</strong>es of tasks are sorted for each node. The schedule is<br />
divided <strong>in</strong>to a set of disjo<strong>in</strong>t execution <strong>in</strong>tervals for each node. Spare capacities<br />
to represent the amount of available resources are def<strong>in</strong>ed for these <strong>in</strong>tervals.<br />
Each deadl<strong>in</strong>e calculated for a task def<strong>in</strong>es the end of an <strong>in</strong>terval Á �. Several<br />
tasks with the same deadl<strong>in</strong>e constitute one <strong>in</strong>terval. Note that these <strong>in</strong>tervals<br />
differ from execution w<strong>in</strong>dows, i.e. start <strong>time</strong>s and deadl<strong>in</strong>e: execution w<strong>in</strong>dows<br />
can overlap, <strong>in</strong>tervals with spare capacities, as def<strong>in</strong>ed here, are disjo<strong>in</strong>t.<br />
The deadl<strong>in</strong>e of an <strong>in</strong>terval is identical to that of the task. The start, however, is<br />
def<strong>in</strong>ed as the maximum of the end of the previous <strong>in</strong>terval or the earliest start<br />
<strong>time</strong> of the task. The end of the previous <strong>in</strong>terval may be later than the earliest<br />
start <strong>time</strong>, or earlier (empty <strong>in</strong>terval). Thus it is possible that a task executes<br />
outside its <strong>in</strong>terval, i.e., earlier than the <strong>in</strong>terval start, but not before its earliest<br />
start<strong>time</strong>.
72 Periodic <strong>Tasks</strong> - Offl<strong>in</strong>e Complexity Reduction<br />
The spare capacities of an <strong>in</strong>terval Á� are calculated as given <strong>in</strong> formula 4.1:<br />
× Á� � �Á�� �<br />
Ì Á�<br />
Û �Ø Ì Ñ�Ò × Á� � (4.1)<br />
The length of Á�, m<strong>in</strong>us the sum of the activities assigned to it, is the amount of<br />
idle <strong>time</strong> <strong>in</strong> that <strong>in</strong>terval. These have to be decreased by the amount “lent” to<br />
subsequent <strong>in</strong>tervals: <strong>Tasks</strong> may execute <strong>in</strong> <strong>in</strong>tervals prior to the one they are<br />
assigned to. Then they “borrow” spare capacity from the “earlier” <strong>in</strong>terval.<br />
Obviously, the amount of unused resources <strong>in</strong> an <strong>in</strong>terval cannot be less<br />
than zero, and for most computational purposes, e.g., summ<strong>in</strong>g available resources<br />
up to a deadl<strong>in</strong>e are they considered zero, as detailed <strong>in</strong> later sections.<br />
We use negative values <strong>in</strong> the spare capacity variables to <strong>in</strong>crease run<strong>time</strong> efficiency<br />
and flexibility. In order to reclaim resources of a task which executes<br />
less than planned, or not at all, we only need to update the affected <strong>in</strong>tervals<br />
with <strong>in</strong>crements and decrements, <strong>in</strong>stead of a full recalculation. Which <strong>in</strong>tervals<br />
to update is derived from the negative spare capacities. The reader is<br />
referred to [23] for details.<br />
Thus, we can represent the <strong>in</strong>formation about amount and distribution of<br />
free resources <strong>in</strong> the system, plus onl<strong>in</strong>e constra<strong>in</strong>ts of the offl<strong>in</strong>e tasks with an<br />
array of four numbers per task. The run<strong>time</strong> mechanisms of the first version of<br />
slot shift<strong>in</strong>g added tasks by modify<strong>in</strong>g this data structure, creat<strong>in</strong>g new <strong>in</strong>tervals,<br />
which is not suitable for frequent changes as required by sporadic tasks.<br />
The method described <strong>in</strong> this paper only modifies spare capacity.<br />
Onl<strong>in</strong>e execution Run<strong>time</strong> schedul<strong>in</strong>g is performed locally for each node. If<br />
the spare capacities of the current <strong>in</strong>terval × Á � , EDF is applied on the<br />
set of ready tasks - “normal level”. × Á � <strong>in</strong>dicates that a guaranteed task<br />
has to be executed or else a deadl<strong>in</strong>e violation <strong>in</strong> the task set will occur. It<br />
will execute immediately - “priority level”. S<strong>in</strong>ce the amount of <strong>time</strong> spent at<br />
priority level is known and represented <strong>in</strong> spare capacity, guarantee algorithms<br />
<strong>in</strong>clude this <strong>in</strong>formation.<br />
After each schedul<strong>in</strong>g decision, the spare capacities of the affected <strong>in</strong>tervals<br />
are updated. If, <strong>in</strong> the current <strong>in</strong>terval Á , an aperiodic task executes, or the<br />
CPU rema<strong>in</strong>s idle for one slot, current spare capacity <strong>in</strong> Á is decreased. If<br />
an offl<strong>in</strong>e task assigned to Á executes spare capacity does not change. If an<br />
offl<strong>in</strong>e task Ì assigned to a later <strong>in</strong>terval Á��� � executes, the spare capacity<br />
of Á� is <strong>in</strong>creased - Ì was supposed to execute there but does not, and that of<br />
Á decreased. If Á� “borrowed” spare capacity, the “lend<strong>in</strong>g” <strong>in</strong>terval(s) will
Aperiodic <strong>Tasks</strong> 73<br />
be updated. This mechanism ensures that negative spare capacity turns zero or<br />
positive at run<strong>time</strong>. Current spare capacity is reduced either by aperiodic tasks<br />
or idle execution and will eventually become 0, <strong>in</strong>dicat<strong>in</strong>g a guaranteed task<br />
has to be executed. See [9] for more details.<br />
4.4 Aperiodic <strong>Tasks</strong><br />
A first verion of slot shift<strong>in</strong>g presented an algorithm to guarantee aperiodic<br />
tasks by <strong>in</strong>sert<strong>in</strong>g them <strong>in</strong>to an offl<strong>in</strong>e schedule. Once guaranteed, the resources<br />
allocated for the aperiodic were removed by creat<strong>in</strong>g a new <strong>in</strong>terval<br />
and adjust<strong>in</strong>g spare capacity. While efficient for guarantee<strong>in</strong>g sequences of<br />
aperiodic tasks without removal, the run<strong>time</strong> overhead for handl<strong>in</strong>g sporadic<br />
tasks efficiently is too high. Further, changes <strong>in</strong> the set of guaranteed tasks<br />
require costly deletion of <strong>in</strong>tervals, recalculation of spare capacities, and new<br />
guarantees. Thus, flexible schemes for rejections, removal of guaranteed tasks,<br />
and overload handl<strong>in</strong>g <strong>in</strong>duce prohibitively high overhead.<br />
The new method presented here separates acceptance and guarantee. It<br />
elim<strong>in</strong>ates the onl<strong>in</strong>e modificiation of <strong>in</strong>tervals and spare capacities and thus<br />
allows rejection strategies over the entire aperiodic task set.<br />
4.4.1 Acceptance test<br />
The basic idea beh<strong>in</strong>d our method is based on standard earliest deadl<strong>in</strong>e first<br />
guarantee, but sets it to work on top of the offl<strong>in</strong>e tasks. EDF is based on hav<strong>in</strong>g<br />
full availability of the CPU, so we have to consider <strong>in</strong>terference from offl<strong>in</strong>e<br />
scheduled tasks and perta<strong>in</strong> their feasibility.<br />
Assume, at <strong>time</strong> Ø , we have a set of guaranteed aperiodic tasks � Ø and an<br />
offl<strong>in</strong>e schedule represented by offl<strong>in</strong>e tasks, <strong>in</strong>tervals, and spare capacities. At<br />
<strong>time</strong> Ø �Ø �Ø , a new aperiodic � arrives. Meanwhile, a number of tasks of<br />
�Ø may have executed; the rema<strong>in</strong><strong>in</strong>g task set at Ø is denoted �Ø . We test if<br />
� ��Ø can be accepted, consider<strong>in</strong>g offl<strong>in</strong>e tasks. If so, we add � to the set<br />
of guaranteed aperiodics. No explicit reservation of resources is done, which<br />
would require changes <strong>in</strong> the <strong>in</strong>tervals and spare capacities. Rather, resources<br />
are guaranteed by accept<strong>in</strong>g the task only if it can be accepted together with<br />
the previous guaranteed and offl<strong>in</strong>e scheduled ones. This enables the efficient<br />
use of rejection strategies.<br />
The f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of a firm aperiodic task ��, with an execution demand<br />
of �� , is calculated with respect to the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of the previous task,
74 Aperiodic <strong>Tasks</strong><br />
�� . Without any offl<strong>in</strong>e tasks, it is calculated the same way as <strong>in</strong> the EDF<br />
algorithm:<br />
�Ø �� ��Ø �� ��<br />
S<strong>in</strong>ce we guarantee firm aperiodic tasks together with offl<strong>in</strong>e tasks, we extend<br />
the formula above with a new term that reflects the amount of resources re-<br />
served for offl<strong>in</strong>e tasks:<br />
�Ø �� � ��<br />
� Ø R[Ø� �Ø � ] ,� �<br />
�Ø �� R[�Ø �� ��Ø �� ],��<br />
where Ê�Ø �Ø ℄ stands for the amount of resources (<strong>in</strong> slots) reserved for the<br />
execution of offl<strong>in</strong>e tasks from <strong>time</strong> Ø to <strong>time</strong> Ø . We can access Ê�Ø �Ø ℄ via<br />
spare capacities and <strong>in</strong>tervals at run<strong>time</strong>:<br />
Ê�Ø �Ø ℄� Ø Ø �<br />
Ñ�Ü × �Á ℄�<br />
Á Ø �Ø<br />
As �Ø �� appears on both sides of the equation, a simple solution is not possible.<br />
Rather, we present an algorithm for computation of f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>s of hard<br />
aperiodic tasks with complexity of Ç Æ .<br />
4.4.2 Algorithm<br />
Let �� be a firm aperiodic task we want to guarantee. Let � denote the set of<br />
previously guaranteed but not yet completed firm aperiodic tasks, such as each<br />
task <strong>in</strong> � has a deadl<strong>in</strong>e later than or equal to �Р� :<br />
� � ��� � � � � � � ��� � ��� �<br />
Here is the pseudo code for the acceptance test and algorithm for f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong><br />
calculation:<br />
�Ø � ��Ø� �Ò�×��Ò�Ì �Ñ� Ñ�Ü �Ø �� �Ø � �� ;<br />
/* check if accept<strong>in</strong>g �� causes any of the previously<br />
guaranteed firm aperiodic tasks to miss its deadl<strong>in</strong>e */<br />
�� �Ø � �Ð �� �<br />
�ÓÖ � � � ���Ò�� �<br />
�Ø � ��Ø� �Ò�×��Ò�Ì �Ñ� �Ø� Ö�Ñ �� ;<br />
�� �Ø � �Ð �� not feasible!
<strong>Sporadic</strong> <strong>Tasks</strong> 75<br />
�<br />
�Ò×�ÖØ �� � ;<br />
�<br />
�Ð×� reject �<br />
��Ø� �Ò�×��Ò�Ì �Ñ� �ØÔ� Ö�Ñ �<br />
/* determ<strong>in</strong>e �Ø by “fill<strong>in</strong>g up”<br />
free slots until the is exhausted. */<br />
× Ö � ×Ø�ÖØ Á × Á �ØÔ;<br />
Û��Ð� Ö�Ñ � × Ö �<br />
�� × Ö Á �<br />
Ö�Ñ � Ö�Ñ × Ö;<br />
;<br />
�ØÔ � ×Ø�ÖØ Á<br />
× Ö � × Á ;<br />
�<br />
return �ØÔ Ö�Ñ ;<br />
�<br />
———<br />
Ö�Ñ = rema<strong>in</strong><strong>in</strong>g execution <strong>time</strong><br />
�ØÔ = the f<strong>in</strong>nish<strong>in</strong>g <strong>time</strong> of predecessor task<br />
The complexity of algorithm is Ç Æ , because we go through all tasks only<br />
once, and calculate their f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>s on the way. More detailed description<br />
of the algorithm can be found <strong>in</strong> [24].<br />
4.5 <strong>Sporadic</strong> <strong>Tasks</strong><br />
In the previous section we described how firm aperiodic tasks are guaranteed<br />
onl<strong>in</strong>e assum<strong>in</strong>g no sporadic tasks <strong>in</strong> the system. Now we will see how sporadic<br />
tasks can be <strong>in</strong>cluded <strong>in</strong> the aperiodic guarantee.<br />
We will discuss ways to handle sporadic tasks with periodic tasks with complex<br />
constra<strong>in</strong>ts. We present a new algorithm which keeps track of sporadic<br />
task arrivals and reduces pessimism about possible future arrivals to improve<br />
guarantees and response <strong>time</strong>s of aperiodic tasks.
76 <strong>Sporadic</strong> <strong>Tasks</strong><br />
4.5.1 <strong>Handl<strong>in</strong>g</strong> sporadic tasks<br />
Pseudo-periodic tasks – <strong>Sporadic</strong> tasks can be transformed offl<strong>in</strong>e <strong>in</strong>to pseudoperiodic<br />
tasks [26] which can be scheduled simply at run<strong>time</strong>. The overhead<br />
<strong>in</strong>duced by the method, however, can be very high: <strong>in</strong> extreme cases, a task<br />
handl<strong>in</strong>g an event which is rare, but has a tight deadl<strong>in</strong>e may require reservation<br />
of all resources.<br />
Offl<strong>in</strong>e test – In an earlier paper [10], we have presented an offl<strong>in</strong>e test for<br />
sporadic tasks on offl<strong>in</strong>e tasks. It ensured that the spare capacity available was<br />
sufficient for the worst case arrival of sporadic tasks without reflect<strong>in</strong>g it <strong>in</strong><br />
the spare capacity. Consequently, firm aperiodic tasks cannot be handled at<br />
run<strong>time</strong>.<br />
Offl<strong>in</strong>e test and onl<strong>in</strong>e aperiodic guarantees – A better algorithm will perform<br />
the offl<strong>in</strong>e test and decrease the needed resources from spare capacity.<br />
The result<strong>in</strong>g pessimism can be reduced by reclaim<strong>in</strong>g a slot upon non arrival<br />
of a sporadic task. Aperiodic guarantee will be possible, but have to consider<br />
worst case arrival patterns of the sporadic tasks at any <strong>time</strong>.<br />
Offl<strong>in</strong>e test and onl<strong>in</strong>e aperiodic guarantees and reduced pessimism –<br />
The algorithm presented here performs the offl<strong>in</strong>e test, but does not change<br />
<strong>in</strong>tervals and spare capacity for run<strong>time</strong> efficiency. At run<strong>time</strong>, its keeps track<br />
of sporadic arrivals to reduce pessimism, by remov<strong>in</strong>g sporadic tasks from the<br />
worst case arrival which are known to not arrive up to a certa<strong>in</strong> po<strong>in</strong>t. An<br />
aperiodic task algorithm utilizes this knowledge for short response <strong>time</strong>s.<br />
4.5.2 Interference w<strong>in</strong>dow<br />
We do not know when a sporadic task Ë� Ë, will <strong>in</strong>voke its <strong>in</strong>stances, but<br />
once an <strong>in</strong>stance of � arrives, we do know the m<strong>in</strong>imum <strong>time</strong> until the arrival<br />
of the next <strong>in</strong>stance — the m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong> of Ë �. We also know the<br />
worst case execution <strong>time</strong> of each sporadic task <strong>in</strong> Ë. We use this <strong>in</strong>formation<br />
for the acceptance test of firm aperiodic tasks.<br />
Assume a sporadic task Ë� <strong>in</strong>vokes an <strong>in</strong>stance at <strong>time</strong> Ø (see figure 4.1). Let<br />
Ë� � denote current <strong>in</strong>vocation of Ë �, and Ë �<br />
� the successive one. At <strong>time</strong> Ø we<br />
know that Ë �<br />
� will arrive no sooner than Ø �, where � is the m<strong>in</strong>imum <strong>in</strong>ter-<br />
arrival <strong>time</strong> of Ë�. So, when Ë � � has f<strong>in</strong>ished its execution, Ë� will not <strong>in</strong>fluence<br />
any of the firm aperiodic tasks at least until Ë �<br />
�<br />
arrives. This means that,
<strong>Sporadic</strong> <strong>Tasks</strong> 77<br />
when calculat<strong>in</strong>g the amount of resources available for a firm aperiodic task<br />
with an execution that <strong>in</strong>tersects with Ë�’s execution w<strong>in</strong>dow, we do not need<br />
to take <strong>in</strong>to account the <strong>in</strong>terference from Ë � at least between the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong><br />
of its current <strong>in</strong>vocation, Ë � �<br />
� , and the start <strong>time</strong> on the next <strong>in</strong>vocation, Ë � ,<br />
as depicted <strong>in</strong> figure 4.1.<br />
ÒÓ �Ò� ÐÙ�Ò � ÓÒ � �ÖÑ �Ô�Ö�Ó�� Ø�×�×<br />
Þ �� ß<br />
Ë � �<br />
Ë � �<br />
Ø Ø �<br />
Figure 4.1: A sporadic task.<br />
Let �Ï �� denote the execution w<strong>in</strong>dow of � �, i.e., the <strong>in</strong>terval between<br />
��’s arrival and its deadl<strong>in</strong>e:<br />
�Ï �� ���Ö �� ��Ð �� ℄� ��Ï� � �Ð �� �Ö ��<br />
Now we will see how the execution of a previously guaranteed sporadic task<br />
Ë� Ëcan <strong>in</strong>fluence ��’s guarantee.<br />
Let Ë � � denote the current <strong>in</strong>vocation of Ë �, i.e., the last <strong>in</strong>vocation of Ë�<br />
before �� arrived. Let ÁÏ� be the <strong>in</strong>terference w<strong>in</strong>dow of Ë�, that is the <strong>time</strong><br />
<strong>in</strong>terval <strong>in</strong> which � may preempt and <strong>in</strong>terfere with the execution of � �. The<br />
follow<strong>in</strong>g cases can be identified:<br />
case 1: Ë � � is unknown, i.e., the sporadic task Ë� has not started yet to <strong>in</strong>voke<br />
its <strong>in</strong>stances. � can arrive any <strong>time</strong> and we must assume the worst case,<br />
that is Ë� will start to <strong>in</strong>voke its <strong>in</strong>stances at Ø, with maximum frequency.<br />
The <strong>in</strong>terference w<strong>in</strong>dow is the entire execution w<strong>in</strong>dow of � �, ÁÏ� �<br />
�Ï.<br />
case 2: Ë � � is known, i.e., Ë� has <strong>in</strong>voked an <strong>in</strong>stance before Ø. The follow<strong>in</strong>g<br />
sub-cases can occur:<br />
a) ×Ø�ÖØ Ë � �<br />
� � Ø, i.e., the last <strong>in</strong>vocation completed before � �<br />
arrived, and the next <strong>in</strong>vocation, Ë �<br />
� , could have arrived but it<br />
has not yet. This means Ë �<br />
� can enter ��’s execution w<strong>in</strong>dow at<br />
any <strong>time</strong>, thus the same as <strong>in</strong> case 1, ÁÏ� � �Ï.<br />
b) �Ò� Ë � � � Ø � ×Ø�ÖØ Ë� � �, i.e., the current <strong>in</strong>vocation Ë � � has<br />
completed before Ø, and the next one has not arrived yet. But now
78 <strong>Sporadic</strong> <strong>Tasks</strong><br />
we know that the next one, Ë �<br />
�<br />
counted from the start <strong>time</strong> of Ë � � .<br />
Ë � �<br />
�Ö ��<br />
Ë � �<br />
will not arrive until � <strong>time</strong> slots,<br />
ÁÏ� Þ �� ß<br />
���<br />
This means the <strong>in</strong>terference w<strong>in</strong>dow can be decreased with the<br />
amount of slots <strong>in</strong> �Ï for which we know that Ë �<br />
� cannot possibly<br />
arrive:<br />
ÁÏ� ��×Ø�ÖØ Ë �<br />
�<br />
�� �Ð �� ℄<br />
c) Ø � �Ò� Ë � � , i.e., the current <strong>in</strong>vocation is still execut<strong>in</strong>g. In the<br />
worst case, the <strong>in</strong>terference w<strong>in</strong>dow is entire �Ï, ÁÏ� � �Ï.<br />
The processor demand approach, [27], can be used to determ<strong>in</strong>e the total<br />
process<strong>in</strong>g <strong>time</strong> needed for all sporadic tasks, Ë , which will <strong>in</strong>voke their<br />
<strong>in</strong>stances with<strong>in</strong> their <strong>in</strong>terference w<strong>in</strong>dows:<br />
Ò� �<br />
�ÁÏ��<br />
Ë �<br />
(4.2)<br />
��<br />
� �<br />
� �<br />
Now we will see how the <strong>in</strong>terference w<strong>in</strong>dow can actually get “shrunk”<br />
when guarantee<strong>in</strong>g a firm aperiodic task � under run<strong>time</strong>. It is usually not<br />
the case that � will start to execute as soon it arrives. This because of the<br />
offl<strong>in</strong>e tasks and previously guaranteed firm aperiodic tasks. In section 4.4,<br />
we presented a method for guarantee<strong>in</strong>g firm aperiodic tasks on top of offl<strong>in</strong>e<br />
tasks. The start <strong>time</strong> of the firm aperiodic task which is currently tested for<br />
acceptance is based on the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of its predecessor, i.e., another firm<br />
aperiodic task with earlier deadl<strong>in</strong>e. Hence, <strong>in</strong> some cases the start of the<br />
<strong>in</strong>terference w<strong>in</strong>dow ÁÏ� is set to the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of �’s predecessor.<br />
Here is an example: assume a firm aperiodic task � to be accepted and a<br />
sporadic task � as <strong>in</strong> case 2b above. The <strong>in</strong>terference w<strong>in</strong>dow is def<strong>in</strong>ed as<br />
below:<br />
�Ö ��<br />
ÁÏ�<br />
Þ �� ß<br />
Ë � � Ë � � Ë � �<br />
���
<strong>Sporadic</strong> <strong>Tasks</strong> 79<br />
Assume another previously accepted firm aperiodic task � which will delay<br />
the execution of �:<br />
�Ö ��<br />
Ë � � Ë � � Ë � �<br />
�Ø �<br />
ÁÏ� Þ �� ß<br />
���<br />
We see that the earliest <strong>time</strong> � can start is set to the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of its<br />
predecessor, �Ø � . So, all <strong>in</strong>vocation of Ë� that occured before �×Ø � are<br />
taken care of when calculat<strong>in</strong>g �Ø � , and are not concidered when calculat<strong>in</strong>g<br />
�Ø � . The start of the <strong>in</strong>terference w<strong>in</strong>dow is now set to the start <strong>time</strong> of the<br />
first possible <strong>in</strong>stance of Ë� that can <strong>in</strong>terfere with �, that is Ë �<br />
� .<br />
Now we calculate the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of � us<strong>in</strong>g the algorithm described <strong>in</strong><br />
section 4.4. Without sporadic tasks, � would be guaranteed to f<strong>in</strong>ish at <strong>time</strong><br />
�Ø � . S<strong>in</strong>ce � is guaranteed to f<strong>in</strong>ish before its deadl<strong>in</strong>e, we do not need to<br />
take <strong>in</strong>to consideration the impact from Ë � after the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of �. Hence,<br />
the end of the <strong>in</strong>terference w<strong>in</strong>dow ÁÏ� is set to �Ø � .<br />
�Ö ��<br />
ÁÏ� Þ �� ß<br />
Ë � � Ë � � Ë � �<br />
�Ø � �Ø �<br />
���<br />
So, what actually happens is that only one <strong>in</strong>stance of Ë � is concidered when<br />
calculat<strong>in</strong>g �Ø � .<br />
Now we can formalize what the impact of a sporadic task Ë � on a firm aperiodic<br />
task ��: Let �� be the predecessor of ��, i.e., the last firm aperiodic<br />
task that is guaranteed to execute before � � (task � <strong>in</strong> example above). If �<br />
has not yet started to <strong>in</strong>voke its <strong>in</strong>stances at the <strong>time</strong> we start with the acceptance<br />
test for ��, we must assume the worst case, that is the first <strong>in</strong>stance of �<br />
will start at the same <strong>time</strong> as the earliest start <strong>time</strong> of ��:<br />
�×Ø Ë � ��×Ø �� �Ñ�Ü Ø� �Ø ��
80 <strong>Sporadic</strong> <strong>Tasks</strong><br />
We have max because �� could have completed before the current <strong>time</strong> Ø,or<br />
�� has no predecessor at all.<br />
On the other hand, if � has started to <strong>in</strong>voke its <strong>in</strong>stances, we can calculate<br />
when the next one after the earliest possible <strong>time</strong> of � � can occur (Ë �<br />
� <strong>in</strong><br />
example above):<br />
� Ñ<br />
�×Ø Ë� ��×Ø Ë �<br />
�<br />
� �Ø �� �×Ø Ë �<br />
� �<br />
� � �<br />
To conclude, the <strong>time</strong> <strong>in</strong>terval ÁÏ� <strong>in</strong> which a sporadic task Ë� may preempt<br />
and <strong>in</strong>terfere with the execution of a firm aperiodic task � � is obta<strong>in</strong>ed<br />
as:<br />
ÁÏ� ��Æ��Ø �� ℄ (4.3)<br />
where Æ is the earliest possible <strong>time</strong> Ë� could preempt �� and is calculated as:<br />
� � Ñ<br />
�×Ø Ë<br />
Æ �<br />
�<br />
Ñ�Ü Ø� �Ø ��<br />
if � known<br />
otherwise<br />
(4.4)<br />
The <strong>in</strong>dex � Ñ po<strong>in</strong>ts out the first possible <strong>in</strong>vocation of Ë � which has earliest<br />
start <strong>time</strong> after the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of ��’s predecessor.<br />
4.5.3 Algorithm description<br />
Assume a firm aperiodic task �� that is tested for acceptance upon its arrival<br />
<strong>time</strong>, current <strong>time</strong> Ø. We want to make sure that �� will complete before its<br />
deadl<strong>in</strong>e, without caus<strong>in</strong>g any of the guaranteed tasks to miss its deadl<strong>in</strong>e. A<br />
guaranteed task is either an offl<strong>in</strong>e task, a previously guaranteed firm aperiodic<br />
task or a sporadic task. Offl<strong>in</strong>e and sporadic tasks are guaranteed before the<br />
run-<strong>time</strong> of the system, [9], [10], while firm aperiodic tasks are guaranteed<br />
onl<strong>in</strong>e, upon their arrival. The guarantee algorithm is performed as follows:<br />
step 1: Assume no sporadic tasks and calculate the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of � � based<br />
only on offl<strong>in</strong>e tasks and previously guaranteed firm aperiodic tasks (as<br />
described <strong>in</strong> section 4.4).<br />
step 2: Calculate the impact from all sporadic tasks that could preempt � �<br />
before its f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> calculated <strong>in</strong> the previous step (equation 4.2).
<strong>Sporadic</strong> <strong>Tasks</strong> 81<br />
step 3: If the impact is greater than zero, the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of � � will be postponed<br />
(moved forward), because at run-<strong>time</strong> we need to execute all sporadic<br />
<strong>in</strong>stances with deadl<strong>in</strong>es 2 less than ��� . The impact reflects the<br />
amount of �� that is to be executed after the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> calculated <strong>in</strong><br />
step 1. Now we treat the rema<strong>in</strong><strong>in</strong>g part of � � as a firm aperiodic task<br />
and repeat the procedure (go to step 1). But this <strong>time</strong> we start calculat<strong>in</strong>g<br />
the sporadic impact at the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of the first part of � �. The<br />
procedure is repeated until there is no impact from sporadic tasks on � �.<br />
Example: assume a firm aperiodic task � which arrives at current <strong>time</strong> Ø � ,<br />
with the execution demand � � � and deadl<strong>in</strong>e �Р� . Also assume<br />
a sporadic task Ë that has started to <strong>in</strong>voke its <strong>in</strong>stances before Ø, <strong>in</strong> slot 1,<br />
with a m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong> � � and worst case computation <strong>time</strong><br />
Ë � . For simplicity reasons, assume no offl<strong>in</strong>e tasks and no previously<br />
guaranteed hard aperiodic tasks. First we calculate the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> of �,<br />
without consider<strong>in</strong>g the sporadic task Ë, i.e., �Ø ��.<br />
Ë Ë Ë Ë �<br />
0 1 2 3 4 5 6 7 8 9 10 11 12 13<br />
�Ö � �Ø �Ø �Ð �<br />
The <strong>in</strong>terference w<strong>in</strong>dow of � is ÁÏ� � ��� �℄. The impact of Ë <strong>in</strong> ÁÏ� is<br />
equal to 2 (two <strong>in</strong>stances). Now we take the impact (which tells us how much<br />
� is delayed by Ë) and calculate its f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>, start<strong>in</strong>g at <strong>time</strong> Ø � �Ø ,<br />
i.e., �Ø � . We must check if we have any sporadic <strong>in</strong>stances <strong>in</strong> the new<br />
<strong>in</strong>terference <strong>in</strong>terval ÁÏ � � � � ℄ (note that orig<strong>in</strong>al ÁÏ � would be ��� ℄,<br />
but we always take the start <strong>time</strong> of the next <strong>in</strong>stance after the previous f<strong>in</strong>ish<strong>in</strong>g<br />
<strong>time</strong>, <strong>in</strong> this case �×Ø Ë � � ). The new impact is zero, which means that we<br />
can stop and the last calculated f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>, �Ø � , is the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong><br />
of �.<br />
Implementation The first part of the algorithm is exactly the same as described<br />
<strong>in</strong> 4.4: first we locate the position of hard aperiodic task to be guaranteed,<br />
calculate its f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> and check if any of previously guaranteed<br />
hard aperiodic tasks will miss its deadl<strong>in</strong>e. The second part, that calculates<br />
2 The deadl<strong>in</strong>e of a sporadic <strong>in</strong>stance is set to the earliest start <strong>time</strong> of the next <strong>in</strong>stance
82 Simulation Analysis<br />
the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong>, is extended to handle the impact from the sporadic tasks as<br />
follows:<br />
��Ø� �Ò�×��Ò�Ì �Ñ� �ØÔÖ��� �<br />
/*determ<strong>in</strong>e �Ø without sporadics by “fill<strong>in</strong>g up”<br />
free slots until the is exhausted.*/<br />
�Ë� Ë<br />
if � started to <strong>in</strong>voke<br />
else<br />
�<br />
Æ � �×Ø Ë� Ñ<br />
/*eq (4.4)*/<br />
�<br />
Æ � Ñ�Ü Ø� �ØÔÖ��<br />
Ð �ÁÏ��<br />
ÁÏ� ��Æ��Ø℄ Ñ /*eq (4.3)*/<br />
×ÙÑ � ×ÙÑ<br />
� /*eq (4.2)*/<br />
� �<br />
if ×ÙÑ ��<br />
��Ø� �Ò�×��Ò�Ì �Ñ� �Ø� ×ÙÑ<br />
else<br />
return �Ø<br />
The recursive formulation was chosen for simplicity of explanation: our<br />
implemtentation uses a loop. In the loop, <strong>time</strong> is <strong>in</strong>creased from current to<br />
f<strong>in</strong>ish <strong>time</strong>, without go<strong>in</strong>g back. Thus the complexity rema<strong>in</strong>s l<strong>in</strong>ear, similar to<br />
the f<strong>in</strong>ish<strong>in</strong>g <strong>time</strong> algorithm <strong>in</strong> 4.4.<br />
4.6 Simulation Analysis<br />
We have implemented the described mechanisms and have run simulations<br />
with the RTSim simulator [28] for various scenarios. We have tested the acceptance<br />
ratio for firm aperiodic tasks with the methods to handle sporadic tasks<br />
described <strong>in</strong> 4.5: no sporadic tasks for reference purposes (“no sporadics”),<br />
worst case arrivals without knowledge about <strong>in</strong>vocations (“no <strong>in</strong>fo”), and updated<br />
worst case with arrival <strong>in</strong>fo (“updated”). We randomly generate offl<strong>in</strong>e<br />
tasks, sporadic and aperiodic task loads. The results were obta<strong>in</strong>ed for an offl<strong>in</strong>e<br />
scheduled task load of �� and schedule length of slots. We studied the<br />
acceptance ratio �Ê of the randomly arriv<strong>in</strong>g aperiodic tasks under randomly<br />
generated arrival patterns for the sporadic tasks. The worst case sporadic load,<br />
i.e., all sporadic tasks arriv<strong>in</strong>g with maximum frequency was set to � . The<br />
arrival frequencies of sporadic tasks were set accord<strong>in</strong>g to a factor, � � � Ø, such
Summary and Outlook 83<br />
that �ÒØ�Ö�ÖÖ�Ú�ÐØ�Ñ� � Ñ�Ò�ÑÙÑ �ÒØ�Ö�ÖÖ�Ú�ÐØ�Ñ� ¢ ��� Ø. Deadl<strong>in</strong>es<br />
for firm aperiodic tasks were generated randomly with<strong>in</strong> one schedule length.<br />
The maximum load demanded by the aperiodic tasks is ���.<br />
Each po<strong>in</strong>t represents a sample size of some 1000 tests. 0.95 confidence <strong>in</strong>tervals<br />
were smaller than 5%. We can see that our method improves the accep-<br />
�Ê (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
Æ<br />
Æ<br />
Æ<br />
Æ<br />
Æ<br />
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯<br />
1 1.5 2 2.5 3 3.5 4 4.5 5<br />
�� � Ø<br />
no sporadics<br />
Æ updated<br />
¯ no <strong>in</strong>fo<br />
Figure 4.2: Guarantee Ratio for Firm Aperiodic <strong>Tasks</strong><br />
tance ratio of firm aperiodic tasks. This results from the fact that our methods<br />
reduces pessimism about sporadic arrivals by keep<strong>in</strong>g track of arrivals.<br />
4.7 Summary and Outlook<br />
In this paper we have presented methods to schedule sets of mixed types of<br />
tasks with complex constra<strong>in</strong>ts, by us<strong>in</strong>g earliest deadl<strong>in</strong>e first schedul<strong>in</strong>g and<br />
offl<strong>in</strong>e complexity reduction. In particular, we have proposed an algorithm<br />
to handle sporadic tasks to improve response <strong>time</strong>s and acceptance of firm<br />
aperiodic tasks.<br />
Æ<br />
Æ<br />
Æ<br />
Æ
84 Acknowledgements<br />
We have presented the use of an offl<strong>in</strong>e scheduler to transform complex<br />
constra<strong>in</strong>ts of tasks <strong>in</strong>to start<strong>time</strong>s and deadl<strong>in</strong>es of tasks for simple EDF run<strong>time</strong><br />
schedul<strong>in</strong>g. We provided an extension to EDF, two level EDF, to ensure<br />
feasible execution of these tasks <strong>in</strong> the presence of additional tasks or overloads.<br />
Dur<strong>in</strong>g offl<strong>in</strong>e analysis our algorithm determ<strong>in</strong>es the amount and location<br />
of unused resources, which we use to provide Ç Æ onl<strong>in</strong>e acceptance<br />
tests for firm aperiodic tasks. We presented an algorithm for handl<strong>in</strong>g offl<strong>in</strong>e<br />
guaranteed sporadic tasks, which keeps track of arrivals of <strong>in</strong>stances of sporadic<br />
tasks at run<strong>time</strong>. It uses this updated <strong>in</strong>formation to reduce pessimism<br />
about future sporadic arrivals and improve response <strong>time</strong>s and acceptance of<br />
firm aperiodic tasks. Results of simulation study show the effectiveness of the<br />
algorithms.<br />
Future research will deal with extend<strong>in</strong>g the algorithm to <strong>in</strong>clude <strong>in</strong>terrupts,<br />
overload handl<strong>in</strong>g, and aperiodic and sporadic tasks with complex constra<strong>in</strong>ts<br />
as well. We are study<strong>in</strong>g the <strong>in</strong>clusion of server algorithms, e.g., [29] <strong>in</strong>to<br />
our schedul<strong>in</strong>g model by <strong>in</strong>clud<strong>in</strong>g bandwidth as additional requirement <strong>in</strong> the<br />
offl<strong>in</strong>e transformation.<br />
4.8 Acknowledgements<br />
The authors wish to express their gratitude to Tomas Lennvall, Radu Dobr<strong>in</strong>,<br />
and Joachim Nilsson for useful discussions and to the reviewers for their helpful<br />
comments. The work presented <strong>in</strong> this paper was partly supported by the<br />
Swedish Science Foundation via ARTES.
Bibliography<br />
[1] M. Törngren. Fundamentals of implement<strong>in</strong>g real-<strong>time</strong> control applications<br />
<strong>in</strong> distributed computer systems. <strong>Real</strong>-Time <strong>Systems</strong>, 1997.<br />
[2] V. Yodaiken. Rough notes on priority <strong>in</strong>heritance. Technical report, New<br />
Mexico Institut of M<strong>in</strong><strong>in</strong>g, 1998.<br />
[3] M. Spuri, Giorgio C. Buttazzo, and F. Sens<strong>in</strong>i. Robust aperiodic schedul<strong>in</strong>g<br />
under dynamic priority systems. In Proc. of the IEEE RTSS, Dec.<br />
1995.<br />
[4] B. Sprunt, L. Sha, and J. Lehoczky. Aperiodic task schedul<strong>in</strong>g for hard<br />
real-<strong>time</strong> systems. <strong>Real</strong>-Time <strong>Systems</strong> Journal, 1(1):27–60, June 1989.<br />
[5] S. R. Thuel and J.P. Lehoczky. Algorithms for schedul<strong>in</strong>g hard aperiodic<br />
tasks <strong>in</strong> fixed-priority systems us<strong>in</strong>g slack steal<strong>in</strong>g. In Procedd<strong>in</strong>gs of the<br />
<strong>Real</strong>-Time Symposium, pages 22–33, San Juan, Puerto Rico, Dec. 1994.<br />
[6] K. Jeffay. Schedul<strong>in</strong>g sporadic tasks with shared resources <strong>in</strong> hard real<strong>time</strong><br />
systems. Dept. of Comp. Sci., Univ. of North Carol<strong>in</strong>a at Chapel<br />
Hill, 1992.<br />
[7] C.L. Liu and J.W. Layland. Schedul<strong>in</strong>g algorithms for multiprogramm<strong>in</strong>g<br />
<strong>in</strong> hard real-<strong>time</strong> environment. Journ. of the ACM, 20, 1, Jan. 1973.<br />
[8] T. Tia, W.S. Liu, J. Sun, and R. Ha. A l<strong>in</strong>ear-<strong>time</strong> optimal acceptance<br />
test for schedul<strong>in</strong>g of hard real-<strong>time</strong> tasks. Dept. of Comp. Sc., Univ. of<br />
Ill<strong>in</strong>ois at Urbana-Champaign, 1994.<br />
[9] G. Fohler. Jo<strong>in</strong>t schedul<strong>in</strong>g of distributed complex periodic and hard aperiodic<br />
tasks <strong>in</strong> statically scheduled systems. In Proc. 16th <strong>Real</strong>-<strong>time</strong> <strong>Systems</strong><br />
Symposium, Pisa, Italy, 1995.
86 BIBLIOGRAPHY<br />
[10] Damir Isovic and Gerhard Fohler. <strong>Handl<strong>in</strong>g</strong> sporadic tasks <strong>in</strong> off-l<strong>in</strong>e<br />
scheduled distributed hard real-<strong>time</strong> systems. Proc. of 11th EUROMICRO<br />
conf. on RT systems, York, UK, June 1999.<br />
[11] R.I. Davis, K.W. T<strong>in</strong>dell, and A. Burns. Schedul<strong>in</strong>g slack <strong>time</strong> <strong>in</strong> fixed<br />
priority pre-emptive systems. In Procedd<strong>in</strong>gs of the <strong>Real</strong>-Time Symposium,<br />
pages 222–231, Dec. 1993.<br />
[12] H. Chetto, M. Silly, and T. Bouchentouf. Dynamic schedul<strong>in</strong>g of real<strong>time</strong><br />
tasks under precedence constra<strong>in</strong>ts. <strong>Real</strong>-Time <strong>Systems</strong> Journal,<br />
2(3):181–194, Sept. 1990.<br />
[13] R. Gerber, W. Pugh, and M. Saksena. Parametric dispatch<strong>in</strong>g of hard<br />
real-<strong>time</strong> tasks. IEEE Transactions on Computers, 44(3), March 1995.<br />
[14] M. DiNatale and J.A. Stankovic. Applicability of simulated anneal<strong>in</strong>g<br />
methods to real-<strong>time</strong> schedul<strong>in</strong>g and jitter control. In Proceed<strong>in</strong>gs of<br />
<strong>Real</strong>-Time <strong>Systems</strong> Symposium, Dec. 1995.<br />
[15] K. T<strong>in</strong>dell and J. Clark. Holistic schedulability analysis for distributed<br />
hard real-<strong>time</strong> systems. Microprocess<strong>in</strong>g and Microprogramm<strong>in</strong>g, 50(2-<br />
3), 1994.<br />
[16] S. Baruah, G. Buttazzo, S. Gor<strong>in</strong>sky, and G. Lipari. Schedul<strong>in</strong>g periodic<br />
task systems to m<strong>in</strong>imize output jitter. In Sixth International Conference<br />
on <strong>Real</strong>-Time Comput<strong>in</strong>g <strong>Systems</strong> and Applications, Dec. 1999.<br />
[17] P. Puschner and C. Koza. Calculat<strong>in</strong>g the maximum execution <strong>time</strong> of<br />
real-<strong>time</strong> programs. RT <strong>Systems</strong> Journal, 1989.<br />
[18] J.A. Stankovic, K. Ramamritham, and C.-S. Cheng. Evaluation of a<br />
flexible task schedul<strong>in</strong>g algorithm for distributed hard real-<strong>time</strong> systems.<br />
IEEE Trans. on comp., 34(12), Dec 1995.<br />
[19] H. Kopetz. Sparse <strong>time</strong> versus dense <strong>time</strong> <strong>in</strong> distributed real <strong>time</strong> systems.<br />
In Proc. of the Second Int. Workshop on Responsice Comp. Sys., Saitama,<br />
Japan, Oct. 1992.<br />
[20] M.R. Garey., D.S. Johnson, B.B. Simons, and R.E. Tarjan. Schedul<strong>in</strong>g<br />
unit-<strong>time</strong> tasks with arbitrary release <strong>time</strong>s and deadl<strong>in</strong>es. IEEE Trans.<br />
on Soft. Eng., May 1981.
BIBLIOGRAPHY 87<br />
[21] F. Jahanian, R. Lee, and A. Mok. Semantics of modechart <strong>in</strong> real <strong>time</strong><br />
logic. In Proc. of the 21st Hawaii International Conference on <strong>Systems</strong><br />
Sciences, pages 479–489, Jan. 1988.<br />
[22] J. Wurtz and K. Schild. Schedul<strong>in</strong>g of <strong>time</strong>-triggered real-<strong>time</strong> systems.<br />
Technical report, German Research centre for Artificial Intelligence -<br />
DKFI GmbH, 1997.<br />
[23] G. Fohler. Flexibility <strong>in</strong> Statically Scheduled Hard <strong>Real</strong>-Time <strong>Systems</strong>.<br />
PhD thesis, Technische Universität Wien, Austria, Apr. 1994.<br />
[24] D. Isovic and G. Fohler. Onl<strong>in</strong>e handl<strong>in</strong>g of hard aperiodic tasks <strong>in</strong> <strong>time</strong><br />
triggered systems. In Proceed<strong>in</strong>gs of the 11th Euromicro Conference on<br />
<strong>Real</strong>-Time <strong>Systems</strong>, June 1999.<br />
[25] K. Ramamritham. Allocation and schedul<strong>in</strong>g of complex periodic tasks.<br />
In 10th Int. Conf. on Distributed Comput<strong>in</strong>g <strong>Systems</strong>, 1990.<br />
[26] A. K. Mok. Fundamental Design Problems of Distributed <strong>Systems</strong> for<br />
the Hard <strong>Real</strong>-Time Environment. PhD thesis, MIT, 1983. Report<br />
MIT/LCS/TR-297.<br />
[27] K. Jeffay and D.L. Stone. Account<strong>in</strong>g for <strong>in</strong>terrupt handl<strong>in</strong>g costs <strong>in</strong> dynamic<br />
priority task systems. In Proceed<strong>in</strong>gs of <strong>Real</strong>-Time <strong>Systems</strong> Symposium,<br />
pages 212–221, Dec. 1993.<br />
[28] G. Buttazzo, A. Casile, G. Lamastra, and G. Lipari. A schedul<strong>in</strong>g simulator<br />
for real-<strong>time</strong> distributed systems. In Proceed<strong>in</strong>gs of the IFAC Workshop<br />
on Distributed Computer Control <strong>Systems</strong> (DCCS ’98), 1999.<br />
[29] L. Abeni and G. Buttazzo. Integrat<strong>in</strong>g mul<strong>time</strong>dia applications <strong>in</strong> hard<br />
real-<strong>time</strong> systems. In Proceed<strong>in</strong>gs of <strong>Real</strong>-Time <strong>Systems</strong> Symposium, Dec.<br />
1998.
Chapter 5<br />
Paper D – Simulation<br />
Analysis of <strong>Sporadic</strong> and<br />
Aperiodic Task <strong>Handl<strong>in</strong>g</strong><br />
Damir Isovic and Gerhard Fohler<br />
Technical Report , Mälardalen <strong>Real</strong>-Time Research Centre, Mälardalen University,<br />
May 2001.
Abstract<br />
In this paper we present the simulation results for proposed algorithms to<br />
handle mixed sets of tasks and sonstra<strong>in</strong>ts: periodic tasks with complex and<br />
simple constra<strong>in</strong>ts, soft and firm aperiodics, and sporadic tasks.
90 Experiment 1: Firm aperiodic guarantee<br />
5.1 Introduction<br />
We have implemented the algorithms described <strong>in</strong> [1] and [2] and have run<br />
simulations for various scenarious.<br />
In the first set of exepriments we simulated the onl<strong>in</strong>e guarantee algorithm<br />
for firm aperiodic tasks, described <strong>in</strong> [1] (paper B <strong>in</strong> this thesis). We have<br />
studied the guarantee ratio for aperiodic tasks for different comb<strong>in</strong>ations of<br />
total system loads and aperiodic deadl<strong>in</strong>es.<br />
In the second set of exeperiments we have <strong>in</strong>troduced sporadic tasks, as<br />
suggested <strong>in</strong> [2] (paper C), and have repeated the simulations for different<br />
comb<strong>in</strong>ations of periodic, sporadic and aperiodic tasks. We have measured<br />
the guarantee ratio of firm aperiodic tasks, depend<strong>in</strong>g on different scenarious<br />
for sporadic tasks. We also <strong>in</strong>vestigated how the variations <strong>in</strong> m<strong>in</strong>imum <strong>in</strong>terarrival<br />
<strong>time</strong>s for sporadics <strong>in</strong>fluence aperiodic guarantee.<br />
The simulation study underl<strong>in</strong>es the effectiveness of the proposed approach.<br />
5.2 Simulation environment<br />
Simulations refered <strong>in</strong> previous papers were made with the RTSim simulator<br />
[3]. For the purpose of this thesis, we have developed a new simulator to<br />
provide for detailed analysis of slot shift<strong>in</strong>g.<br />
We also implemented a debuger, which provides for visual monitor<strong>in</strong>g of<br />
the data structures dur<strong>in</strong>g the simulations.<br />
Simulations were performed <strong>in</strong> parallell on 5 different PC computers with<br />
the processor speed between 333 and 1500 MHz. Some 800 000 different <strong>in</strong>teractions<br />
of sporadic, periodic and aperiodic tasks were simulated. The amount<br />
of data produced was more than 1 GB. The average size of an <strong>in</strong>put file needed<br />
for one graph l<strong>in</strong>e was 30 MB. That would produce aproximately 50 MB of<br />
data to be analysed. The total lenght of simultions for both experiments was<br />
about 200 hours.<br />
5.3 Experiment 1: Firm aperiodic guarantee<br />
5.3.1 Experimental setup<br />
For the first experiment series , we randomly generate generated offl<strong>in</strong>e and<br />
aperiodic task loads, so that the comb<strong>in</strong>ed load of both periodic and aperiodic<br />
tasks was set to 10% - 100%. The deadl<strong>in</strong>e for the aperiodic tasks was
Experiment 1: Firm aperiodic guarantee 91<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Method: Background<br />
deadl<strong>in</strong>e=3*MAXT<br />
deadl<strong>in</strong>e=2*MAXT<br />
deadl<strong>in</strong>e=1*MAXT<br />
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0<br />
Comb<strong>in</strong>ed offl<strong>in</strong>e and aperiodic load<br />
Figure 5.1: Guarantee ratio for aperiodic tasks – Background<br />
set to their maximum execution <strong>time</strong>, MAXT, two <strong>time</strong>s MAXT and three<br />
<strong>time</strong>s MAXT. We studied the guarantee ratio of the randomly arriv<strong>in</strong>g aperiodic<br />
tasks.<br />
The simplest method to handle aperiodic tasks <strong>in</strong> the presence of periodic<br />
tasks is to offl<strong>in</strong>e schedule them <strong>in</strong> background i.e., when there are no periodic<br />
<strong>in</strong>stances ready to execute. The major problem with this technique is that, for<br />
high periodic loads, the response <strong>time</strong> of aperiodic requests can be too long. We<br />
compared our method to the background schedul<strong>in</strong>g. We refer to our method<br />
as Slot Shift<strong>in</strong>g – Extended, or SSE.<br />
5.3.2 Results<br />
In this subsection we present obta<strong>in</strong>ed results. Each po<strong>in</strong>t represents a sample<br />
size of 800-3000 simulation runs, with diffrent comb<strong>in</strong>ations of periodic and<br />
aperiodic tasks. 0.95 confidence <strong>in</strong>tervals were smaller than 5%.<br />
Figure 5.1 illustrates the performance of background schedul<strong>in</strong>g for three<br />
different deadl<strong>in</strong>e sett<strong>in</strong>gs of aperiodic tasks.
92 Experiment 1: Firm aperiodic guarantee<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Method: SSE<br />
deadl<strong>in</strong>e=3*MAXT<br />
deadl<strong>in</strong>e=2*MAXT<br />
deadl<strong>in</strong>e=1*MAXT<br />
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0<br />
Comb<strong>in</strong>ed offl<strong>in</strong>e and aperiodic load<br />
Figure 5.2: Guarantee ratio for aperiodic tasks – SSE<br />
Figure 5.2 depicts the performance of SSE.<br />
In figures 5.3, 5.4 and 5.5 we put both methods together, to see the difference<br />
<strong>in</strong> performance for different deadl<strong>in</strong>e sett<strong>in</strong>gs.<br />
As expected, backgound schedul<strong>in</strong>g performed poorly <strong>in</strong> the high load situations,<br />
specially with tight aperiodic deadl<strong>in</strong>es. For this reason, background<br />
schedul<strong>in</strong>g can be adopted only when the aperiodic activities do not have str<strong>in</strong>gent<br />
tim<strong>in</strong>g constra<strong>in</strong>ts and the periodic load is not high.<br />
The graphs show the efficiency of the SSE mechanisms, as guarantee ratios<br />
are very high. As expected, the guarantee ratio for aperiodic tasks with larger<br />
deadl<strong>in</strong>es is higher than for smaller deadl<strong>in</strong>es. Even under very high load,<br />
guarantee ratios stay high.
Experiment 1: Firm aperiodic guarantee 93<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Deadl<strong>in</strong>e=MAXT<br />
Background<br />
SSE<br />
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0<br />
Comb<strong>in</strong>ed offl<strong>in</strong>e and aperiodic load<br />
Figure 5.3: Guarantee ratio for aperiodic tasks, dl=MAXT – SSE vs Background<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Deadl<strong>in</strong>e=2*MAXT<br />
Background<br />
SSE<br />
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0<br />
Comb<strong>in</strong>ed offl<strong>in</strong>e and aperiodic load<br />
Figure 5.4: Guarantee ratio for aperiodic tasks, dl=2*MAXT – SSE vs Bgr
94 Experiment 2: Firm aperiodic guarantee with sporadics<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Deadl<strong>in</strong>e=3*MAXT<br />
Background<br />
SSE<br />
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0<br />
Comb<strong>in</strong>ed offl<strong>in</strong>e and aperiodic load<br />
Figure 5.5: Guarantee ratio for aperiodic tasks, dl=3*MAXT – SSE vs Bgr<br />
5.4 Experiment 2: Firm aperiodic guarantee with<br />
sporadics<br />
In the second experiment, we have tested the acceptance ratio for firm aperiodic<br />
tasks with the methods to handle sporadic tasks described <strong>in</strong> <strong>in</strong> [2]: worst<br />
case arrivals without knowledge about <strong>in</strong>vocations (refered as “no <strong>in</strong>fo”), and<br />
updated worst case with arrival <strong>in</strong>fo (“updated”).<br />
5.4.1 Experimental setup<br />
We studied the guarantee ratio of randomly arriv<strong>in</strong>g aperiodic tasks under randomly<br />
generated arrival patterns for the sporadic tasks. First we <strong>in</strong>vestigated<br />
the guarantee ratio for firm aperiodic tasks with comb<strong>in</strong>ed loads 10% - 100%.<br />
The deadl<strong>in</strong>e for the aperiodic tasks was set to MAXT and 2*MAXT. The comb<strong>in</strong>ed<br />
load was set to 100%.<br />
In the second part of the experiment we varied the arrival frequencies of<br />
sporadic tasks accord<strong>in</strong>g to a factor, �, such that the separation between <strong>in</strong>-
Experiment 2: Firm aperiodic guarantee with sporadics 95<br />
stances �Ú�Ö���ÅÁÆÌ is equal to �Ú�Ö���ÅÁÆÌ � � £ ÅÁÆÌ. This<br />
means that if � � then the <strong>in</strong>stances are <strong>in</strong>voked with the maximum frequency,<br />
and if � � , the distance between two consecutive <strong>in</strong>vocations is<br />
£ ÅÁÆÌ on average.<br />
5.4.2 Results<br />
The results from the first part of the experimet experiment are summarized<br />
<strong>in</strong> figures 5.6 and 5.7, while the results from the second one are presented <strong>in</strong><br />
figures 5.8 and 5.9.<br />
We can see that our method improves the acceptance ratio of firm aperiodic<br />
tasks. This results from the fact that our methods reduce pesimism about<br />
sporadic arrivals by keep<strong>in</strong>g track of them.
96 Experiment 2: Firm aperiodic guarantee with sporadics<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Deadl<strong>in</strong>e=MAXT<br />
updated<br />
no <strong>in</strong>fo<br />
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0<br />
Comb<strong>in</strong>ed periodic, sporadic and aperiodic load<br />
Figure 5.6: Guarantee ratio for aperiodic tasks with sporadics, dl=MAX: load<br />
variation<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Deadl<strong>in</strong>e=2*MAXT<br />
updated<br />
no <strong>in</strong>fo<br />
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0<br />
Comb<strong>in</strong>ed periodic, sporadic and aperiodic load<br />
Figure 5.7: Guarantee ratio for aperiodic tasks with sporadics, dl=2*MAXT:<br />
load variation
Experiment 2: Firm aperiodic guarantee with sporadics 97<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Comb<strong>in</strong>ed load > 1<br />
Deadl<strong>in</strong>e=MAXT<br />
no <strong>in</strong>fo<br />
updated<br />
1 2 4 6 8<br />
M<strong>in</strong>imum <strong>in</strong>ter-arrival ffactor,<br />
Figure 5.8: Guarantee ratio for aperiodic tasks with sporadics, dl=MAXT: variation<br />
of MINT<br />
Guarantee ratio (%)<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Comb<strong>in</strong>ed load > 1<br />
Deadl<strong>in</strong>e=2*MAXT<br />
no <strong>in</strong>fo<br />
updated<br />
1 2 4 6 8<br />
M<strong>in</strong>imum <strong>in</strong>ter-arrival ffactor,<br />
Figure 5.9: Guarantee ratio for aperiodic tasks with sporadics, dl=2*MAXT:<br />
variation of MINT
98 Summary<br />
Guarantee ratio for aperiodic t<br />
100<br />
90<br />
80<br />
70<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
Deadl<strong>in</strong>e=2*MAXT<br />
updated<br />
no <strong>in</strong>fo<br />
no sporadics<br />
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0<br />
Comb<strong>in</strong>ed periodic, sporadic and aperiodic load<br />
Figure 5.10: Guarantee ratio for aperiodic tasks with sporadics - F<strong>in</strong>al results<br />
5.5 Summary<br />
In this report we have presented results of our algorithms to schedule sets of<br />
mixed types of tasks with complex constraits, by us<strong>in</strong>g earliest deadl<strong>in</strong>e first<br />
schedul<strong>in</strong>g and offl<strong>in</strong>e complexity reduction. In particular, we presented an<br />
algorithms to efficently handle sporadic tasks <strong>in</strong> order to <strong>in</strong>crease acceptance<br />
ratio for onl<strong>in</strong>e arriv<strong>in</strong>g firm aperiodic tasks. We have simulated the proposed<br />
guarantee algorithms and the results underl<strong>in</strong>es the effectiveness of the proposed<br />
approach. Figure 5.10 summarizes the simulation. We can see that guarantee<br />
ratio for firm aperiodic tasks is very high, even when we have sporadic<br />
tasks <strong>in</strong> the system. By keep<strong>in</strong>g track off sporadic arrivals, we can accept firm<br />
tasks that otherwise would be rejected.<br />
Future research will deal with the algorithm to <strong>in</strong>clude <strong>in</strong>terrupts, overload<br />
handl<strong>in</strong>g, and complex constra<strong>in</strong>ts for both firm aperiodic and sporadic tasks.
Bibliography<br />
[1] D. Isovic and G. Fohler. Onl<strong>in</strong>e handl<strong>in</strong>g of hard aperiodic tasks <strong>in</strong> <strong>time</strong><br />
triggered systems. In Proceed<strong>in</strong>gs of the 11th Euromicro Conference on<br />
<strong>Real</strong>-Time <strong>Systems</strong>, June 1999.<br />
[2] D. Isovic and Gerhard Fohler. Efficient schedul<strong>in</strong>g of sporadic, aperiodic,<br />
and periodic tasks with complex constra<strong>in</strong>ts. In Proceed<strong>in</strong>gs of the<br />
21st IEEE <strong>Real</strong>-Time <strong>Systems</strong> Symposium, Walt Disney World, Orlando,<br />
Florida, USA, November 2000.<br />
[3] G. Buttazzo, A. Casile, G. Lamastra, and G. Lipari. A schedul<strong>in</strong>g simulator<br />
for real-<strong>time</strong> distributed systems. In Proceed<strong>in</strong>gs of the IFAC Workshop on<br />
Distributed Computer Control <strong>Systems</strong> (DCCS ’98), 1999.
Index<br />
aperiodic task, 10, 22, 38<br />
acceptance test, 41, 56<br />
guarantee, 39, 41, 56, 57<br />
rejection strategy, 44<br />
complex constra<strong>in</strong>ts<br />
application specific, 11<br />
end-to-end deadl<strong>in</strong>es, 10<br />
jitter, 11<br />
non-periodic execution, 11<br />
non-temporal, 11<br />
precedence, 10<br />
synchronization, 10<br />
critical slot, 25<br />
deadl<strong>in</strong>e, 7, 8<br />
EDF, 9<br />
event-trigged systems, 9, 12, 38<br />
latest start-<strong>time</strong> methods, 12<br />
m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong>, 10<br />
periodic task, 9, 22<br />
real-<strong>time</strong> system<br />
event-trigged, 38<br />
<strong>time</strong>-trigged, 21, 38<br />
real-<strong>time</strong> systems, 7<br />
classification, 8<br />
distributed, 8<br />
event-trigged, 9<br />
hard, 8<br />
mixed, 8<br />
soft, 8<br />
<strong>time</strong>-trigged, 9<br />
schedule<br />
offl<strong>in</strong>e, 22<br />
schedul<strong>in</strong>g<br />
algorithm, 8<br />
algorithms<br />
EDF, 9<br />
dynamic, 8<br />
event-trigged, 9<br />
offl<strong>in</strong>e, 8<br />
onl<strong>in</strong>e, 8<br />
policy, 8<br />
pre-run<strong>time</strong>, 8<br />
resource <strong>in</strong>sufficient, 8<br />
resource sufficient, 8<br />
run<strong>time</strong>, 8<br />
static, 8<br />
<strong>time</strong>-trigged, 9<br />
slot, 15<br />
critical, 25<br />
def<strong>in</strong>ition, 22<br />
granularity, 22<br />
length, 22<br />
slot shift<strong>in</strong>g, 12, 23
INDEX 101<br />
<strong>in</strong>tervals, 23<br />
offl<strong>in</strong>e preparations, 23<br />
onl<strong>in</strong>e mechanism, 23, 29<br />
guarantee algorithm, 24<br />
onl<strong>in</strong>e schedul<strong>in</strong>g, 24<br />
spare capacity, 23<br />
spare capacity<br />
calculation, 23<br />
ma<strong>in</strong>tenance, 29<br />
sporadic<br />
event, 7<br />
m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong>, 21<br />
sporadic set, 24<br />
sporadic task, 10<br />
guarantee, 24<br />
handl<strong>in</strong>g, 58<br />
offl<strong>in</strong>e test, 28, 58<br />
onl<strong>in</strong>e algorithm, 62<br />
sporadic tasks, 22<br />
task, 8<br />
aperiodic, 10, 22, 38<br />
acceptance test, 41, 56<br />
guarantee, 39, 41, 56, 57<br />
guarantee algorithm, 42<br />
rejection strategy, 44<br />
constra<strong>in</strong>ts<br />
complex, 10<br />
simple, 10<br />
deadl<strong>in</strong>e, 23<br />
dynamic, 9<br />
firm, 10<br />
hard, 8, 9<br />
<strong>in</strong>stance, 9<br />
model, 9<br />
periodic, 9, 22<br />
pseudo-periodic, 13, 21, 58<br />
soft, 8<br />
sporadic, 10, 22<br />
frequency, 10<br />
guarantee, 24<br />
handl<strong>in</strong>g, 58<br />
m<strong>in</strong>imum <strong>in</strong>ter-arrival <strong>time</strong>,<br />
10<br />
offl<strong>in</strong>e test, 28, 58<br />
onl<strong>in</strong>e algorithm, 62<br />
start <strong>time</strong>, 23<br />
static, 9<br />
<strong>time</strong> model, 22<br />
<strong>time</strong>-trigged systems, 9, 12, 38