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
pacificrack又追加了3款特价便宜vps搞促销,而且是直接7折优惠(一次性),低至年付7.2美元。这是本月第3波便宜vps了。熟悉pacificrack的知道机房是QN的洛杉矶,接入1Gbps带宽,KVM虚拟,纯SSD RAID10,自带一个IPv4。官方网站:https://pacificrack.com支持PayPal、支付宝等方式付款7折秒杀优惠码:R3UWUYF01T内存CPUSS...
趣米云怎么样?趣米云是创建于2021年的国人IDC商家,虽然刚刚成立,但站长早期为3家IDC提供技术服务,已从业2年之久,目前主要从事出售香港vps、香港独立服务器、香港站群服务器等,目前在售VPS线路有三网CN2、CN2 GIA,该公司旗下产品均采用KVM虚拟化架构。由于内存资源大部分已售,而IP大量闲置,因此我们本月新增1c1g优惠套餐。点击进入:趣米云官方网站地址香港三网CN2云服务器机型活...
舍利云怎么样?舍利云推出了6核16G超大带宽316G高性能SSD和CPU,支持全球范围,原价516,折后价200元一月。原价80美元,现价30美元,支持地区:日本,新加坡,荷兰,法国,英国,澳大利亚,加拿大,韩国,美国纽约,美国硅谷,美国洛杉矶,美国亚特兰大,美国迈阿密州,美国西雅图,美国芝加哥,美国达拉斯。舍利云是vps云服务器的销售商家,其产品主要的特色是适合seo和建站,性价比方面非常不错,...
physicalmemory为你推荐
中國信託商業銀行支持ipad敬请参阅报告结尾处免责声明化学品安全技术说明书ipad连不上wifiiPad 连不上Wifi,显示无互联网连接ipad连不上wifiipad显示无互联网连接怎么回事?phpechophp echo函数 是什么意思fusionchartsfusioncharts怎么生成图片至excelgoogle中国地图谷歌卫星地图中文版下载在哪下??css3按钮如何在html添加一个搜索框和一个按钮
域名升级访问中 vps论坛 域名解析服务器 电信测速器 瓦工 iisphpmysql 抢票工具 香港新世界电讯 2017年黑色星期五 河南m值兑换 nerds 网站在线扫描 帽子云排名 lamp架构 云服务是什么意思 hdchina zcloud japanese50m咸熟 windowsserver2008 restart 更多