In-kernel servers on Mach 3.0 Implementation and p

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

In-KernelServersonMach3.0:ImplementationandPerformanceJayLepreauMikeHiblerBryanFordJereyLawCenterforSoftwareScienceDepartmentofComputerScienceUniversityofUtahSaltLakeCity,UT84112E-mail:flepreau,mike,baford,lawg@cs.utah.eduAbstractTheadvantagesinmodularityandpowerofmicrokernel-basedoperatingsystemssuchasMach3.0arewellknown.Theexistingperformanceproblemsofthesesystems,however,aresignicant.Muchoftheperformancedegradationisduetothecostofmaintainingseparateprotectiondomains,traversingsoftwarelayers,andusingasemanticallyrichinter-processcom-municationmechanism.Anapproachthatoptimizesthecommoncaseistopermitmergingofprotectiondomainsinperformancecriticalapplications,whilemaintainingprotectionbound-ariesfordebuggingorinsituationsthatdemandrobustness.Inoursystem,clientcallstotheserverareeectivelyboundeithertoasimplesystemcallinterface,ortoafullRPCmechanism,dependingontheserver’slocation.Theoptimizationreducesargumentcopies,aswellasworkdoneinthecontrolpathtohandlecomplexandinfrequentlyencounteredmessagetypes.InthispaperwepresentageneralmethodofdoingthisforMach3.0andtheresultsofapplyingittotheMachmicrokernelandtheOSF/1singleserver.Wedescribethenecessarymodicationstothekernel,thesingleserver,andtheRPCstubgenerator.Semanticequivalence,backwardscompatibility,andcommonsourceandbinarycodearepreserved.Performanceonmicroandmacrobenchmarksisreported,withRPCperformanceimprovingbyafactorofthree,Unixsystemcallstotheserverimprovingbetween20%andafactoroftwo,and4{13%performancegainonlargebenchmarks.AbreakdownofthetimesontheRPCpathisalsopresented.11IntroductionThemodularityofmicrokernel-basedoperatingsystems(OS’s)providesthemwell-knownben-ets.Thesebenetsincludeimproveddebuggingfacilitiesandsoftwareengineeringimprovementswhichresultfromahigherdegreeofsystemstructuring.Theuseofseparateprotectiondomainstoimplementsystemsontopofamicrokernelprovidesrobustness;theabilitytocomposeserverstoexhibitdierentOS\personalitiesoersexibility.Inaddition,microkernelsexportpowerfulabstractionswhichareusefulforbuildingdistributedsystemsandmulticomputerOS’s.However,thismodularityandpowerhascomeatsomecost.Becausethemodularityisstrictlyatthetasklevelandtaskscommunicateviaapowerfulbut\heavyinterprocesscommunication(IPC)mechanism2,allinter-taskinteractionsareexpensive.Theexpensiveinter-taskoperationsincludethecommoncaseofuntrustedclientscallingtrustedserversonthesamemachine,passingsmallamountsofdatabackandforth.1ThisresearchwassponsoredbytheHewlett-PackardResearchGrantsProgram.2Althoughtaskscancommunicatethroughsharedmemory,muchinter-taskinteractionishandledviaremoteprocedurecalls(RPCs).AfewcommonI/Ooperations,suchasUnixread,areoftenimplementedwithsharedmemoryandcanbereasonablyfast.AlthoughtheMach3.0[1,8]microkernelhasshownisolatedinstancesofperformancecomparabletothatofmacrokernelsystems[5],thishasnotbeenobservedingeneral.Manysoftwarelayersandsomehardwareboundariesmustbetraversedevenforthemosttrivialinteractionsbetweentasks.AllmessagesexercisemuchoftheIPCmechanism,eventhoughcommonservers,suchastheUnixserver,useonlyasmallsubsetofitscapabilities.Theconclusionisthatforinter-taskcalls,Machhasfailedtooptimizethecommoncase.InstrumentationoftheMachIPCpathontheHewlett-PackardPA-RISChasshownthatatleastonthisplatform,thetraditional\contextswitchfromoneaddressspacetoanotherisonlyaminorcomponentofsame-machineMachRPCcosts.Asdetailedlater,mostofthecostisinkernelentryandexitcode,datacopiesintheMIG-generatedstubroutines,andinportshuingandrelatedcode.Wehavelargelyeliminatedthelasttwocostsinthecommoncase.Tooptimizethecommoncase,wehaveconstructedaseparatelylinkedOSF/1serverimage(referredtoasthein-kernelserverorINKS)thatcanbeloadedintothekernelprotectiondomainatruntime.WedynamicallyreplaceheavyweightIPC-basedcommunicationmechanismswithlighter-weighttrapandprocedurecallmechanismswherepossible.WehaveextendedtheRPCstubgeneratortoproducespecialstubswhichenactthesenewmechanisms.Sincethechangeofcommunicationmechanismisessentiallyachangeinprocedurebinding,thepresenceorabsenceofthesemechanismsistransparenttoclients.Intherestofthispaperwediscussthegoals,constraints,anddesigninSection2,giveim-plementationdetailsinSection3,andgivestatusandperformanceresultsinSection4,includingbreakdownoftheRPCpath,microbenchmarks,andmacrobenchmarks.Finally,weexaminerelatedwork,discussplannedandpossiblefuturework,andgiveourconclusions.2Design2.1GoalsOurgoalswereve-fold.Mostimportantly,wewantedtoimprovetheperformanceofsystemsbasedonMach|boththoseimplementingUnixandmorespecializedsystems,suchasnetworkprotocolservers.Nearlyasimportant,wesoughttobeascompatibleaspossible,aselaboratedbelow.Wewantedtomaketherequiredsystemtransformationsacceptable,byimposingminimalconstraintsonMachprogramstructure.Wewantedtoexploretheissuesinvolved,andnally,wewantedasamplesystemasatargetforamoredynamicbindingmechanism,basedonanobjectserverwehaveimplemented[9,10].2.2CompatibilityConstraintsTomaintaincompatibility,weimposedanumberofconstraintsonthedesign:Thesourceforin-andout-of-kernelserversmustbeidentical,withlittleus

1 / 17
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功