











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The basics of dram and virtual memory, including dram access properties, technology trends, increasing bandwidth techniques, and virtual memory concepts. It covers page size, address translation, tlb usage, and cache design. The document also discusses superpages and their implementation.
Typology: Study notes
1 / 19
This page cannot be seen from the preview
Don't miss anything!












Today: DRAM and Virtual memory basics (Sections 5.3-5.4)
1M DRAM = 1024 x 1024 array of bits 10 row address bits arrive first Column decoder 10 column address bits arrive next Subset of bits returned to CPU 1024 bits are read out Row Access Strobe (RAS) Column Access Strobe (CAS)
Improvements in technology (smaller devices)
capacities double every two years
Time to read data out of the array improves by only 5% every year
high memory latency (the memory wall!)
Time to read data out of the column decoder improves by 10% every year
influences bandwidth
The column decoder has access to many bits of data – many sequential bits can be forwarded to the CPU without additional row accesses (fast page mode)
Each word is sent asynchronously to the CPU – every transfer entails overhead to synchronize with the controller – by introducing a clock, more than one word can be sent without increasing the overhead – synchronous DRAM
Processes deal with virtual memory – they have the illusion that a very large address space is available to them
There is only a limited amount of physical memory that is shared by all processes – a process places part of its virtual memory in this physical memory and the rest is stored on disk - Thanks to locality, disk access is likely to be uncommon - The hardware ensures that one process cannot access the memory of a different process
The virtual and physical memory are broken up into pages Virtual address 8KB page size page offset virtual page number Translated to physical page number Physical address 13
Since the number of pages is very high, the page table capacity is too large to fit on chip
A translation lookaside buffer (TLB) caches the virtual^ to physical page number translation for recent accesses - A TLB miss requires us to access the page table, which^ may not even be found in the cache – two expensive^ memory look-ups to access one word of data! - A large page size can increase the coverage of the TLB^ and reduce the capacity of the page table, but also^ increases memory wastage
Is the cache indexed with virtual or physical address?
To index with a physical address, we will have to first^ look up the TLB, then the cache
longer access time ¾ Multiple virtual addresses can map to the same^ physical address – can we ensure that these^ different virtual addresses will map to the same^ location in cache? Else, there will be two different^ copies of the same physical memory word
Does the tag array store virtual or physical addresses?
Since multiple virtual addresses can map to the same^ physical address, a virtual tag comparison can flag a^ miss even if the correct physical memory word is present
TLB Virtual address Tag array Data array Physical tag comparion Virtual page number Virtual index Offset Physical page number Physical tag Virtually Indexed; Physically Tagged Cache
If a program’s working set size is 16 MB and page size is 8KB, there are 2K frequently accessed pages – a 128-entry TLB will not suffice
By increasing page size to 128KB, TLB misses will be eliminated – disadvantage: memory wastage, increase in page fault penalty - Can we change page size at run-time? - Note that a single page has to be contiguous in physical memory
Promoting a series of contiguous virtual pages into a superpage reduces TLB misses, but has a cost: copying physical memory into contiguous locations
Page usage statistics can determine if pages are good candidates for superpage promotion, but if cost of a TLB miss is x and cost of copying pages is Nx, when do you decide to form a superpage? - If ski rentals cost $20 and new skis cost $200, when do I decide to buy new skis?
If I rent 10 times and then buy skis, I’m guaranteed to^ not spend more than twice the optimal amount
The hardware and operating system must co-operate to ensure that different processes do not modify each other’s memory
The hardware provides special registers that can be read in user mode, but only modified by instrs in supervisor mode - A simple solution: the physical memory is divided between processes in contiguous chunks by the OS and the bounds are stored in special registers – the hardware checks every program access to ensure it is within bounds
Bullet