資源描述:
《??!What Every Programmer Should Know About Memory》由會員上傳分享,免費在線閱讀,更多相關內容在學術論文-天天文庫。
1、WhatEveryProgrammerShouldKnowAboutMemoryUlrichDrepperRedHat,Inc.drepper@redhat.comNovember21,2007AbstractAsCPUcoresbecomebothfasterandmorenumerous,thelimitingfactorformostprogramsisnow,andwillbeforsometime,memoryaccess.Hardwaredesignershavecomeupwitheve
2、rmoresophisticatedmemoryhandlingandaccelerationtechniques–suchasCPUcaches–butthesecannotworkoptimallywithoutsomehelpfromtheprogrammer.Unfortunately,neitherthestructurenorthecostofusingthememorysubsystemofacomputerorthecachesonCPUsiswellunderstoodbymostp
3、rogrammers.Thispaperexplainsthestructureofmemorysubsys-temsinuseonmoderncommodityhardware,illustratingwhyCPUcachesweredeveloped,howtheywork,andwhatprogramsshoulddotoachieveoptimalperformancebyutilizingthem.1Introductiondaythesechangesmainlycomeinthefoll
4、owingforms:Intheearlydayscomputersweremuchsimpler.Thevar-?RAMhardwaredesign(speedandparallelism).iouscomponentsofasystem,suchastheCPU,memory,massstorage,andnetworkinterfaces,weredevelopedto-?Memorycontrollerdesigns.getherand,asaresult,werequitebalancedi
5、ntheirper-?CPUcaches.formance.Forexample,thememoryandnetworkinter-faceswerenot(much)fasterthantheCPUatproviding?Directmemoryaccess(DMA)fordevices.data.Thissituationchangedoncethebasicstructureofcom-Forthemostpart,thisdocumentwilldealwithCPUputersstabili
6、zedandhardwaredevelopersconcentratedcachesandsomeeffectsofmemorycontrollerdesign.onoptimizingindividualsubsystems.Suddenlytheper-Intheprocessofexploringthesetopics,wewillexploreformanceofsomecomponentsofthecomputerfellsig-DMAandbringitintothelargerpictu
7、re.However,weni?cantlybehindandbottlenecksdeveloped.Thiswaswillstartwithanoverviewofthedesignfortoday’scom-especiallytrueformassstorageandmemorysubsystemsmodityhardware.Thisisaprerequisitetounderstand-which,forcostreasons,improvedmoreslowlyrelativeingth
8、eproblemsandthelimitationsofef?cientlyus-toothercomponents.ingmemorysubsystems.Wewillalsolearnabout,insomedetail,thedifferenttypesofRAMandillustrateTheslownessofmassstoragehasmostlybeendealtwithwhythesedifferencesstillexist.using