ebook img

Scheduling and locking in multiprocessor real-time operating systems PDF

615 Pages·2011·3.395 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Scheduling and locking in multiprocessor real-time operating systems

SCHEDULING AND LOCKING IN MULTIPROCESSOR REAL-TIME OPERATING SYSTEMS Bjo¨rnB.Brandenburg A dissertation submitted to the faculty of the University of North Carolina at Chapel Hill in partial fulfillment of the requirements for the degree of Doctor of Philosophy in the DepartmentofComputerScience. ChapelHill 2011 Approvedby: JamesH.Anderson SanjoyK.Baruah HermannHa¨rtig JanF.Prins F.DonelsonSmith PaulE.McKenney UMI Number: 3502550 All rights reserved INFORMATION TO ALL USERS The quality of this reproduction is dependent on the quality of the copy submitted. In the unlikely event that the author did not send a complete manuscript and there are missing pages, these will be noted. Also, if material had to be removed, a note will indicate the deletion. UMI 3502550 Copyright 2012 by ProQuest LLC. All rights reserved. This edition of the work is protected against unauthorized copying under Title 17, United States Code. ProQuest LLC. 789 East Eisenhower Parkway P.O. Box 1346 Ann Arbor, MI 48106 - 1346 ©2011 Bjo¨rnB.Brandenburg ALLRIGHTSRESERVED ii ABSTRACT BJO¨RNB.BRANDENBURG:SchedulingandLockinginMultiprocessorReal-TimeOperating Systems (UnderthedirectionofJamesH.Anderson) Withthewidespreadadoptionofmulticorearchitectures,multiprocessorsarenowastandard deployment platform for (soft) real-time applications. This dissertation addresses two questions fundamentaltothedesignofmulticore-readyreal-timeoperatingsystems: (1)Whichscheduling policies offer the greatest flexibility in satisfying temporal constraints; and (2) which locking algorithmsshouldbeusedtoavoidunpredictabledelays? RT WithregardtoQuestion1,LITMUS ,areal-timeextensionoftheLinuxkernel,ispresented RT and its design is discussed in detail. Notably, LITMUS implements link-based scheduling, a novelapproachtocontrollingblockingduetonon-preemptivesections. Eachimplementedscheduler (22configurationsintotal)isevaluatedunderconsiderationofoverheadsona24-coreIntelXeon platform. Theexperimentsshowthatpartitionedearliest-deadlinefirst(EDF)schedulingisgenerally preferableinahardreal-timesetting,whereasglobalandclusteredEDFschedulingareeffectiveina softreal-timesetting. WithregardtoQuestion2,real-timelockingprotocolsarerequiredtoensurethatthemaximum delay due to priority inversion can be bounded a priori. Several spinlock- and semaphore-based multiprocessorreal-timelockingprotocolsformutualexclusion(mutex),reader-writer(RW)exclu- sion,andk-exclusionareproposedandanalyzed. AnewcategoryofRWlockssuitedtoworst-case analysis,termedphase-fairlocks,isproposedandthreeefficientphase-fairspinlockimplementations are provided (one with few atomic operations, one with low space requirements, and one with constantRMRcomplexity). Maximumpriority-inversionblockingisproposedasanaturalcomplexitymeasureforsemaphore protocols. It is shown that there are two classes of schedulability analysis, namely suspension- obliviousandsuspension-awareanalysis,thatyieldtwodifferentlowerboundsonblocking. Five iii asymptoticallyoptimallockingprotocolsaredesignedandanalyzed: afamilyofmutex,RW,and k-exclusion protocols for global, partitioned, and clustered scheduling that are asymptotically optimal in the suspension-oblivious case, and a mutex protocol for partitioned scheduling that is RT asymptoticallyoptimalinthesuspension-awarecase. ALITMUS -basedempiricalevaluationis presentedthatshowstheseprotocolstobepractical. iv Tomyparents,HaraldandPetra. v ACKNOWLEDGEMENTS Iamindebtedtomanypeoplewhofirsthelpedmetogetintograduateschool,andthenhelped metogetoutagain. Firstofall,Iwouldliketothankmyadvisor,JimAnderson,forhisunwavering support, and my committee, Sanjoy Baruah, Hermann Ha¨rtig, Jan Prins, Don Smith, and Paul McKenney,fortheirguidanceandadvice. Iwouldalsoliketoexpressmythanksandappreciationto allmyco-authors,AaronBlock,HennadiyLeontyev,JohnCalandrino,UmaDevi,MacMollison, ChrisKenna,AndreaBastoni,JonathanHermann,andAlexMills,andthestudentsinthereal-time systems group that I sadly did not have a chance to write a paper with, Cong Liu, Glenn Elliott, GuruprasadAphale,JeremyErickson,HaohanLi,BipasaChattopadhyay,andChih-HaoSun,for theirhelpandfeedback. ManythanksalsotothefriendlyCSdepartmentstaff,andinparticularJodie Turnbull,JohnSopko,MurrayAnderegg,andMikeStone,whohelpedmeinmanylargeandsmall waysovertheyears. IamgratefultotheGerman-AmericanFulbrightProgramandtheGraduateSchool’sDisserta- tionCompletionFellowshipforfinancialsupportduringmyfirstandlastyearingraduateschool, respectively. WithoutFulbright’ssupport,IprobablywouldnothaveattendedanAmericangraduate school. SpecialthanksarealsoduetoJanPrins, forquicklyun-rejectingmyapplicationtoUNC afteritendeduponthewrongpileduetoa“processingmishap.” LifeinSittersonHallandBrooksBuildingwouldnothavebeenmuchfunwithoutmyfriendsin theCSdepartment: AaronBlock,SasaJunuzovic,JayAikat,SeanCurtis,StephenOlivier,Keith Lee,JamieSnape,SrinivasKrishnan,AnishChandak,JeffTerrell,StephenGuy—thanky’allfora greattimeinNorthCarolina! Outsideschool,IamgreatlyindebtedtoJasperMcChesney. Iwasveryluckytomeetyouby chanceintheroommatelotteryandhavegreatlyenjoyedyourcompany—thankyouverymuchfor themanyinterestingdiscussions,hikingtrips,andwonderfultimesofadvancednerdery. Inasimilar vein,IwouldalsoliketothankDotHallforhercompassion,energy,andtheoccasionalcrazyidea. ToobadthatweoverlappedinChapelHillforonlyashorttime. vi Very special thanks to Aaron and Nicki Block for their unrelenting support and mentorship. Whenever I needed help or guidance, I knew I could count on you. You taught me a lot about American culture; without you my stay in the U.S. would have been only half as interesting and fun. Thankyouverymuchforyourgenerosityandfriendship. Onedaywewillfinishthatbikeride aroundBerlin! AnothercolleagueandfriendthatdeservesspecialmentionisAndreaBastoni,whowasavisiting scholarwithUNC’sreal-timegroupfromOctober2009untilOctober2010. Thanksalotforallthe funwehadinsideandoutsideofthedepartment,forthepaperswewrote,andforyourcontributions RT toLITMUS . Youcameatexactlytherighttime;unfortunatelyyouhadtoleaveagainafteronlya RT year. ThanksforstayinginvolvedwithLITMUS anyway. Foremost, I thank my parents Harald and Petra for their unwavering support, understanding, andencouragement,bothduringgraduateschoolandtheyearsbefore. Adefiningeventinmylife wasthehighschoolexchangethatbroughtmetoMayfieldHighSchoolinLasCruces,NMduring junioryear. InLasCruces,Idevelopedambitionandtenacity,withoutwhichthisdissertationwould nothavebeenpossible. ForthisIwouldliketothankmyformerhostparentsBarbaraandGeorge Stafford,whooutofthekindnessoftheirheartsopenedtheirdoortoanunknownteenager. Finally,IamdeeplythankfultoNora,foralltheloveandsupport,forherpatience,forfollowing mehalfwayaroundtheworldtoNorthCarolina,andforhertrustthatthiswasindeedtherightway. I couldnothavefinishedthiswithoutyou. vii TABLE OF CONTENTS LISTOFTABLES ........................................................................ xvi LISTOFFIGURES .......................................................................xvii LISTOFABBREVIATIONS ..............................................................xxiii 1 INTRODUCTION..................................................................... 1 1.1 TheCostofOver-Provisioning.................................................... 2 1.2 TheDivergenceofTheoryandPractice............................................ 3 1.2.1 Background .............................................................. 3 1.2.2 MultiprocessorReal-TimeScheduling ..................................... 6 1.2.3 Real-TimeLocking....................................................... 9 1.3 ThesisStatement................................................................. 10 1.4 Contributions .................................................................... 11 RT 1.4.1 LITMUS .............................................................. 11 1.4.2 ComprehensiveOverheadAccounting ..................................... 12 1.4.3 Overhead-AwareEvaluationMethodology ................................. 13 1.4.4 CaseStudy: MultiprocessorReal-timeSchedulingon24Cores ............. 14 1.4.5 Spin-BasedLockingProtocols ............................................ 14 1.4.6 EfficientPhase-FairSpinlockImplementations............................. 16 1.4.7 ANotionofOptimalityforSuspension-BasedLockingProtocols ........... 17 1.4.8 OptimalSuspension-BasedMultiprocessorLockingProtocols .............. 18 1.4.9 CaseStudy: TheImpactofOverheadsonLockingProtocols................ 19 1.5 Organization..................................................................... 20 viii 2 BACKGROUNDANDPRIORWORK................................................. 21 2.1 HardwareFoundations............................................................ 21 2.1.1 MultiprocessorsandMulticorePlatforms .................................. 21 2.1.2 ProcessorCaches......................................................... 25 2.1.3 Interrupts ................................................................ 34 2.1.4 TimersandClocks........................................................ 37 2.2 Real-TimeTaskModelandConstraints............................................ 41 2.2.1 TemporalCorrectness..................................................... 45 2.2.2 AlternateSoftReal-TimeDefinitions ...................................... 47 2.2.3 SchedulabilityAnalysisConcepts ......................................... 52 2.3 Real-TimeScheduling............................................................ 56 2.3.1 UniprocessorReal-TimeScheduling....................................... 58 2.3.1.1 Fixed-PriorityScheduling....................................... 58 2.3.1.2 Job-LevelFixed-PriorityScheduling............................. 62 2.3.2 PartitionedMultiprocessorReal-TimeScheduling.......................... 64 2.3.3 GlobalMultiprocessorReal-TimeScheduling.............................. 70 2.3.3.1 GlobalFixed-PriorityScheduling................................ 71 2.3.3.2 GlobalJob-LevelFixed-PriorityScheduling...................... 73 2.3.3.3 GlobalJob-LevelDynamic-PriorityScheduling .................. 86 2.3.4 ClusteredMultiprocessorReal-TimeScheduling ........................... 99 2.4 Real-TimeLockingProtocols..................................................... 101 2.4.1 ResourceModel..........................................................103 2.4.2 PriorityInversionBlocking ............................................... 107 2.4.3 UniprocessorReal-TimeLockingProtocols................................109 2.4.4 MultiprocessorReal-TimeLockingProtocols ..............................119 2.4.4.1 SpinlockProtocols..............................................120 2.4.4.2 SemaphoreProtocols ...........................................124 2.4.5 FurtherResultsinReal-TimeLocking .....................................134 ix

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.