Virtual to Physical Address Translation Effective Address TLB Lookup Page Table Walk Update TLBPage Fault OS Table Walk Protection Check Physical Address.

Slides:



Advertisements
Similar presentations
Lecture 12 Reduce Miss Penalty and Hit Time
Advertisements

EECS 470 Virtual Memory Lecture 15. Why Use Virtual Memory? Decouples size of physical memory from programmer visible virtual memory Provides a convenient.
Computer Organization CS224 Fall 2012 Lesson 44. Virtual Memory  Use main memory as a “cache” for secondary (disk) storage l Managed jointly by CPU hardware.
Cs 325 virtualmemory.1 Accessing Caches in Virtual Memory Environment.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Virtual Memory I Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590 Computer Architecture Virtual Memory II
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Virtual Memory 2 P & H Chapter
CS 153 Design of Operating Systems Spring 2015
Spring 2003CSE P5481 Introduction Why memory subsystem design is important CPU speeds increase 55% per year DRAM speeds increase 3% per year rate of increase.
Replicated Block Cache... block_id d e c o d e r N=2 n direct mapped cache FAi1i2i b word lines Final Collapse Fetch Buffer c o p y - 2 c o p y - 3 c o.
Computer ArchitectureFall 2008 © November 10, 2007 Nael Abu-Ghazaleh Lecture 23 Virtual.
Memory Management and Paging CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Computer ArchitectureFall 2007 © November 21, 2007 Karem A. Sakallah Lecture 23 Virtual Memory (2) CS : Computer Architecture.
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Paging Design.
Principle Behind Hierarchical Storage  Each level memorizes values stored at lower levels  Instead of paying the full latency for the “furthermost” level.
Translation Buffers (TLB’s)
Memory: Virtual MemoryCSCE430/830 Memory Hierarchy: Virtual Memory CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu.
CS 61C: Great Ideas in Computer Architecture
Mem. Hier. CSE 471 Aut 011 Evolution in Memory Management Techniques In early days, single program run on the whole machine –Used all the memory available.
Lecture 15: Virtual Memory EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014, Dr.
1 Seoul National University Virtual Memory: Systems.
Operating Systems ECE344 Ding Yuan Paging Lecture 8: Paging.
Operating Systems COMP 4850/CISG 5550 Page Tables TLBs Inverted Page Tables Dr. James Money.
Virtual Memory Expanding Memory Multiple Concurrent Processes.
Virtual Memory Muhamed Mudawar CS 282 – KAUST – Spring 2010 Computer Architecture & Organization.
Virtual Memory Part 1 Li-Shiuan Peh Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology May 2, 2012L22-1
Virtual Memory. Virtual Memory: Topics Why virtual memory? Virtual to physical address translation Page Table Translation Lookaside Buffer (TLB)
Malloc & VM By sseshadr. Agenda Administration – Process lab code will be inked by Thursday (pick up in ECE hub) – Malloc due soon (Thursday, November.
Constructive Computer Architecture Virtual Memory and Interrupts Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology.
Chapter 5 Memory III CSE 820. Michigan State University Computer Science and Engineering Miss Rate Reduction (cont’d)
Improving Cache Performance Four categories of optimisation: –Reduce miss rate –Reduce miss penalty –Reduce miss rate or miss penalty using parallelism.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
Constructive Computer Architecture Virtual Memory: From Address Translation to Demand Paging Arvind Computer Science & Artificial Intelligence Lab. Massachusetts.
1 Lecture: Virtual Memory, DRAM Main Memory Topics: virtual memory, TLB/cache access, DRAM intro (Sections 2.2)
Virtual Memory 1 Computer Organization II © McQuain Virtual Memory Use main memory as a “cache” for secondary (disk) storage – Managed jointly.
Memory Hierarchy— Five Ways to Reduce Miss Penalty.
Translation Lookaside Buffer
CMSC 611: Advanced Computer Architecture
COSC6385 Advanced Computer Architecture Lecture 7. Virtual Memory
Vivek Seshadri 15740/18740 Computer Architecture
Virtual Memory Chapter 7.4.
Section 9: Virtual Memory (VM)
From Address Translation to Demand Paging
Section 9: Virtual Memory (VM)
From Address Translation to Demand Paging
Today How was the midterm review? Lab4 due today.
CS 704 Advanced Computer Architecture
Memory Hierarchy Virtual Memory, Address Translation
CS510 Operating System Foundations
CSE 153 Design of Operating Systems Winter 2018
Lecture 28: Virtual Memory-Address Translation
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011
From Address Translation to Demand Paging
Evolution in Memory Management Techniques
Translation Lookaside Buffer
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Virtual Memory Overcoming main memory size limitation
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSC3050 – Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CS703 - Advanced Operating Systems
CSE 153 Design of Operating Systems Winter 2019
CS161 – Design and Architecture of Computer
Sarah Diesburg Operating Systems CS 3430
Andy Wang Operating Systems COP 4610 / CGS 5765
Sarah Diesburg Operating Systems COP 4610
Presentation transcript:

Virtual to Physical Address Translation Effective Address TLB Lookup Page Table Walk Update TLBPage Fault OS Table Walk Protection Check Physical Address To Cache miss hit succeed fail denied permitted Protection Fault  1 pclk 100’s pclk 10000’s pclk

Cache Placement and Address Translation CPU Virtual Cache MMU Physical Memory VA PA CPU Physical Cache MMU Physical Memory VA PA Physical Cache (Most Systems) aliasing problem cold start after context switch longer hit time Virtual Cache (SPARC2’s) Virtual caches are not popular anymore because MMU and CPU can be integrated on one chip fetch critical path

Tag Index Page Offset (PO) TLB Phy. Page No. (PPN) PO Tag Index BO D-cache Data k g p Virtual Address (n=v+g bits) Physical Address (m=p+g bits) Virtual Page No. (VPN) v-k t i b Physically Indexed Cache

Virtually Indexed Cache Parallel Access to TLB and Cache arrays = Virtual Pg No. (VPN) Tag Index Page Offset TLB D-cache PPN Data Hit/Miss p p g k Index BO v-k i b p p Virtual Pg No. (VPN) How large can a virtually indexed cache get?

Large Virtually Indexed Cache = Virtual Pg No. (VPN) Tag Index Page Offset TLB D-cache PPN Data Hit/Miss p p g k Index BO v-k i b p p Virtual Pg No. (VPN) If two VPNs differs in a, but both map to the same PPN then there is an aliasing problem a

Synonym (or Aliasing)  When VPN bits are used in indexing, two virtual addresses that map to the same physical address can end up sitting in two cache lines  In other words, two copies of the same physical memory location may exist in the cache  modification to one copy won’t be visible in the other = Tag Index Page Offset D-cache PPN Data Hit/Miss p Index BO i b p Virtual Pg No. (VPN) a PPN from TLB If the two VPNs do not differ in a then there is no aliasing problem

R10000’s Virtually Index Caches  32KB 2-Way Virtually-Indexed L1 ­needs 10 bits of index and 4 bits of block offset ­page offset is only 12-bits  2 bits of index are VPN[1:0]  Direct-Mapped Physical L2 ­L2 is Inclusive of L1 ­VPN[1:0] is appended to the “tag” of L2  Given two virtual addresses VA and VB that differs in a and both map to the same physical address PA ­Suppose VA is accessed first so blocks are allocated in L1&L2 ­What happens when VB is referenced? 1 VB indexes to a different block in L1and misses 2 VB translates to PA and goes to the same block as VA in L2 3. Tag comparison fails (VA[1:0]  VB[1:0]) 4. Treated just like as a L2 conflict miss  VA’s entry in L1 and L2 are both ejected due to inclusion policy

Memory Dataflow Techniques I-cache FETCH DECODE COMMIT D-cache Branch Predictor Instruction Buffer Store Queue Reorder Buffer Integer Floating-point Media Memory Instruction Register Data Memory Data Flow EXECUTE (ROB) Flow

Uniprocessor Load and Store Semantics  Given Store i ( a, v ) << Load j ( a ) Load(a) must return v if there does not exist another Store k such that Store i ( a, v ) << Store k ( a, v’ ) << Load j (a)  This can be guaranteed by observing data dependence ­RAWStore(a, v) followed by Load( a ) ­WAWStore(a, v’ ) followed by Store(a, v ) ­WARLoad( a ) followed by Store( a, v’ ) For a uniprocessor, do we need to worry about loads and stores to different addresses? What about SMPs? (“<<“ means precedes)

Total Ordering of Loads and Stores  Keep all loads and stores totally in order with respect to each other  However, loads and stores can execute out of order with respect to other types of instructions (while obeying register data-dependence) Except, stores must still be held for all previous instructions

The “DAXPY” Example Y[ i ] = A * X[ i ] + Y[ i ] LD F0, a ADDI R4, Rx, #512; last address Loop: LD F2, 0(Rx); load X[ i ] MULTD F2, F0, F2; A*X[ i ] LD F4, 0(Ry); load Y[ i ] ADDD F4, F2, F4; A*X[ i ] + Y[ i ] SD F4, 0(Ry); store into Y[ i ] ADDI Rx, Rx, #8; inc. index to X ADDI Ry, Ry, #8; inc. index to Y SUB R20, R4, Rx; compute bound BNZ R20, loop; check if done LD MULTD ADDD SD ??