ECE232: Hardware Organization and Design

Similar documents
Virtual Memory - Objectives

Memory Hierarchy. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

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

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

ECE331: Hardware Organization and Design

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

Virtual Memory. Adapted from instructor s supplementary material from Computer. Patterson & Hennessy, 2008, MK]

5DV118 Computer Organization and Architecture Umeå University Department of Computing Science Stephen J. Hegner

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

1. Creates the illusion of an address space much larger than the physical memory

The Memory Hierarchy. Cache, Main Memory, and Virtual Memory (Part 2)

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

CISC 662 Graduate Computer Architecture Lecture 16 - Cache and virtual memory review

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Virtual Memory, Address Translation

Virtual Memory. Virtual Memory

Memory Hierarchy Y. K. Malaiya

Transistor: Digital Building Blocks

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Virtual Memory, Address Translation

CS 333 Introduction to Operating Systems. Class 11 Virtual Memory (1) Jonathan Walpole Computer Science Portland State University

EEC 483 Computer Organization. Chapter 5.3 Measuring and Improving Cache Performance. Chansu Yu

ADDRESS TRANSLATION AND TLB

Translation Buffers (TLB s)

CS/ECE 3330 Computer Architecture. Chapter 5 Memory

Memory Hierarchy Computing Systems & Performance MSc Informatics Eng. Memory Hierarchy (most slides are borrowed)

ADDRESS TRANSLATION AND TLB

Memory Hierarchy Computing Systems & Performance MSc Informatics Eng. Memory Hierarchy (most slides are borrowed)

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

CS 153 Design of Operating Systems Winter 2016

Chapter 5. Large and Fast: Exploiting Memory Hierarchy. Jiang Jiang

Memory hier ar hier ch ar y ch rev re i v e i w e ECE 154B Dmitri Struko Struk v o

Virtual Memory. Motivation:

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner

Virtual Memory: From Address Translation to Demand Paging

Virtual Memory Review. Page faults. Paging system summary (so far)

Memory hierarchy review. ECE 154B Dmitri Strukov

Computer Structure. X86 Virtual Memory and TLB

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

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

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

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

Module 2: Virtual Memory and Caches Lecture 3: Virtual Memory and Caches. The Lecture Contains:

LECTURE 12. Virtual Memory

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

Main Memory (Fig. 7.13) Main Memory

SE-292 High Performance Computing. Memory Hierarchy. R. Govindarajan

ECE331: Hardware Organization and Design

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

CPS 104 Computer Organization and Programming Lecture 20: Virtual Memory

CSE 141 Computer Architecture Spring Lectures 17 Virtual Memory. Announcements Office Hour

ECE331: Hardware Organization and Design

CSE 120 Principles of Operating Systems Spring 2017

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

CS3350B Computer Architecture

DAT (cont d) Assume a page size of 256 bytes. physical addresses. Note: Virtual address (page #) is not stored, but is used as an index into the table

EN1640: Design of Computing Systems Topic 06: Memory System

Pipelined processors and Hazards

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

Memory Hierarchy. Goal: Fast, unlimited storage at a reasonable cost per bit.

CS162 - Operating Systems and Systems Programming. Address Translation => Paging"

ECE7995 (6) Improving Cache Performance. [Adapted from Mary Jane Irwin s slides (PSU)]

Virtual Memory. User memory model so far:! In reality they share the same memory space! Separate Instruction and Data memory!!

CSF Improving Cache Performance. [Adapted from Computer Organization and Design, Patterson & Hennessy, 2005]

VIRTUAL MEMORY II. Jo, Heeseung

HY225 Lecture 12: DRAM and Virtual Memory

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

Virtual Memory Nov 9, 2009"

Virtual Memory. Samira Khan Apr 27, 2017

Lecture 21: Virtual Memory. Spring 2018 Jason Tang

CS399 New Beginnings. Jonathan Walpole

Memory Hierarchy Requirements. Three Advantages of Virtual Memory

ECE468 Computer Organization and Architecture. Virtual Memory


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

UC Berkeley CS61C : Machine Structures

CSE 120 Principles of Operating Systems

ECE4680 Computer Organization and Architecture. Virtual Memory

Address Translation. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Page 1. Memory Hierarchies (Part 2)

Morgan Kaufmann Publishers 26 February, COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 5.

Virtual Memory: From Address Translation to Demand Paging

MEMORY HIERARCHY BASICS. B649 Parallel Architectures and Programming

UC Berkeley CS61C : Machine Structures

ECE 571 Advanced Microprocessor-Based Design Lecture 12

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Virtual Memory Overview

Modern Computer Architecture

Virtual Memory. CS 3410 Computer System Organization & Programming. [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon]

Computer Systems. Virtual Memory. Han, Hwansoo

CS 318 Principles of Operating Systems

CSE 451: Operating Systems Winter Page Table Management, TLBs and Other Pragmatics. Gary Kimura

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

ECE 571 Advanced Microprocessor-Based Design Lecture 13

CS152 Computer Architecture and Engineering Lecture 18: Virtual Memory

Chapter 5B. Large and Fast: Exploiting Memory Hierarchy

A Few Problems with Physical Addressing. Virtual Memory Process Abstraction, Part 2: Private Address Space

Operating Systems, Fall

Operating Systems, Fall

Topic 18 (updated): Virtual Memory

Transcription:

ECE232: Hardware Organization and Design Lecture 28: More Virtual Memory Adapted from Computer Organization and Design, Patterson & Hennessy, UCB

Overview Virtual memory used to protect applications from each other Portions of application located both in main memory and on disk Need to speed up access for virtual memory Idea: use a small cache to store translation for frequently used pages ECE232: More Virtual Memory 2

How to Translate Fast? Problem: Virtual Memory requires two memory accesses! one to translate Virtual Address into Physical Address (page table lookup) - Page Table is in physical memory one to transfer the actual data (hopefully cache hit) VM hierarchy only or Cache-memory-disk hierarchy Why not create a cache of virtual to physical address translations to make translation fast? (smaller is faster) For historical reasons, such a page table cache is called a Translation Lookaside Buffer, or TLB Memory CPU ECE232: More Virtual Memory 3

Translation-Lookaside Buffer (TLB) Physical Page 0 of page 1 Physical Page 1 Physical Page N-1 Main Memory H. Stone, High Performance Computer Architecture, AW 1993 ECE232: More Virtual Memory 4

TLB and Page Table ECE232: More Virtual Memory 5

Translation Look-Aside Buffers TLB is usually small, typically 32-512 entries Like any other cache, the TLB can be fully associative, set associative, or direct mapped data data Processor virtual addr. physical addr. hit hit miss TLB Cache Main miss Memory Page Table OS Fault Handler page fault/ protection violation Disk Memory ECE232: More Virtual Memory 6

Steps in Memory Access - Example data data CPU virtual addr. physical addr. hit hit miss TLB Cache Main miss Memory Page Table OS Fault Handler Disk Memory ECE232: More Virtual Memory 7

Virtual Address 31 30 29 15 14 13 12 11 10 9 8 3 2 1 0 DECStation 3100/ MIPS R2000 Virtual page number Page offset 20 12 TLB Valid Dirty Tag Physical page number TLB hit 64 entries, fully associative 20 Physical Address Physical page number Page offset Physical address tag Cache index 16 14 2 Byte offset Valid Tag Data Cache 16K entries, direct mapped 32 ECE232: Cache More hit Virtual Memory 8 Data

Real Stuff: Pentium Pro Memory Hierarchy Address Size: 32 bits (VA, PA) VM Page Size: 4 KB TLB organization: separate i,d TLBs (i-tlb: 32 entries, d-tlb: 64 entries) 4-way set associative LRU approximated hardware handles miss L1 Cache: 8 KB, separate i,d 4-way set associative LRU approximated 32 byte block write back L2 Cache: 256 or 512 KB ECE232: More Virtual Memory 9

Intel Nehalim quad-core processor 13.5 19.6 mm die; 731 million transistors; Two 128-bit memory channels Each processor has: private 32-KB instruction and 32-KB data caches and a 512-KB L2 cache. The four cores share an 8-MB L3 cache. Each core also has a two-level TLB. ECE232: More Virtual Memory 10

Comparing Intel s Nehalim to AMD s Opteron Intel Nehalem AMD Opteron X4 Virtual addr 48 bits 48 bits Physical addr 44 bits 48 bits Page size 4KB, 2/4MB 4KB, 2/4MB L1 TLB (per core) L1 I-TLB: 128 entries L1 D-TLB: 64 entries Both 4-way, LRU replacement L1 I-TLB: 48 entries L1 D-TLB: 48 entries Both fully associative, LRU replacement L2 TLB (per core) Single L2 TLB: 512 entries 4-way, LRU replacement L2 I-TLB: 512 entries L2 D-TLB: 512 entries Both 4-way, round-robin LRU TLB misses Handled in hardware Handled in hardware ECE232: More Virtual Memory 11

Further Comparison L1 caches (per core) L2 unified cache (per core) L3 unified cache (shared) Intel Nehalem L1 I-cache: 32KB, 64-byte blocks, 4-way, approx LRU, hit time n/a L1 D-cache: 32KB, 64- byte blocks, 8-way, approx LRU, write-back/allocate, hit time n/a 256KB, 64-byte blocks, 8- way, approx LRU, writeback/allocate, hit time n/a 8MB, 64-byte blocks, 16- way, write-back/allocate, hit time n/a AMD Opteron X4 L1 I-cache: 32KB, 64-byte blocks, 2-way, LRU, hit time 3 cycles L1 D-cache: 32KB, 64- byte blocks, 2-way, LRU, write-back/allocate, hit time 9 cycles 512KB, 64-byte blocks, 16-way, approx LRU, write-back/allocate, hit time n/a 2MB, 64-byte blocks, 32- way, write-back/allocate, hit time 32 cycles ECE232: More Virtual Memory 12

Summary Virtual memory allows the appearance of a main memory that is larger than what is physically present Virtual memory can be shared by multiple applications Page table indicates how to translate from virtual to physical address TLB speeds up access to virtual memory Generally set associative or fully associative Much smaller than main memory Next time: Putting it all together (cache, TLB, virtual memory) ECE232: More Virtual Memory 13