DOC PREVIEW
UMD CMSC 411 - Memory Hierarchy and Cache Design

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Page1MemoryHierarchyandCacheDesign(4)Virtualvs RealAddressSpacesVirtualAddressSpaceRealAddressSpaceMappingVirtualMemory- thelogicalconceptVirtualMemoryvs Cache2Page2VirtualMemoryvs Cache• Replacement– Cache- controlledbyhardware– Virtualmemory- controlledbyoperatingsystem» HUGEmisspenalty• Size– Virtualmemorysizeisdeterminedbyprocessoraddresssize– Cachesizeisindependentofprocessoraddresssize• Combinedusageofsecondarymemory– Backingstoreofmainmemory– FilesystemTypesofVirtualMemory• Paged– Fixedsizeblocks(pages)– Sizeusually4K-64Kbytes• Segmented– Variablesizeblocks– SizesvaryMappingRealAddressSpaceVirtualAddressSpaceBlockBaseValueR=V+(BaseRegister)MappingrequiresoneBaseValueforeachblockBlocksmaybeofsamesizeorvaryingsizeSegmentationandPaging• Segmentation– OrganizeVirtualAddressSpaceinvariablesizeblocks– Needinformationaboutthelengthofblocksalso– Addressesfromonesegmenttothenextmaynotbeconsideredcontiguous– Virtualaddress» {SegmentID,OffsetinSegment}• Paging– OrganizeVirtualAddressSpaceinfixedsizeblocks– VirtualAddress» {SingleAddress}3Page3Segmentationvs PagingSegmentationvs PagingExternalFragmentation                                                                                                                                                                                                                                                      segment1segment2segment3segment4                                                                              doesn'tfitsegment5InternalFragmentationprocess1process2page1page2page3page4page5page64Page4TranslatingVirtualAddressesBlock OffsetOffsetTranslationTableSegmentationseg no. offsetwithinsegmentUser'saddressP lengthstartaddr.+physicaladdressPagingAddressTranslationFourQuestionsforVirtualMemory• BlockPlacement:FullyAssociative• BlockIdentification:FullyAssociative• BlockReplacement:LRUoritsvariants• WriteStrategy: Writeback&Writeallocate5Page5BlockPlacement• FullyAssociative- theobviouschoice– Hugemisspenalty- lowmissrateisextremelyimportant– VMmanagedbysoftwareinOS- muchmoreflexiblethancachemanagedbyhardwareBlockIdentificationPagingLogicaltoPhysicalAddressesVAXMemoryManagement• 32Bitaddresses• 4GBVirtualAddressSpace• 512Bytesperpage2**23pages• RealAddressSpaceislimitedto1GB2**21PageFrames6Page6AddressTranslationBlockReplacement• PureLRUisdifficult,ifnotimpossible,toimplement• TheClockAlgorithm– Maintainacircularlistofpagesinphysicalmemory» Useause bittotrackhowrecentlyapageisreferenced» Use bitsetwheneverapageisreferenced– Onapagefault,lookforapagewithuse bit=0(intheclockorder)» Replacesapagethathasn’tbeenreferencedforonecompleterevolutionoftheclockWriteStrategy• Writeback- theobviouschoiceFastAddressTranslation• Pagetablesarelargeandoftenpaged• Needfastmechanismforaddresstranslation• USE– TRANSLATIONLOOK-ASIDEBUFFERS(TLB)– Associativememory7Page7TLB:PageTableCacheTLBMoreDetailsonTLB(AlphaAXP21064TLB)PageSize• Sizeofpagetableisinverselyproportionaltothepagesize• Transferringlargerpagestoandfromthesecondarystorageismoreefficientthansmallerpages• AsTLBsizesarerestricted,largerpagesizesimplymoreaddressspacecanbetranslated• Largerpagesizesleadtohigherinternalfragmentation• LargerpagesleadtohigherstartuptimeforaprocessSegmentationandPagingseg no. offsetwithinthesegmentsegmenttablepagetablerealaddress8Page8SegmentationandPagingSegmentation Paging1.Blocksize Variable Fixed2.Placement Firstfit,etal. Fullyassociative3.Howfound Size+location Pagetableregisters4.Replacement byprogrammer LRU5.Writeaction Writeback WritebackFragmentation External InternalProgramming Visible TransparentProtection RO,RW,EX DifficultProtection• Haveboundsregisterandcheckitforeachaccess– Haveatleasttwomodes- KernelandUser– HaveCPUstatesthatcanbeusedbyauserbutnotmodified- BaseandBoundRegisters...– Controlledchangeofmode- SystemCallExample- AXP21064• 64-bitaddresses– kseg - (bits63and62=10)»


View Full Document

UMD CMSC 411 - Memory Hierarchy and Cache Design

Documents in this Course
Load more
Download Memory Hierarchy and Cache Design
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Memory Hierarchy and Cache Design and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Memory Hierarchy and Cache Design 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?