Hard Real-Time Computing Systems Real-Time Systems Series Series Editor JohnA. Stankovic UniversityofVirginia,Virginia,USA Forfurthervolumes: http://www.springer.com/series/6941 Giorgio C. Buttazzo Hard Real-Time Computing Systems Predictable Scheduling Algorithms and Applications Third Edition Giorgio C. Buttazzo RETIS Lab Scuola Superiore Sant’Anna Pisa Italy [email protected] ISSN 1867-321X e-ISSN 1867-3228 ISBN 978-1-4614-0675-4 e-ISBN 978-1-4614-0676-1 DOI 10 .1007/978-1-4614-0676-1 Springer New York Dordrecht Heidelberg London Library of Congress Control Number: 2011937234 © Springer Science(cid:0) +Business Media, LLC 2011 All rights reserved. This work may not be translated or copied in whole or in part without the written permission of the publisher (Springer Science+Business Media, LLC, 233 Spring Street, New York, NY 10013, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed is forbidden. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. Printedonacid-freepaper Springer is part of Springer Science+Business Media (www.springer.com) CONTENTS Preface ix 1 A GENERAL VIEW 1 1.1 Introduction 1 1.2 Whatdoesrealtimemean? 4 1.3 Achievingpredictability 13 2 BASIC CONCEPTS 23 2.1 Introduction 23 2.2 Typesoftaskconstraints 25 2.3 Definitionofschedulingproblems 34 2.4 Schedulinganomalies 42 3 APERIODIC TASK SCHEDULING 53 3.1 Introduction 53 3.2 Jackson’salgorithm 54 3.3 Horn’salgorithm 58 3.4 Non-preemptivescheduling 63 3.5 Schedulingwithprecedenceconstraints 70 3.6 Summary 76 4 PERIODIC TASK SCHEDULING 79 4.1 Introduction 79 4.2 Timelinescheduling 84 4.3 RateMonotonicscheduling 86 4.4 EarliestDeadlineFirst 100 4.5 DeadlineMonotonic 103 4.6 EDFwithconstraineddeadlines 110 4.7 ComparisonbetweenRMandEDF 116 v vi Contents 5 FIXED-PRIORITY SERVERS 119 5.1 Introduction 119 5.2 Backgroundscheduling 120 5.3 PollingServer 121 5.4 DeferrableServer 130 5.5 PriorityExchange 139 5.6 SporadicServer 143 5.7 Slackstealing 149 5.8 Non-existenceofoptimalservers 153 5.9 Performanceevaluation 155 5.10 Summary 157 6 DYNAMIC PRIORITY SERVERS 161 6.1 Introduction 161 6.2 DynamicPriorityExchangeServer 162 6.3 DynamicSporadicServer 167 6.4 TotalBandwidthServer 171 6.5 EarliestDeadlineLateServer 174 6.6 ImprovedPriorityExchangeServer 178 6.7 ImprovingTBS 181 6.8 Performanceevaluation 185 6.9 TheConstantBandwidthServer 189 6.10 Summary 201 7 RESOURCE ACCESS PROTOCOLS 205 7.1 Introduction 205 7.2 Thepriorityinversionphenomenon 206 7.3 Terminologyandassumptions 209 7.4 Non-PreemptiveProtocol 210 7.5 HighestLockerPriorityProtocol 212 7.6 PriorityInheritanceProtocol 214 7.7 PriorityCeilingProtocol 226 7.8 StackResourcePolicy 234 7.9 Schedulabilityanalysis 246 7.10 Summary 247 Contents vii 8 LIMITED PREEMPTIVE SCHEDULING 251 8.1 Introduction 251 8.2 Non-preemptivescheduling 257 8.3 Preemptionthresholds 261 8.4 DeferredPreemptions 266 8.5 Tasksplitting 270 8.6 Selectingpreemptionpoints 274 8.7 Assessmentoftheapproaches 279 9 HANDLING OVERLOAD CONDITIONS 287 9.1 Introduction 287 9.2 Handlingaperiodicoverloads 293 9.3 Handlingoverruns 316 9.4 Handlingpermanentoverloads 326 10 KERNEL DESIGN ISSUES 349 10.1 Structureofareal-timekernel 349 10.2 Processstates 351 10.3 Datastructures 356 10.4 Miscellaneous 361 10.5 Kernelprimitives 366 10.6 Intertaskcommunicationmechanisms 385 10.7 Systemoverhead 392 11 APPLICATION DESIGN ISSUES 397 11.1 Introduction 398 11.2 Timeconstraintsdefinition 401 11.3 Hierarchicaldesign 408 11.4 Arobotcontrolexample 413 12 REAL-TIME OPERATING SYSTEMS AND STANDARDS 419 12.1 Standardsforreal-timeoperatingsystems 419 12.2 Commercialreal-timesystems 428 12.3 Linuxrelatedreal-timekernels 432 12.4 Open-sourcereal-timeresearchkernels 437 12.5 DevelopmentTools 452 viii Contents 13 SOLUTIONS TO THE EXERCISES 457 GLOSSARY 487 REFERENCES 497 INDEX 515 PREFACE Real-time computingplays a crucial role in our society since an increasing number of complex systems rely, in part or completely, on computer control. Examples of applications that require real-time computing include nuclear power plants, railway switchingsystems,automotiveandavionicsystems,airtrafficcontrol,telecommuni- cations,robotics,andmilitarysystems. Inthelastseveralyears,real-timecomputing has beenrequiredin newapplicationsareas, suchas medical equipments,consumer electronics,multimediasystems,flightsimulationsystems,virtualreality,andinterac- tivegames. Despitethis largeapplicationdomain,mostofthecurrentreal-timesystemsarestill designed and implemented using low-level programming and empirical techniques, without the support of a scientific methodology. This approach results in a lack of reliability,whichincriticalapplicationsmaycauseseriousenvironmentaldamageor evenlossoflife. Thisbookisabasictreatiseonreal-timecomputing,withparticularemphasisonpre- dictableschedulingalgorithms. Themainobjectivesofthebookaretointroducethe basic concepts of real-time computing, illustrate the most significant results in the field, andprovidethebasic methodologiesfordesigningpredictablecomputingsys- temsusefulinsupportingcriticalcontrolapplications. Thisbookiswrittenforinstructionaluseandisorganizedtoenablereaderswithouta strongknowledgeofthesubjectmattertoquicklygraspthematerial. Technicalcon- ceptsareclearlydefinedatthebeginningofeachchapter,andalgorithmdescriptions arecorroboratedthroughconcreteexamples,illustrations,andtables. ix
Description: