Chapter 5B. Large and Fast: Exploiting Memory Hierarchy

Similar documents
CS 152 Computer Architecture and Engineering. Lecture 8 - Address Translation

Multilevel Memories. Joel Emer Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology

CS 152 Computer Architecture and Engineering. Lecture 8 - Address Translation

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation

COSC3330 Computer Architecture Lecture 20. Virtual Memory

Cache Performance and Memory Management: From Absolute Addresses to Demand Paging. Cache Performance

Virtual Memory: From Address Translation to Demand Paging

Improving Cache Performance and Memory Management: From Absolute Addresses to Demand Paging. Highly-Associative Caches

CS 152 Computer Architecture and Engineering. Lecture 6 - Memory

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 12, 2018 L16-1

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1

Virtual Memory: From Address Translation to Demand Paging

CS 152 Computer Architecture and Engineering. Lecture 11 - Virtual Memory and Caches

Lecture 6 - Memory. Dr. George Michelogiannakis EECS, University of California at Berkeley CRD, Lawrence Berkeley National Laboratory

John Wawrzynek & Nick Weaver

EN1640: Design of Computing Systems Topic 06: Memory System

Computer Architecture. Memory Hierarchy. Lynn Choi Korea University

Computer Science 146. Computer Architecture

CS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Virtual Memory Virtual memory first used to relive programmers from the burden of managing overlays.

Chapter 2: Memory Hierarchy Design (Part 3) Introduction Caches Main Memory (Section 2.2) Virtual Memory (Section 2.4, Appendix B.4, B.

Virtual Memory. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Chapter 5 (Part II) Large and Fast: Exploiting Memory Hierarchy. Baback Izadi Division of Engineering Programs

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 7: Memory Organization Part II

HY225 Lecture 12: DRAM and Virtual Memory

Lecture-14 (Memory Hierarchy) CS422-Spring

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Last =me in Lecture 7 3 C s of cache misses Compulsory, Capacity, Conflict

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 5. Large and Fast: Exploiting Memory Hierarchy

EN1640: Design of Computing Systems Topic 06: Memory System

Chapter 5. Large and Fast: Exploiting Memory Hierarchy. Part II Virtual Memory

Chapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface

CS 61C: Great Ideas in Computer Architecture. Lecture 23: Virtual Memory. Bernhard Boser & Randy Katz

Memory Technology. Chapter 5. Principle of Locality. Chapter 5 Large and Fast: Exploiting Memory Hierarchy 1

ECE331: Hardware Organization and Design

Views of Memory. Real machines have limited amounts of memory. Programmer doesn t want to be bothered. 640KB? A few GB? (This laptop = 2GB)

Chapter 8. Virtual Memory

Modern Virtual Memory Systems. Modern Virtual Memory Systems

Chapter 5 B. Large and Fast: Exploiting Memory Hierarchy

V. Primary & Secondary Memory!

Computer Architecture Computer Science & Engineering. Chapter 5. Memory Hierachy BK TP.HCM

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Reducing Hit Times. Critical Influence on cycle-time or CPI. small is always faster and can be put on chip

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Computer Architecture ECE 568/668

COMPUTER ORGANIZATION AND DESIGN

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

CS 61C: Great Ideas in Computer Architecture. Lecture 23: Virtual Memory

CSC 631: High-Performance Computer Architecture

COEN-4730 Computer Architecture Lecture 3 Review of Caches and Virtual Memory

Chapter 5 Memory Hierarchy Design. In-Cheol Park Dept. of EE, KAIST

EE414 Embedded Systems Ch 5. Memory Part 2/2

Agenda. CS 61C: Great Ideas in Computer Architecture. Virtual Memory II. Goals of Virtual Memory. Memory Hierarchy Requirements

Computer Systems. Virtual Memory. Han, Hwansoo

Computer Architecture A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

CPU issues address (and data for write) Memory returns data (or acknowledgment for write)

Main Memory. EECC551 - Shaaban. Memory latency: Affects cache miss penalty. Measured by:

Textbook: Burdea and Coiffet, Virtual Reality Technology, 2 nd Edition, Wiley, Textbook web site:

Random-Access Memory (RAM) Systemprogrammering 2007 Föreläsning 4 Virtual Memory. Locality. The CPU-Memory Gap. Topics

CS 152 Computer Architecture and Engineering. Lecture 6 - Memory. Last =me in Lecture 5

Virtual Memory. Motivations for VM Address translation Accelerating translation with TLBs

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili

5. Memory Hierarchy Computer Architecture COMP SCI 2GA3 / SFWR ENG 2GA3. Emil Sekerinski, McMaster University, Fall Term 2015/16

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Page 1. Multilevel Memories (Improving performance using a little cash )

EEM 486: Computer Architecture. Lecture 9. Memory

Random-Access Memory (RAM) Systemprogrammering 2009 Föreläsning 4 Virtual Memory. Locality. The CPU-Memory Gap. Topics! The memory hierarchy

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

CS 61C: Great Ideas in Computer Architecture Virtual Memory. Instructors: John Wawrzynek & Vladimir Stojanovic

Memory Management! How the hardware and OS give application pgms:" The illusion of a large contiguous address space" Protection against each other"

Virtual Memory Oct. 29, 2002

ECE 4750 Computer Architecture, Fall 2017 T03 Fundamental Memory Concepts

Lecture 9 - Virtual Memory

CSE 431 Computer Architecture Fall Chapter 5A: Exploiting the Memory Hierarchy, Part 1

EITF20: Computer Architecture Part 5.1.1: Virtual Memory

Memory latency: Affects cache miss penalty. Measured by:

Mainstream Computer System Components

Memory systems. Memory technology. Memory technology Memory hierarchy Virtual memory

CS650 Computer Architecture. Lecture 9 Memory Hierarchy - Main Memory

The Memory Hierarchy & Cache Review of Memory Hierarchy & Cache Basics (from 350):

ECE468 Computer Organization and Architecture. Virtual Memory

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Intro to Virtual Memory

198:231 Intro to Computer Organization. 198:231 Introduction to Computer Organization Lecture 14

Copyright 2012, Elsevier Inc. All rights reserved.

CS 61C: Great Ideas in Computer Architecture. Virtual Memory

CS 152 Computer Architecture and Engineering. Lecture 9 - Virtual Memory

virtual memory. March 23, Levels in Memory Hierarchy. DRAM vs. SRAM as a Cache. Page 1. Motivation #1: DRAM a Cache for Disk

ECE4680 Computer Organization and Architecture. Virtual Memory

ecture 33 Virtual Memory Friedland and Weaver Computer Science 61C Spring 2017 April 12th, 2017

Memory latency: Affects cache miss penalty. Measured by:

Memory. Principle of Locality. It is impossible to have memory that is both. We create an illusion for the programmer. Employ memory hierarchy

Copyright 2012, Elsevier Inc. All rights reserved.

Computer Architecture. A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

Memory Hierarchy and Caches

Transcription:

Chapter 5B Large and Fast: Exploiting Memory Hierarchy

One Transistor Dynamic RAM 1-T DRAM Cell word access transistor V REF TiN top electrode (V REF ) Ta 2 O 5 dielectric bit Storage capacitor (FET gate, trench, stack) poly word line W bottom electrode access transistor Chapter 5 Large and Fast: Exploiting Memory Hierarchy 2

DRAM Cell Layout: 8F 2 Chapter 5 Large and Fast: Exploiting Memory Hierarchy 3

DRAM Cell Layout: 8F 2 2F 4F Source: CMOS Circuit Design, Layout, and Simulation - Baker

DRAM Cell Layout: 6F 2 Chapter 5 Large and Fast: Exploiting Memory Hierarchy 5

SRAM Cell Layout: 140F 2 Source: CMOS Circuit Design, Layout, and Simulation - Baker

DRAM Architecture Col. 1 bit lines Col. N+M N M Row Address Decoder Column Decoder & Sense Amplifiers 2 M Row 1 word lines Row 2 N Memory cell (one bit) Data D Bits stored in 2-dimensional arrays on chip Modern chips have around 4-8 logical banks on each chip each logical bank physically implemented as many smaller arrays Chapter 5 Large and Fast: Exploiting Memory Hierarchy 7

DRAM Packaging ~7 Clock and control signals Address lines multiplexed row/column address ~12 Data bus (4b,8b,16b,32b) DRAM chip DIMM (Dual Inline Memory Module) contains multiple chips with clock/control/address signals connected in parallel (sometimes need buffers to drive signals to all chips) Data pins work together to return wide word (e.g., 64-bit data bus using 16x4-bit parts) Chapter 5 Large and Fast: Exploiting Memory Hierarchy 8

DRAM Packaging, Mobile Devices [ Apple A4 package on circuit board] Two stacked DRAM die Processor plus logic die [ Apple A4 package cross-section, ifixit 2010 ] Chapter 5 Large and Fast: Exploiting Memory Hierarchy 9

DRAM Operation Three steps in read/write access to a given bank Row access (RAS) Column access (CAS) Precharge: charges bit lines to known value, required before next row access Each step has a latency of around 15-20ns in modern DRAMs Various DRAM standards (DDR, RDRAM) have different ways of encoding the signals for transmission to the DRAM, but all share same core architecture Chapter 5 Large and Fast: Exploiting Memory Hierarchy 10

Row Access (RAS) decode row address, enable addressed row (often multiple Kb in row) bitlines share charge with storage cell small change in voltage detected by sense amplifiers which latch whole row of bits sense amplifiers drive bitlines full rail to recharge storage cells Chapter 5 Large and Fast: Exploiting Memory Hierarchy 11

Column Access (CAS) decode column address to select small number of sense amplifier latches (4, 8, 16, or 32 bits depending on DRAM package) on read, send latched bits out to chip pins on write, change sense amplifier latches which then charge storage cells to required value can perform sequentially multiple column accesses on same row without another row access (burst mode) Chapter 5 Large and Fast: Exploiting Memory Hierarchy 12

Double-Data Rate (DDR2) DRAM Row Column Precharge Row 200MHz Clock [ Micron, 256Mb DDR2 SDRAM datasheet ] Data 400Mb/s Data Rate Chapter 5 Large and Fast: Exploiting Memory Hierarchy 13

CPU-Memory Bottleneck CPU Memory Performance of high-speed computers is usually limited by memory bandwidth & latency Latency (time for a single access) Memory access time >> Processor cycle time Bandwidth (number of accesses per unit time) if fraction m of instructions access memory, 1+m memory references / instruction CPI = 1 requires 1+m memory refs / cycle (assuming MIPS RISC ISA) Chapter 5 Large and Fast: Exploiting Memory Hierarchy 14

Causes for Cache Misses Compulsory miss: first-reference to a block a.k.a. cold start misses - Occurs because all blocks are invalid at the beginning. - misses that would occur even with infinite cache Capacity miss: cache is too small to hold all data needed by the program - Occurs if the number of different blocks in requests is more than the number of blocks in the cache Conflict miss: misses that occur because of collisions due to block-placement strategy - Occurs if the number of requests for a specific set is more than its way number. - misses that would not occur with full associativity Chapter 5 Large and Fast: Exploiting Memory Hierarchy 15

Effect of Cache Parameters Larger cache size + reduces capacity and conflict misses - hit time will increase Higher associativity + reduces conflict misses - may increase hit time Larger block size + reduces compulsory and capacity misses - increases conflict misses and miss penalty Chapter 5 Large and Fast: Exploiting Memory Hierarchy 16

Virtual Memory Use main memory as a cache for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main memory Each gets a private virtual address space holding its frequently used code and data Protected from other programs CPU and OS translate virtual addresses to physical addresses VM block is called a page VM translation miss is called a page fault 5.4 Virtual Memory Chapter 5 Large and Fast: Exploiting Memory Hierarchy 17

Absolute Addresses EDSAC, early 50 s Only one program ran at a time, with unrestricted access to entire machine (RAM + I/O devices) Addresses in a program depended upon where the program was to be loaded in memory But it was more convenient for programmers to write location-independent subroutines How could location independence be achieved? No absolute address in code; use only relative address Linker and/or loader modify addresses of subroutines and callers when building a program memory image Chapter 5 Large and Fast: Exploiting Memory Hierarchy 18

Bare Machine PC Physical Address Inst. Cache D Decode E + M Physical Address Data Cache W Physical Address Memory Controller Main Memory (DRAM) Physical Address Physical Address In a bare machine, the only kind of address is a physical address: no address translation Chapter 5 Large and Fast: Exploiting Memory Hierarchy 19

Memory Management From early absolute addressing schemes, to modern virtual memory systems with support for virtual machine monitors (VMMs) Can separate into orthogonal functions: Translation (mapping of virtual address to physical address) Protection (permission to access word in memory) Virtual memory (transparent extension of memory space using slower disk storage) But most modern systems provide support for all the above functions with a single page-based system Chapter 5 Large and Fast: Exploiting Memory Hierarchy 20

Protection The first motivation for virtual memory A set of mechanisms for ensuring that multiple processes sharing the processor, memory, or I/O devices cannot interfere with one another by reading or writing each other s data. These mechanisms also isolate the OS from a user process. Chapter 5 Large and Fast: Exploiting Memory Hierarchy 21

Overlay Programmers divided program into pieces and then identified the pieces that were mutually exclusive. These overlays were loaded or unloaded under user program control during execution, with the programmer ensuring that the program never exceeded the total size of the memory. Overlays were traditionally organized as modules, each containing both code and data. Sharing was not the reason that virtual memory was invented! Chapter 5 Large and Fast: Exploiting Memory Hierarchy 22

Overlay The second motivation for virtual memory To allow a single user program to exceed the size of primary memory Relocation: the same program can run any position in physical memory Chapter 5 Large and Fast: Exploiting Memory Hierarchy 23

Dynamic Address Translation Motivation In the early machines, I/O operations were slow and each word transferred involved the CPU Higher throughput if CPU and I/O of 2 or more programs were overlapped. How? multiprogramming with DMA I/O devices, interrupts Location-independent programs Programming and storage management ease need for a base register Protection Independent programs should not affect each other inadvertently need for a bound register Multiprogramming drives requirement for resident supervisor software to manage context switches between multiple programs prog1 prog2 OS Physical Memory Chapter 5 Large and Fast: Exploiting Memory Hierarchy 24

Segmentation vs Paging Note that paging uses fixed-size blocks Segmentation: a variable-size block scheme A segmentation number and a segmentation offset A bound check is also needed to make sure that the offset is within the segment The major use of segmentation to support more powerful methods of protection and sharing in an address space The major disadvantage of segmentation It splits the address space into logically separate pieces (segments) that must be manipulated as a twopart address (base and bound addresses). Chapter 5 Large and Fast: Exploiting Memory Hierarchy 25

Base and Bound Registers Load X Program Address Space Bound Register Effective Address Base Register Segment Length + Bounds Violation? Physical Address Base Physical Address current segment Base and bounds registers are visible/accessible only when processor is running in the supervisor mode Physical Memory Chapter 5 Large and Fast: Exploiting Memory Hierarchy 26

Separate Areas for Program and Data Load X Program Address Space Data Bound Register Mem. Address Register Data Base Register Program Bound Register Program Counter Program Base Register Logical Address Logical Address + + Bounds Violation? Physical Address Bounds Violation? Physical Address data segment program segment Main Memory What is an advantage of this separation? 1. protection 2. permit sharing program segments Chapter 5 Large and Fast: Exploiting Memory Hierarchy 27

Base and Bound Machine Prog. Bound Register Logical Address Bounds Violation? Data Bound Register Logical Address Bounds Violation? PC + Program Base Register Physical Address Inst. Cache Physical Address D Decode E + M Memory Controller Data Base Register + Physical Address Physical Address Data Cache W Physical Address Main Memory (DRAM) Chapter 5 Large and Fast: Exploiting Memory Hierarchy 28

Memory Fragmentation OS Space Users 4 & 5 arrive OS Space Users 2 & 5 leave OS Space free user 1 user 2 user 3 16K 24K 24K 32K user 1 user 2 user 4 user 3 16K 24K 16K 8K 32K user 1 user 4 user 3 16K 24K 16K 8K 32K 24K user 5 24K 24K As users come and go, the storage is external fragmented. Therefore, at some stage programs have to be moved around to compact the storage. Chapter 5 Large and Fast: Exploiting Memory Hierarchy 29

Address Translation An event that occurs when an accessed page is not present in main memory page fault shared page Chapter 5 Large and Fast: Exploiting Memory Hierarchy 30

Address Translation A address space: 4 GB Which is larger between a virtual address space and a physical address space? By page tables A page: 4 KB A address space: 1 GB Chapter 5 Large and Fast: Exploiting Memory Hierarchy 31

Paged Memory Systems Processor-generated address can be split into: page number offset A page table contains the physical address of the base of each page: 0 1 2 3 Address Space of User-1 0 1 2 3 Page Table of User-1 Page tables make it possible to store the pages of a program non-contiguously. 1 0 3 2 Physical Memory Chapter 5 Large and Fast: Exploiting Memory Hierarchy 32

Private Address Space per User User 1 VA1 OS pages Page Table User 2 User 3 VA1 VA1 Page Table Physical Memory Page Table free Each user has a page table Page table contains an entry for each user page Chapter 5 Large and Fast: Exploiting Memory Hierarchy 33

Where Do Page Tables Reside? Space required by the page tables (PT) is proportional to the address space, number of users,... Space requirement is huge Simple idea: Keep PTs in the main memory needs one reference to retrieve the page base address and another to access the data word doubles the number of memory references! Chapter 5 Large and Fast: Exploiting Memory Hierarchy 34

Page Tables in Physical Memory address translation PT User 1 VA1 User 1 Virtual Address Space PT User 2 Physical Memory VA1 memory access User 2 Virtual Address Space Chapter 5 Large and Fast: Exploiting Memory Hierarchy 35

Page Fault Penalty On page fault, the page must be fetched from disk Takes millions of clock cycles Handled by OS code (software) because its overhead is small compared to the disk access time Try to minimize page fault rate Fully associative placement of pages in memory Can be placed anywhere in main memory Smart replacement algorithms (e.g. LRU) can be used Write-through will not work since writes take too long. Instead, write-back is used in virtual memory Chapter 5 Large and Fast: Exploiting Memory Hierarchy 36

Fully associative replacement A page can be anywhere in the main memory A full search by comparing a tag is impractical In virtual memory we locate pages by using a table that indexes pages in the memory This structure is called a page table. The page table stores placement information Each page table entry (PTE) is indexed by virtual page number A page table base register in CPU points to the starting address of the page table in the main memory Chapter 5 Large and Fast: Exploiting Memory Hierarchy 37

PTE If the page is present in memory, its PTE stores the physical page number and status bits (referenced, dirty, ) If the page is not present in memory, its PTE can refer to a location in the swap space on disk Chapter 5 Large and Fast: Exploiting Memory Hierarchy 38

Mapping Pages to Storage In many systems, the table of physical page addresses and disk page addresses, while logically one table, is stored in two separate data structures. Dual tables are justified in part because we must keep the disk addresses of all the pages, even if they are currently in main memory. Chapter 5 Large and Fast: Exploiting Memory Hierarchy 39

Linear Page Table Page Table Entry (PTE) contains: A bit to indicate if a page exists in main memory PPN (physical page number) for a memory-resident page DPN (disk page number) for a page on the disk Status bits for protection and usage OS sets the Page Table Base Register whenever active user process changes DPN PPN PPN PT Base Register Page Table PPN PPN DPN PPN DPN PPN PPN DPN DPN VPN Offset VPN Offset Virtual address Data Pages Data word Chapter 5 Large and Fast: Exploiting Memory Hierarchy 40

Replacement and Writes To reduce page fault rate, prefer leastrecently used (LRU) replacement Reference bit (aka use bit) in PTE set to 1 on access to page Periodically cleared to 0 by OS A page with reference bit = 0 has not been used recently Disk writes take millions of cycles Write in Block at once, not in location Write through is impractical Use write-back Dirty bit in PTE set when page is written Chapter 5 Large and Fast: Exploiting Memory Hierarchy 41

Size of Linear Page Table With 32-bit addresses, 4-KB pages & 4-byte PTEs: 2 20 PTEs, i.e, 4 MB page table per user 4 GB (2 32 ) of swap needed to back up full virtual address space Larger pages? Internal fragmentation (Not all memory in page is used) Larger page fault penalty (more time to read from disk) What about 64-bit virtual address space??? Even 1MB pages would require 2 44 8-byte PTEs (35 TB!) What is the saving grace? Chapter 5 Large and Fast: Exploiting Memory Hierarchy 42

Hierarchical Page Table Virtual Address 31 22 21 12 11 p1 p2 offset 0 10-bit L1 index 10-bit L2 index offset Root of the Current Page Table (Processor Register) p1 Level 1 Page Table p2 Physical Memory page in primary memory page in secondary memory Level 2 Page Tables PTE of a nonexistent page Data Pages Chapter 5 Large and Fast: Exploiting Memory Hierarchy 43

Two-Level Page Tables Physical Memory VA1 p1 Level 1 PT User 1 User 1 p2 VA1 User 2 Level 2 PT User 1 offset User2/VA1 User1/VA1 Virtual 31 22 21 12 11 Address Spaces p1 p2 offset 0 10-bit L1 index 10-bit L2 index Chapter 5 Large and Fast: Exploiting Memory Hierarchy 44

Address Translation & Protection Kernel/User Mode Virtual Address Virtual Page No. (VPN) offset Read/Write Protection Check Address Translation Exception? Physical Address Physical Page No. (PPN) offset Every instruction and data access needs address translation and protection checks A good VM design needs to be fast (~ one cycle) and space efficient Chapter 5 Large and Fast: Exploiting Memory Hierarchy 45

Translation Using a Page Table (page table pointer) the starting address 1 M entries, which corresponds to 256 pages, assuming that each entry is 32-bit. too big to be all entries in the memory Each entry would typically be rounded up to 32 bits for ease of indexing. The extra bits for protections. Chapter 5 Large and Fast: Exploiting Memory Hierarchy 46

Fast Translation Using a TLB Address translation would appear to require extra memory references One to access the PTE Then the actual memory access But access to page tables has good (?) locality So use a translation cache (a fast cache of the page table) within the CPU Called a Translation Look-aside Buffer (TLB) Typical: 16 512 PTEs, 0.5 1 cycle for hit, 10 100 cycles for miss, 0.01% 1% miss rate TLB Misses could be handled by hardware or software Chapter 5 Large and Fast: Exploiting Memory Hierarchy 47

Translation Lookaside Buffers Address translation is very expensive! In a two-level page table, each reference becomes several memory accesses Solution: Cache translations in TLB TLB hit TLB miss Single-Cycle Translation Page-Table Walk to refill TLB virtual address VPN offset V R W D tag PPN TLB TLB hit? physical address PPN offset Chapter 5 Large and Fast: Exploiting Memory Hierarchy 48

Fast Translation Using a TLB A cache that contains a subset of the page table If there is no matching entry in the TLB for a page, the page table must be examined. Since the page table has an entry for every virtual page, no tag field is needed Chapter 5 Large and Fast: Exploiting Memory Hierarchy 49