bringphysicalmemory

physicalmemory  时间:2021-05-19  阅读:()
Lecture20:CacheHierarchies,VirtualMemoryToday'stopics:CachehierarchiesVirtualmemoryReminder:Assignment8willbepostedsoon(dueTue11/21)ExampleAccessPattern8-bytewords101000Direct-mappedcache:eachaddressmapstoauniqueaddressByteaddressTagCompareDataarrayTagarrayAssumethataddressesare8bitslongHowmanyofthefollowingaddressrequestsarehits/misses4,7,10,13,16,68,73,78,83,88,4,7,10…IncreasingLineSize32-bytecachelinesizeorblocksize10100000ByteaddressTagDataarrayTagarrayOffsetAlargecachelinesizesmallertagarray,fewermissesbecauseofspatiallocalityAssociativity10100000ByteaddressTagDataarrayTagarraySetassociativityfewerconflicts;wastedpowerbecausemultipledataandtagsarereadWay-1Way-2CompareAssociativity10100000ByteaddressTagDataarrayTagarrayHowmanyoffset/index/tagbitsifthecachehas64sets,eachsethas64bytes,4waysWay-1Way-2CompareExample32KB4-wayset-associativedatacachearraywith32bytelinesizesHowmanysetsHowmanyindexbits,offsetbits,tagbitsHowlargeisthetagarrayCacheMissesOnawritemiss,youmayeitherchoosetobringtheblockintothecache(write-allocate)ornot(write-no-allocate)Onareadmiss,youalwaysbringtheblockin(spatialandtemporallocality)–butwhichblockdoyoureplacenochoiceforadirect-mappedcacherandomlypickoneofthewaystoreplacereplacethewaythatwasleast-recentlyused(LRU)FIFOreplacement(round-robin)WritesWhenyouwriteintoablock,doyoualsoupdatethecopyinL2write-through:everywritetoL1writetoL2write-back:marktheblockasdirty,whentheblockgetsreplacedfromL1,writeittoL2WritebackcoalescesmultiplewritestoanL1blockintooneL2writeWritethroughsimplifiescoherencyprotocolsinamultiprocessorsystemastheL2alwayshasacurrentcopyofdataTypesofCacheMissesCompulsorymisses:happensthefirsttimeamemorywordisaccessed–themissesforaninfinitecacheCapacitymisses:happensbecausetheprogramtouchedmanyotherwordsbeforere-touchingthesameword–themissesforafully-associativecacheConflictmisses:happensbecausetwowordsmaptothesamelocationinthecache–themissesgeneratedwhilemovingfromafully-associativetoadirect-mappedcacheVirtualMemoryProcessesdealwithvirtualmemory–theyhavetheillusionthataverylargeaddressspaceisavailabletothemThereisonlyalimitedamountofphysicalmemorythatissharedbyallprocesses–aprocessplacespartofitsvirtualmemoryinthisphysicalmemoryandtherestisstoredondisk(calledswapspace)Thankstolocality,diskaccessislikelytobeuncommonThehardwareensuresthatoneprocesscannotaccessthememoryofadifferentprocessAddressTranslationThevirtualandphysicalmemoryarebrokenupintopagesVirtualaddress8KBpagesizepageoffsetvirtualpagenumberTranslatedtophysicalpagenumberPhysicaladdress13MemoryHierarchyPropertiesAvirtualmemorypagecanbeplacedanywhereinphysicalmemory(fully-associative)ReplacementisusuallyLRU(sincethemisspenaltyishuge,wecaninvestsomeefforttominimizemisses)Apagetable(indexedbyvirtualpagenumber)isusedfortranslatingvirtualtophysicalpagenumberThepagetableisitselfinmemoryTLBSincethenumberofpagesisveryhigh,thepagetablecapacityistoolargetofitonchipAtranslationlookasidebuffer(TLB)cachesthevirtualtophysicalpagenumbertranslationforrecentaccessesATLBmissrequiresustoaccessthepagetable,whichmaynotevenbefoundinthecache–twoexpensivememorylook-upstoaccessonewordofdata!
AlargepagesizecanincreasethecoverageoftheTLBandreducethecapacityofthepagetable,butalsoincreasesmemorywastageTLBandCacheIsthecacheindexedwithvirtualorphysicaladdressToindexwithaphysicaladdress,wewillhavetofirstlookuptheTLB,thenthecachelongeraccesstimeMultiplevirtualaddressescanmaptothesamephysicaladdress–mustensurethatthesedifferentvirtualaddresseswillmaptothesamelocationincache–else,therewillbetwodifferentcopiesofthesamephysicalmemorywordDoesthetagarraystorevirtualorphysicaladdressesSincemultiplevirtualaddressescanmaptothesamephysicaladdress,avirtualtagcomparisoncanflagamissevenifthecorrectphysicalmemorywordispresentCacheandTLBPipelineTLBVirtualaddressTagarrayDataarrayPhysicaltagcomparionVirtualpagenumberVirtualindexOffsetPhysicalpagenumberPhysicaltagVirtuallyIndexed;PhysicallyTaggedCacheBadEventsConsiderthelongestlatencypossibleforaloadinstruction:TLBmiss:mustlookuppagetabletofindtranslationforv.
pagePCalculatethevirtualmemoryaddressforthepagetableentrythathasthetranslationforpageP–let'ssay,thisisv.
pageQTLBmissforv.
pageQ:willrequirenavigationofahierarchicalpagetable(let'signorethiscasefornowandassumewehavesucceededinfindingthephysicalmemorylocation(R)forpageQ)AccessmemorylocationR(findthiseitherinL1,L2,ormemory)Wenowhavethetranslationforv.
pageP–putthisintotheTLBWenowhaveaTLBhitandknowthephysicalpagenumber–thisallowsustodotagcomparisonandchecktheL1cacheforahitIfthere'samissinL1,checkL2–ifthatmisses,checkinmemoryAtanypoint,ifthepagetableentryclaimsthatthepageisondisk,flagapagefault–theOSthencopiesthepagefromdisktomemoryandthehardwareresumeswhatitwasdoingbeforethepagefault…phew!
TitleBullet

VirtVPS抗投诉瑞士VPS上线10美元/月

专心做抗投诉服务器的VirtVPS上线瑞士机房,看中的就是瑞士对隐私的保护,有需要欧洲抗投诉VPS的朋友不要错过了。VirtVPS这次上新的瑞士服务器采用E-2276G处理器,Windows/Linux操作系统可选。VirtVPS成立于2018年,主营荷兰、芬兰、德国、英国机房的离岸虚拟主机托管、VPS、独立服务器、游戏服务器和外汇服务器业务。VirtVPS 提供世界上最全面的安全、完全受保护和私...

raksmart:香港机房服务器实测评数据分享,告诉你raksmart服务器怎么样

raksmart作为一家老牌美国机房总是被很多人问到raksmart香港服务器怎么样、raksmart好不好?其实,这也好理解。香港服务器离大陆最近、理论上是不需要备案的服务器里面速度最快的,被过多关注也就在情理之中了。本着为大家趟雷就是本站的光荣这一理念,拿了一台raksmart的香港独立服务器,简单做个测评,分享下实测的数据,仅供参考!官方网站:https://www.raksmart.com...

[6.18]DogYun:充100送10元,态云7折,经典云8折,独立服务器月省100元,幸运大转盘最高5折

DogYun是一家2019年成立的国人主机商,提供VPS和独立服务器租用等,数据中心包括中国香港、美国洛杉矶、日本、韩国、德国、荷兰等,其中VPS包括常规VPS(经典云)和按小时计费VPS(动态云),使用自行开发的面板和管理系统,支持自定义配置,动态云各个硬件独立按小时计费,带宽按照用户使用量计费(不使用不计费)或者购买流量包,线路也可以自行切换。目前商家发布了6.18促销方案,新购动态云7折,经...

physicalmemory为你推荐
支持ipad支持ipad支持ipadwin10关闭445端口在win10 如何关闭445端口的最新相关信息phpecho为什么在PHP中使用echo FALSE;什么也输出不了?应该如何输出FALSE?谢谢!canvas2Canvas ~セピア色のモチーフ~ 这个动画片的中文翻译是什么?从哪看?win7关闭135端口windows 7如何关闭139端口googleadsencegoogle adsense打不开怎么办ipad上不了网平板电脑 能连接网络不能上网appletv越狱Apple TV 2 iOS5.0如何实现不完美越狱?
arvixe awardspace omnis 腾讯云数据库 godaddy续费优惠码 回程路由 ca4249 大容量存储器 百兆独享 免费全能主机 常州联通宽带 腾讯总部在哪 空间登入 主机返佣 实惠 免费个人网页 后门 腾讯数据库 云服务是什么意思 广州主机托管 更多