教育资源为主的文档平台

当前位置: 查字典文档网> 所有文档分类> 高等教育> 理学> Java外文资料

Java外文资料

上传者:郭媛妮
|
上传时间:2015-04-15
|
次下载

Java外文资料

Java毕业设计外文翻译资料

SableSpMT:ASoftwareFrameworkforAnalysingSpeculative

MultithreadinginJava

ChristopherJ.F.Pickett

ClarkVerbrugge

SchoolofComputerScience,McGillUniversity

Montr´eal,Qu´ebec,CanadaH3A2A7

{cpicke,clump}@sable.mcgill.ca

Speculativemultithreading(SpMT)isapromisingoptimisationtech-niqueforachievingfasterexecutionofsequentialprogramsonmultipro-cessorhardware.Analysisofanddataacquisitionfromsuchsystemsis

howeverdif?cultandcomplex,andistypicallylimitedtoaspeci?chard-waredesignandsimulationenvironment.Wehaveimplementeda?exible,software-basedspeculativemultithreadingarchitecturewithinthecontextofafull-featuredJavavirtualmachine.WeconsidertheentireJavalanguageandprovideacompletesetofsupportfeaturesforspeculativeexecution,http://wendang.chazidian.comingoursystemweareabletogener-ateextensivedynamicanalysisinformation,analysetheeffectsofruntimefeedback,anddeterminetheimpactofincorporatingstatic,of?ineinforma-tion.OurapproachallowsforaccurateanalysisofJavaSpMTonexisting,commoditymultiprocessorhardware,andprovidesavehicleforfurtherex-perimentationwithspeculativeapproachesandoptimisations.

KeywordsJava,virtualmachines,speculativemultithreading,threadlevelspeculation,pro?ling,staticanddynamicanalysis.

1.Introduction

Speculativemultithreading(SpMT),alsoknownasthreadlevelspeculation(TLS),isapromisingtechniquefordynamicparal-lelisationofsequentialprograms.Ithasbeeninvestigatedthroughmanyhardwareproposalsandsimulations[2,4,5,8,11,14,16,17,20,21,24,25,30,31,34,35,36,37,39,41],andasmallerbutnotinsigni?cantnumberofsoftwaredesigns[3,6,18,19,26,27,28,32,40,42],eachofferingitsownanalysisofvariousimplemen-tationandoptimisationtechniques.However,itisdif?culttoeval-uatetheseproposalswithrespecttoandincombinationwitheachother,astherearemultiplesourcelanguages,threadpartitioningschemes,SpMTcompilers,andhardwaresimulatorsbeingused.Evenifthesevariablesremain?xed,itishighlyunlikelythatanidenticalsoftwarearchitectureand/orsetofsimulationparameterswillbeused.

WepresentSableSpMTasacommonframeworkandsolutiontotheseproblems,asanextensionoftheSableVMJavavirtualma-chine[13].SableSpMTprovidesaconvenienthardwareabstrac-tionlayerbyoperatingatthebytecodeinstructionlevel,takesthefullJavalanguageandVMspeci?cationintoaccount,supports

staticanalysisthroughtheSootbytecodecompilerframework[38]andparsingofJavaclass?leattributes[29],andworksonexistingmultiprocessorsystems.SableSpMTprovidesafullsetofSpMTsupportfeatures,includinggenericspeculativemethodlevelpar-allelism(SMLP)andreturnvalueprediction(RVP).OurworkisdesignedtofacilitateSpMTresearch,andincludesauniquedebug-gingmode,logging,andportabilityamongstthefeaturesthatmakeitappropriateforexperimentationandnewdesigns.

WereportonbothJavabenchmarkandframeworkbehaviourtoillustratetheformsofexperimentalanddesignanalysiswesupport.Throughdynamicmeasurementsweshowthatwhilespeculativecoverage,thepercentageofsequentialprogramexecutionthatoc-curssuccessfullyinparallel,canbequitehighinJavaprograms,theoverheadcostsaresigni?cantenoughinourinitialimplementationtoprecludeactualspeedup.However,weareabletoperformex-perimentstodetermineupperboundsonspeedupintheabsenceofalloverhead,andourexecutiontimesarestillbetterthanthoseof-feredbyhardwaresimulatorsprovidingsimilarfunctionality[20].WealsobreakdowntheSpMToverheadcoststodetermineper-formancebottlenecksandsetoptimisationgoals.Inourcaseover-headisdominatedbyveri?cationofspeculativethreadsandtheconcomitantinterprocessormemorytraf?c,lockandbarriersyn-chronization,andupdatecostsforreturnvalueprediction(RVP),aruntimeoptimisationtechniquethatcanimproveSMLPperfor-mancebyupto2-fold[16].WithregardstoRVP,resultsgatheredwithinourframeworkextendpreviousstudiestoincludemorere-alisticbenchmarkruns,offerfurtherdataontherelativebene?ts,requirementsandcostsofvariouspredictionstrategies,andexposethepotentialbene?tsofexploitingbothstaticandruntimefeedbackoptimisationinformation.

Hardwaresimulationshavealreadydemonstratedthegreatpo-tentialinspeculativemultithreading.Wecontendthatthesametechniques,however,canbeinvestigatedmoregenerallyandef-?cientlyatthevirtualmachinelevelusingcommoditymultipro-cessorhardware,givenanappropriateanalysisframework.Virtualmachinesallowforexplorationofcomplexdesignchanges,facil-itatedetailedinstrumentation,providehighlevelinformationthatisnotgenerallyavailabletohardwareapproaches,andareabletointeractdirectlywiththeunderlyingarchitecture.Ourworkisin-tendedtoenableSpMTinvestigationsbyprovidinganexecutionandanalysisenvironment,ageneraldesignandcomponentry,andrealdatafromaworkingimplementation.1.1Contributions

Wemakethefollowingspeci?ccontributions:

?WedescribeSableSpMT,acompleteimplementationofSpMTforJavathatrunsonrealmultiprocessorhardware,andpresentitssuitabilityasananalysisframework.Thisisthe?rstcom-pletesuchworkwithinavirtualmachine.

Permissiontomakedigitalorhardcopiesofallorpartofthisworkforpersonalorclassroomuseisgrantedwithoutfeeprovidedthatcopiesarenotmadeordistributedforpro?torcommercialadvantageandthatcopiesbearthisnoticeandthefullcitationonthe?rstpage.Tocopyotherwise,torepublish,topostonserversortoredistributetolists,requirespriorspeci?cpermissionand/orafee.PASTE’05September5–6,2005,Lisbon,Portugal.

c2005ACM1-59593-239-9/05/0009...$5.00.Copyright??

59

Java毕业设计外文翻译资料

?WesimplifytheimplementationandanalysisofnewSpMTde-signsbyprovidingadeterministic,single-threadeduniproces-sormode,aswellasloggingfacilities,statisticsgathering,andfullJVMsupport.

?Wedemonstratethathighlevelanalysisinformationcanbeeas-ilyexploitedbyourframework.Ahead-of-timeresultscom-putedbySootaswellasruntimepro?ling-basedfeedbackcanpassedtoourexecutionenginetoimproveperformance,andweillustratethetechniqueusingourworkonRVP.

?Weprovidedetaileddataonthespeculativeexecutionofnon-trivialprograms,whichincludeabreakdownofoverheadcosts,theimpactofhighlyaccurateRVP,twodifferentmeasurementsofdynamicparallelism,andoverallrunningtimes.

InSection2wediscussrelatedworkontheanalysisofspecu-lativemultithreading.InSection3wedescribethegeneralSpMTmodelwehaveusedandgiveanoverviewofhowourframeworkisconstructedanditsmainfeatures.ThisincludesanexpositionofthecomponentsrequiredforJavaSpMT,ourmultithreadedexe-cutionandsingle-threadeddebuggingmodes,systemcon?gurationoptions,andthedataloggingandtracegenerationfeatures.InSec-tion4weanalyseactualdataandshowthe?exibilityofoursystemintermsofdatagathering.Finally,wediscussfutureworkandcon-cludeinSection5.

LiljathroughmanualJavasourcetransformations[18];similarlyWelcetal.demonstrategoodspeedupofloopsineasilyparallelis-ablebenchmarks,throughapplicationofsafefuturesforJava[40],sourcelevelannotationsthatprovideSpMT-likefunctionalityanddependonVMsupportforparallelisation.Opposingly,WargandStenstr¨omarguethatJava-basedSpMThasinherentlyhighover-headcostswhichcanonlybeaddressedthroughhardwaresup-port[39].Ourdataandanalysisaresigni?cantlymorecomprehen-sivethanpriorstudies,andsuggestthatwhileoverheadscanbequitehigh,thereissuf?cientpotentialparallelismtooffsetthecost.Wehaveanalysedreturnvaluepredictionaspartofourinvesti-gationintoSpMTbehaviour.ValuepredictionforSpMThasbeenexploredbyseveralgroups[4,8,25],andisgenerallywell-studied.Thespeci?cutilityofreturnvaluepredictionformethodlevelspec-ulationinJavawasshownbyHuetal.[16],withfurtherpredictionaccuracyinvestigatedbytheauthors[26,27];ourvaluepredictionapproachhereisbasedonthesedesigns.

3.Framework

Webeginwithanoverviewofourframework,followedbyabriefexpositionofourspeculativeexecutionmodel,andsomeofthefea-turesofourframeworkthathelpwithimplementationanddebug-gingofsuchacomplex

内容需要下载文档才能查看

undertaking.

2.RelatedWork

Speculativemultithreadingapproacheshavebeendevelopedpri-marilyinthecontextofnovelhardwareenvironments.AnumberofgeneralpurposespeculativearchitecturessuchastheMultiscalararchitecture[11],theSuperthreadedarchitecture[37],MAJC[36],Hydra[14],andseveralotherdesigns[21,34]havebeenproposed,andsimulationstudieshavegenerallyshownquitegoodpotentialspeedups.Steffanetal.givearecentimplementationandgoodoverviewofthestateoftheartin[35].

Fromthespeculativehardwarelevel,anexecutingJavavir-tualmachinedoesnothavedistinguishedperformanceincom-parisonwithotherapplications[39].Asaninterpretedlanguage,however,Javacanprovidehigherlevelabstractionsandinforma-tionthangenericmachinecode.Highlevelprograminformationisusedinafewhybridsoftware/hardwarestudies,includingChenandOlukotun’sthreadlevelspeculationsystemforJava[5].Javatracesappliedtosimulatedarchitectureshavebeenusedbyseveralresearchers,includingHuetal.intheirstudyoftheimpactofre-turnvalueprediction[16],andWhaleyandKozyrakis’recentstudyofheuristicsformethodlevelspeculation[41].

SoftwarearchitecturesforSpMTarelesscommon.RundbergandStenstr¨omdescribeasoftwareapproachtospeculationinC[32].Theirprototypeimplementationshowsgoodspeedup,butisveri?edonlythroughhanddonetransformationsandgreatlylim-itedrealworldtesting.KaziandLiljadescribeasoftwarelibraryforcoarse-grainedthreadpipelining[19],demonstratedthroughman-ualparallelisationofloopsinCprograms.The“Softspec”softwarespeculationenvironment[3]concentratespurelyonloop-basedspeculation.Theapproachdependsonmachinecodelevelruntimepro?lingtoidentifyindependentloopbodiessuitableforspecula-tiveexecution.CintraandLlanoshavedevelopedaFORTRAN-basedsystemthatalsospeculatesonloopbodies[6].Theseap-proachesallachievegoodperformanceresults,butnonearebasedonJavaordesignedspeci?callyasexperimentalframeworks.

OnlyverylimitedstudiesonlanguagelevelspeculationforJavahavebeendonepreviously.Yoshizoeetal.giveresultsfromapartiallyhand-donelooplevelspeculationstrategyimplementedinarudimentary(e.g.,noGC)prototypeVM[42].Theyshowgoodspeedupforsimplesituations,butlackofheapanalysislim-itstheirresults.AmoreconvincinganalysisisgivenbyKaziand

TheoverallSableSpMTexecutionenvironmentisshowninFigure1.SableVMpreparesspecialspeculativeandnormalnon-speculativeversionsofmethodsatruntimefromdynamicallyloadedclasses,whicharereadinfromJava.class?les.Soot[38]isusedtotransform,analyse,andattachattributestotheseclassesinanahead-of-timestep[29],althoughthiscouldalsooccuratrun-time.Twoexecutionmodesareprovided,asingle-threaded“sim-ulation”modeandatruemultithreadedmode,bothofwhichcanexploitareturnvaluepredictionframework.ThemultithreadedmodesplitssingleJavathreadsacrossmultipleprocessorsonanSMPmachine.

3.1SpeculativeMethodLevelParallelism

ThreadsarecreatedusingtheSpMTvariantknownasspecula-tivemethodlevelparallelism(SMLP)[4,5,16,39,41],depictedinFigure2.Ordinarysequentialbytecodeexecutionisshownin

60

Java毕业设计外文翻译资料

内容需要下载文档才能查看 内容需要下载文档才能查看 内容需要下载文档才能查看 内容需要下载文档才能查看 内容需要下载文档才能查看

Figure2.SequentialandSMLP-basedbytecodeexecution.Figure2a,wherethetargetmethodofanINVOKE<X>instructionexecutesbeforetheinstructionsfollowingthereturnpoint.Specu-lativeSMLP-basedexecutionisshowninFigure2b.Uponreach-ingamethodcallsite,thenon-speculativeparentthreadT1forksaspeculativechildthreadT2.Ifthemethodisnon-void,apre-dictedreturnvalueispushedonT2’soperandstack.T2thencon-tinuespastthereturnpointinparallelwiththeexecutionofthemethodbody,bufferingallreadsfrommainmemory.WhenT1re-turnsfromthecall,itjoinsT2.Iftheactualreturnvaluematchesthepredictedreturnvalue,andtherearenodependenceviolationsbe-tweenbufferedreadsandpost-invokevalues,T2’sbufferedwritesarecommittedandnon-speculativeexecutionjumpsaheadtowhereT2leftoff,yieldingspeedup.Iftherearedependenceviolationsorthepredictionisincorrect,T2issimply

内容需要下载文档才能查看 内容需要下载文档才能查看 内容需要下载文档才能查看 内容需要下载文档才能查看 内容需要下载文档才能查看

aborted.

childthreadsaprotectedexecutioncontext.NewSPMTFORKandSPMTJOINinstructionssurroundeverycallsite;theforkinstructioninsertschildthreadsintoapriorityqueue,whicharedequeuedandexecutedonseparateprocessorsbySpMThelperthreads,andthejoininstructionstopsandvalidateschildren,eithercommittingorabortingthem.Whileexecutingspeculativecode,weneedmodi?edbytecodeinstructionstoprotectagainstunsafecontrol?ow;forexample,GETFIELDismodi?edtoreadfromadependencebuffer,andMONITOREXITcausesspeculationtocometoanabrupthalt,althoughitdoesnotautomaticallyforceabortion.Finally,weneedtomakesurespeculationinteractssafelywithexceptionhandling,garbagecollection,nativemethodexecution,synchronization,classloading,andthenewJavamemorymodel[23].

WemakeseveraldifferentoptimisationstothesecomponentsinSableSpMT,someofthemorenotableonesbeingaggressivereturnvalueprediction[26,27],improvementstothedependencebuffer,allowingforspeculativethreadstoenterandexitmethods,betterenqueuingalgorithms,speculativeobjectallocation,andreductionofinterprocessormemorytraf?c.Mostofthetechniqueswehaveencounteredintheliteraturecanalsobeimplementedwithinourframework;inSection4weillustratetypicaldatagatheringandanalysisusingourworkonreturnvaluepredictionandthespecula-tiveengineitselfasexamples.3.2Single-threaded

内容需要下载文档才能查看

Mode

Figure4.Single-threadedsimulationmode.

Oneoftheuniquefeaturesofourdesignisasingle-threadedsimulationmodethatmimicstheprocessofspeculativeexecutioninasinglethread.EarlyoninthedevelopmentofSableSpMT,wefoundourselveswantingsomewaytotestthecomponentswehadwritteninthecontextofanexecutingJVM,withoutintroducingthecomplexityofactualconcurrencyintoourdebuggingprocess.TheresultingdeterministicdesignisshowninFigure4.InthismodeasinglethreadofJavaexecutionfollowsthecompletespeculativecontrol?ow.Uponreachingaforkpoint,themethodcallisskipped,andtheensuingcodeisexecutedspeculatively;whenaterminat-ingconditionisreached,thesamethreadjumpsbacktothenon-speculativeexecutionofthemethodcall,anduponreturningfromthecall,itattemptstojoinwithitsownspeculativeresult.

Figure3.Multithreadedmode.

ManycomponentsareneededforSMLPtoworkproperlyinaJVM,thefulldetailsofwhicharegivenin[28].AhighlevelviewofthemultithreadedmodethatbringstogetherallofthesecomponentsisshowninFigure3.Adependencebufferprotectsmainmemoryfromout-of-orderandpossiblyinvalidspeculativeoperations,andsomeformofstackbufferingisnecessarytogive

61

Java毕业设计外文翻译资料

Therearethreeprimaryadvantagestohavingthissingle-threadedsimulationmode.First,itallowsfortestingofSpMTcomponentsinanincompletesystem,mostimportantlyonewith-outmultiprocessorsupport.Itdoessobyprovidingstatesavingandrestoral,andinterleavingtheexecutionofspeculativeandnon-speculativecode.Second,bynotrunningmultiplethreadsitpre-ventsraceconditions,deadlocks,andmemorytraf?cfrominter-feringwithdevelopment,helpingtominimizethesearchspacewhenfacedwithdebugging.WewereabletoalternatecodingwithdesigningsupportforSpMTaccordingtothefullJVMSpeci?ca-tion[22],andonlyafterwehadcompletedarequirementsanalysisinthismannerdidwedevelopthemultithreadedexecutionmode.Third,itmeanswehavethefoundationsforJavacheckpointingandrollbackwithinavirtualmachine.ThishasutilityforJavaoutsideofSpMT,intraditionaldebugging[7],databasetransac-tions(e.g.injava.sql.Connection()),formalveri?cation[10],fault-tolerance[12],andsoftwaretransactionalmemory[15].3.3

SystemCon?guration

Systempropertiesspeci?edonthecommandlineareusedtose-lectdifferentSpMTalgorithmsanddatastructures,whichfacil-itatesexperimentalanalysisbyeliminatingtheneedformultipleVMbuilds.AschangestoSableSpMTareintroduced,ratherthanoutrightreplaceoldcontrol?oworadjustconstantstooptimalval-ues,systempropertiesareusedwhereverpossible,andthusitisstraightforwardtomakecontrolledcomparisonsandreverttooldcon?gurations.In?nalizedbuilds,thesepropertiescanbeautomat-icallyconvertedtoconstantsviapreprocessordirectivesandasin-gleAutoconfconfigureoption,sothattheaddedruntimeover-headofconditionalstestingthemwillbeoptimisedaway.Atthetimeofwriting,thereareover50suchproperties,controllingev-erythingfrommaximumRVPhashtablesizestothenumberofex-ecutingSpMThelperthreads,anditiseasytointroducenewones.Theonlyothersigni?cantcompile-timeconfigureoptionsinSa-bleSpMTallowtheuserto1)enableSpMTinthe?rstplace,2)enabledebuggingandassertions,and3)enablestatisticsgatheringforpost-executionanalysis.3.4

LoggingandTraceGeneration

----SS-S-S--S-S-@0x2a976bad68ALOAD_0@0x2a976bad70SPMT_FORK

ENQUEUESPMTCHILD@0x5ed850@0x2a976bad88INVOKESPECIALDEQUEUESPMTCHILD@0x5ed850STARTSPMT

enteringjava/lang/Object.<init>()V@0x2a976baf38ALOAD_0@0x2a976baf90RETURN@0x2a976baf40ALOAD_1

exitingjava/lang/Object.<init>()V@0x2a976badb0SPMT_JOIN

@0x2a976baf48SPMT_PUTFIELD

signallingspmtthreadhalt@0x5ed850STOPSPMT-SIGNALLED_BY_PARENTSPMTPASSED@0x5ed850

whenimplementingnewtechniques.SableVMsupportsonlytheJVMDIandJDWPforintegrationwithdebuggersatthistime,andalthoughwedonotprovidetracecompressionoranimple-mentationandextensionoftherelatedJVMPIorJVMTIpro?linginterfaces,thesefacilitiescouldbeincorporatedtopermitdetailedanalysisofSpMTexecutiontraces,usingadynamicmetricstoolsuchas*J[9].

4.ExperimentalAnalysis

Inthissectionwedescribeourreturnvaluepredictionframework,theintegrationofstaticanalysesintoSableSpMT,andvariouskindsofdynamicanalysisavailabletotheresearcher.Weprovideexper-imentalresultstodemonstratehowtheseanalysesgiveinsightintotheruntimebehaviourofindividualbenchmarks,componentsoftheframework,andtheframeworkasawhole,andhowtheysuggestinterestingareasforfutureinvestigationandoptimisationresearch.4.1ReturnValuePrediction

Methodcallreturnvaluesareoftenusedrelativelysoonafteramethodcall.Returnvalueprediction(RVP)allowsaspeculatingthreadtoproceedfurtherwithoutfailingduetosuchadependencybyheuristicallypredictingthereturnvalue.ItwaspreviouslyshownthataccurateRVPiscriticalforJavaSMLPperformance[16],andonthisbasiswesetouttoexplorehighlyaccurateRVPinSableSpMT[27].Weimplementedseveralwell-knownpredictors,includingacontextpredictorthatusesaper-callsitehashedhistoryofthelast?vereturnvalues,andahybridpredictorthatselectsthebestofseveralsub-predictorsatruntime.Wealsointroducedapowerfulnewmemoizationpredictorthatassociatesreturnvalueswithhashedmethodarguments.Whenexistingpredictorswerecombinedinahybridweachievedanaverageaccuracyof72%overSPECjvm98,andtheinclusionofthememoizationpredictorincreasedthisaverageto81%.ExploitingVMlevelknowledgeaboutthewidthofprimitivetypesallowedustoreducehashtablememoryby35%.

FulldetailsontheanalysesperformedinourinitialRVPstudyareavailablein[27];twooftheneaterresultsobtainedwerehowthecontextandmemoizationpredictorsexhibiteddramaticallydif-ferentaccuracydependingonbenchmark,andhowwewereabletoidentifyasmallpercentageofcallsitesasbeingresponsibleforeithertheproductionorconsumptionofhighlyvariabledata,ac-cordingto?nalcontextormemoizationpredictorsizesrespectively.TheRVPsystemisnowakeypartofSableSpMT;itiseasilyex-tendabletosupportnewtypesofreturnvaluepredictors,andcouldevenbeusedforgeneralpurposeloadvaluepredictionbyspecula-tivethreads.4.2StaticAnalysis

TheSootbytecodecompilerframework[38]isaconvenienttoolforahead-of-timestaticanalysisandtransformationintheabsenceoftheruntimestaticanalysissupporttypicallyfoundinJITcom-pilers.InFigure6weshowtheuseofSoottotransformthebaseinputJavaclass?lesinordertoinsertSPMTFORKandSPMTJOINinstructions.Thesameprocesscanalsobeusedtoappendstaticanalysisinformationasclass?leattributes[29],whicharethenin-terpretedbytheSpMTengine.

WeusesideeffectandcallgraphinformationderivedfromSoot’spoints-toanalysisintwocompileranalysesforimprovedRVP,andstudytheeffectonruntimepredictorbehaviourusingourframework[26].The?rstanalysisisareturnvalueuseanalysis(RVU),thatdetermineshowreturnvaluesareusedafterreturn-ingfromamethodcall.We?ndstaticallythatanaverage10%ofnon-voidcallsitesgenerateunconsumedreturnvalues,and21%ofcallsitesgenerateinaccuratereturnvalues,whichwede?neas

T1:P16384T1:P16384T1:P16384T1:P16384T1:P49156T1:P49156T1:P16384T1:P49156T1:P16384T1:P49156T1:P16384T1:P16384T1:P49156T1:P16384T1:P49156T1:P16384

Figure5.SpMTexecutiontrace.

Finally,SableSpMTprovidesacomprehensiveloggingandtracegenerationsystemthatcanpresentJavaSpMTeventsbythemselves,orinterleavethemwithexistingexecutiontracesofclassloading,methodinvocation,garbagecollection,synchroniza-tion,andbytecodeexecution.Anexampletracewithinterleavedmethodinvocation,bytecode,andSpMTeventsisshowninFig-ure5.Thesetracesareprimarilyusefulfordebuggingpurposes

62

Java毕业设计外文翻译资料

内容需要下载文档才能查看

Figure7.Speculationoverhead.Bothnon-speculativeparentandspec-ulativechildthreadssufferwastedcyclesduetooverheadatforkatjoinpoints.

parentexecutioncompdbjackjavacjessmpegmtrtrtUSEFULWORK39%24%29%

initializechild2%5%3%enqueuechild4%10%10%TOTALFORKupdatepredictor7%13%12%

deletechild5%5%5%signalandwait15%14%11%validateprediction4%4%4%

validatebuffer4%6%6%commitchild5%5%7%abortchild<1%<1%<1%cleanupchild<1%<1%<1%

pro?ling11%10%10%TOTALJOIN53%59%57%PROFILING2%2%1%

30%

4%9%11%4%11%5%5%6%<1%<1%12%56%1%

21%4%7%12%5%19%7%5%6%<1%<1%11%67%1%

59%2%3%6%2%8%3%3%3%<1%<1%7%34%2%

49%1%2%7%2%26%2%1%2%<1%<1%5%47%1%

58%2%2%7%2%11%3%2%3%<1%<1%6%36%2%

Figure6.Staticanalysisintegration.

thosethatareusedonlyinsidebooleanorbranchexpressions.Ac-tualruntimemeasurementsshowlessimprovement:only3%ofdynamicmethodinvocationsreturnunconsumedvalues,whereas14%returninaccuratevalues.Thisanalysisdoesreducehashtablecollisions,saving3%ofpredictormemoryandincreasingaccuracybyupto7%.

Thesecondanalysiscomputesparameterdependence(PD),aformofslicingthatdetermineswhichparametersaffectthereturnvalue.Statically,weobservethat25%ofconsumedcallsiteswithoneormoreparametershavezeroparameterdependences,and23%havepartialdependences,suchthatthereturnvaluedoesnotdependononeormoreparameters.Atruntime,however,we?ndthat7%ofdynamicmethodinvocationshavezerodependencesandonly3%havepartialdependences.Theresultsofthisanalysisareexploitedtoeliminateinputstothememoizationpredictor,andtheaccuracyofmemoizationaloneforjack,javac,andjessincreasesbyupto13%,withoverallmemoryrequirementsbeingreducedbyafurther2%.Althoughtheseanalysesyieldonlyincrementalimprovements,atleastintheircurrentform,theydodemonstratehownewstaticanalysescanbeeasilyincorporatedintoSableSpMTandbothvalidatedandemployedatruntime.4.3

DynamicAnalysis

WenowdescribedynamicanalysisoftheSableSpMTengine,anextensionoftheSableVM1.1.9switchinterpreter.Allexperimentswereperformedona1.8GHz4-waySMPAMDOpteronmachinerunningLinux2.6.7,usingnative64-bitbinariesandrunningtheSPECjvm98benchmarksuite[33]atsize100(S100).Childrenwereforkedateverycallsitereachednon-speculatively,allfreepro-cessorswereoccupiedbyspeculativehelperthreads,andanopti-malreturnvaluepredictioncon?gurationwasused,unlessother-wisestated.4.3.1

SpeculationOverhead

TheoverheadofthreadoperationsinanySpMTsystemisamajorconcern[39],andthisisespeciallytrueinapuresoftwareenviron-ment.Weintroducedpro?lingsupportintoourframeworkinordertoprovideacompletebreakdownofSpMToverheadincurredbybothparentandspeculativechildthreads;refertoTables1and2respectively.AsshowninFigure7,parentthreadssufferoverheadwhenforking,enqueuing,joining,andvalidatingchildthreads,andchildthreadssufferonstartupandwhentheyreachsomestopping

内容需要下载文档才能查看 内容需要下载文档才能查看 内容需要下载文档才能查看 内容需要下载文档才能查看

condition.

Table1.Non-speculativethreadoverheadbreakdown.Parentexecution

consistsofusefulwork,forkoverhead,andjoinoverhead,andalsothepro?lingoverheadinherentindelineatingthesethreebroadtasks.Pro?linginthejoinprocessincludesthecostofgatheringoverheadinfofortheothereightsub-tasks,andofupdatingvariousSpMTstatistics.

helperexecutioncompdbjackjavacjessmpegmtrtrtIDLE

startup

querypredictorusefulworkshutdownpro?ling

EXECUTECHILDCLEANUPCHILD

PROFILING

86%<1%3%5%<1%<1%<1%1%

82%<1%5%6%<1%<1%<1%1%

78%<1%4%10%<1%<1%<1%1%

78%<1%4%10%<1%<1%<1%1%

78%<1%6%10%<1%<1%<1%<1%

55%<1%5%34%<1%1%<1%1%

53%1%15%20%<1%2%<1%1%

71%<1%8%13%<1%1%<1%<1%

Table2.Speculativethreadoverheadbreakdown.HelperSpMTthreadsexecuteinaloop,idlingforanopportunitytodequeuechildrenfromthepriorityqueue,andtheninitializethem,executethem,andcleanthemup.Thechildexecutionprocessitselfconsistsofstartup,queryingthereturnvaluepredictor,usefulwork(currentlyonlybytecodeexecution),andshutdown,inducedbyreachingsometerminationcondition.Thereispro?lingoverheadbothwhenexecutingspeculativecode,andwhenswitchingbetweentasksinthehelperloop.

ThestrikingresultinTable1isthattheparentspendssomuchofitstimeforkingandjoiningspeculativethreadsthatitsopportu-nitiesformakingprogressthroughnormalJavabytecodeandna-tivecodeexecutionarereducedbyupto5-fold.Weseethatjoin-ingthreadsissigni?cantlymoreexpensivethanforkingthreads,andthatwithinthejoinprocess,predictorupdatesandwaitingforthespeculativechildtohaltexecutionarethemostcostlysub-categories.Otheroverheadsub-categoriesarenotinsigni?cant,and

63

版权声明:此文档由查字典文档网用户提供,如用于商业用途请与作者联系,查字典文档网保持最终解释权!

下载文档

热门试卷

2016年四川省内江市中考化学试卷
广西钦州市高新区2017届高三11月月考政治试卷
浙江省湖州市2016-2017学年高一上学期期中考试政治试卷
浙江省湖州市2016-2017学年高二上学期期中考试政治试卷
辽宁省铁岭市协作体2017届高三上学期第三次联考政治试卷
广西钦州市钦州港区2016-2017学年高二11月月考政治试卷
广西钦州市钦州港区2017届高三11月月考政治试卷
广西钦州市钦州港区2016-2017学年高一11月月考政治试卷
广西钦州市高新区2016-2017学年高二11月月考政治试卷
广西钦州市高新区2016-2017学年高一11月月考政治试卷
山东省滨州市三校2017届第一学期阶段测试初三英语试题
四川省成都七中2017届高三一诊模拟考试文科综合试卷
2017届普通高等学校招生全国统一考试模拟试题(附答案)
重庆市永川中学高2017级上期12月月考语文试题
江西宜春三中2017届高三第一学期第二次月考文科综合试题
内蒙古赤峰二中2017届高三上学期第三次月考英语试题
2017年六年级(上)数学期末考试卷
2017人教版小学英语三年级上期末笔试题
江苏省常州西藏民族中学2016-2017学年九年级思想品德第一学期第二次阶段测试试卷
重庆市九龙坡区七校2016-2017学年上期八年级素质测查(二)语文学科试题卷
江苏省无锡市钱桥中学2016年12月八年级语文阶段性测试卷
江苏省无锡市钱桥中学2016-2017学年七年级英语12月阶段检测试卷
山东省邹城市第八中学2016-2017学年八年级12月物理第4章试题(无答案)
【人教版】河北省2015-2016学年度九年级上期末语文试题卷(附答案)
四川省简阳市阳安中学2016年12月高二月考英语试卷
四川省成都龙泉中学高三上学期2016年12月月考试题文科综合能力测试
安徽省滁州中学2016—2017学年度第一学期12月月考​高三英语试卷
山东省武城县第二中学2016.12高一年级上学期第二次月考历史试题(必修一第四、五单元)
福建省四地六校联考2016-2017学年上学期第三次月考高三化学试卷
甘肃省武威第二十三中学2016—2017学年度八年级第一学期12月月考生物试卷

网友关注视频

外研版英语三起6年级下册(14版)Module3 Unit2
【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
外研版英语七年级下册module3 unit2第一课时
苏教版二年级下册数学《认识东、南、西、北》
8.练习八_第一课时(特等奖)(苏教版三年级上册)_T142692
沪教版八年级下册数学练习册21.4(1)无理方程P18
第五单元 民族艺术的瑰宝_16. 形形色色的民族乐器_第一课时(岭南版六年级上册)_T3751175
冀教版英语三年级下册第二课
冀教版英语五年级下册第二课课程解读
每天日常投篮练习第一天森哥打卡上脚 Nike PG 2 如何调整运球跳投手感?
苏科版八年级数学下册7.2《统计图的选用》
沪教版八年级下册数学练习册一次函数复习题B组(P11)
外研版八年级英语下学期 Module3
第12章 圆锥曲线_12.7 抛物线的标准方程_第一课时(特等奖)(沪教版高二下册)_T274713
第19课 我喜欢的鸟_第一课时(二等奖)(人美杨永善版二年级下册)_T644386
沪教版八年级下次数学练习册21.4(2)无理方程P19
三年级英语单词记忆下册(沪教版)第一二单元复习
【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,湖北省
冀教版英语四年级下册第二课
二次函数求实际问题中的最值_第一课时(特等奖)(冀教版九年级下册)_T144339
沪教版牛津小学英语(深圳用) 五年级下册 Unit 7
北师大版数学四年级下册3.4包装
【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,天津市
【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
小学英语单词
冀教版小学数学二年级下册第二单元《余数和除数的关系》
外研版英语三起5年级下册(14版)Module3 Unit2
精品·同步课程 历史 八年级 上册 第15集 近代科学技术与思想文化
【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,广东省