CMSC 611: Advanced Computer Architecture

Slides:



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

CMSC 611: Advanced Computer Architecture Cache Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from.
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.
CMSC 611: Advanced Computer Architecture Memory & Virtual Memory Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material.
CSIE30300 Computer Architecture Unit 10: Virtual Memory Hsin-Chou Chi [Adapted from material by and
Virtual Memory Hardware Support
Cs 325 virtualmemory.1 Accessing Caches in Virtual Memory Environment.
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.
Computer ArchitectureFall 2008 © November 10, 2007 Nael Abu-Ghazaleh Lecture 23 Virtual.
Computer ArchitectureFall 2007 © November 21, 2007 Karem A. Sakallah Lecture 23 Virtual Memory (2) CS : Computer Architecture.
Translation Buffers (TLB’s)
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed, Nov 9, 2005 Topic: Caches (contd.)
Memory: Virtual MemoryCSCE430/830 Memory Hierarchy: Virtual Memory CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu.
ENGS 116 Lecture 131 Caches and Virtual Memory Vincent H. Berk October 31 st, 2008 Reading for Today: Sections C.1 – C.3 (Jouppi article) Reading for Monday:
©UCB CS 161 Ch 7: Memory Hierarchy LECTURE 24 Instructor: L.N. Bhuyan
Computer Architecture Lecture 28 Fasih ur Rehman.
CSE431 L22 TLBs.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 22. Virtual Memory Hardware Support Mary Jane Irwin (
Lecture 19: Virtual Memory
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
Lecture 9: Memory Hierarchy Virtual Memory Kai Bu
Virtual Memory Expanding Memory Multiple Concurrent Processes.
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)
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
MBG 1 CIS501, Fall 99 Lecture 11: Memory Hierarchy: Caches, Main Memory, & Virtual Memory Michael B. Greenwald Computer Architecture CIS 501 Fall 1999.
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.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
1 Adapted from UC Berkeley CS252 S01 Lecture 17: Reducing Cache Miss Penalty and Reducing Cache Hit Time Hardware prefetching and stream buffer, software.
CS203 – Advanced Computer Architecture Virtual Memory.
Memory Hierarchy— Five Ways to Reduce Miss Penalty.
CMSC 611: Advanced Computer Architecture Memory & Virtual Memory Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material.
CS161 – Design and Architecture of Computer
Memory: Page Table Structure
Translation Lookaside Buffer
Vivek Seshadri 15740/18740 Computer Architecture
ECE232: Hardware Organization and Design
Memory COMPUTER ARCHITECTURE
COMP SYSTEM ARCHITECTURE
CS161 – Design and Architecture of Computer
CS703 - Advanced Operating Systems
Today How was the midterm review? Lab4 due today.
CS 704 Advanced Computer Architecture
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 Hierarchy Virtual Memory, Address Translation
Morgan Kaufmann Publishers
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Evolution in Memory Management Techniques
CMSC 611: Advanced Computer Architecture
Lecture 29: Virtual Memory-Address Translation
CMSC 611: Advanced Computer Architecture
Translation Lookaside Buffer
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Translation Buffers (TLB’s)
Virtual Memory Overcoming main memory size limitation
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Summary 3 Cs: Compulsory, Capacity, Conflict Misses Reducing Miss Rate
© 2004 Ed Lazowska & Hank Levy
Translation Buffers (TLB’s)
CSC3050 – Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CS703 - Advanced Operating Systems
Translation Buffers (TLBs)
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.
Virtual Memory.
Synonyms v.p. x, process A v.p # index Map to same physical page
Review What are the advantages/disadvantages of pages versus segments?
Presentation transcript:

CMSC 611: Advanced Computer Architecture Memory & Virtual Memory Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / © 2003 Elsevier Science

Avoiding Address Translation Send virtual address to cache? Called Virtually Addressed Cache or just Virtual Cache vs. Physical Cache Every time process is switched logically must flush the cache; otherwise get false hits Cost is time to flush + “compulsory” misses from empty cache Dealing with aliases (sometimes called synonyms) Two different virtual addresses map to same physical address causing unnecessary read misses or even RAW I/O must interact with cache, so need virtual address

Solutions Solution to aliases Solution to cache flush HW guarantees that every cache block has unique physical address (simply check all cache entries) SW guarantee: lower n bits must have same address so that it overlaps with index; as long as covers index field & direct mapped, they must be unique; called page coloring Solution to cache flush Add process identifier tag that identifies process as well as address within process: cannot get a hit if wrong process

Impact of Using Process ID Miss rate vs. virtually addressed cache size of a program measured three ways: Without process switches (uniprocessor) With process switches using a PID tag (PID) With process switches but without PID (purge)

Virtually Addressed Caches VA: Virtual address TB: Translation buffer PA: Page address CPU CPU CPU VA VA VA VA Tags TB $ VA Tags $ TB PA VA PA L2 $ $ TB MEM PA PA MEM MEM Overlap $ access with VA translation: requires $ index to remain invariant across translation Conventional Organization Virtually Addressed Cache Translate only on miss Synonym Problem

Indexing via Physical Addresses If index is physical part of address, can start tag access in parallel with translation To get the best of the physical and virtual caches, use the page offset (not affected by the address translation) to index the cache The drawback is that direct-mapped caches cannot be bigger than the page size (typically 4-KB) To support bigger caches and use same technique: Use higher associativity since the tag size gets smaller OS implements page coloring since it will fix a few least significant bits in the address (move part of the index to the tag)

TLB and Cache in MIPS Fully associative TLB Address translation and block identification Direct-mapped Cache

TLB and Cache in MIPS A cache hit can only occur after TLB hit (TLB miss & No Page fault  load page address to TLB) Write-through cache

Memory Related Exceptions Possible exceptions: Cache miss: referenced block not in cache and needs to be fetched from main memory TLB miss: referenced page of virtual address needs to be checked in the page table Page fault: referenced page is not in main memory and needs to be copied from disk

Memory Protection Want to prevent a process from corrupting memory space of other processes Privileged and non-privileged execution Implementation can map independent virtual pages to separate physical pages Write protection bits in the page table for authentication Sharing pages through mapping virtual pages of different processes to same physical pages

Memory Protection To enable the operating system to implement protection, the hardware must provide at least the following capabilities: Support at least two mode of operations, one of them is a user mode Provide a portion of CPU state that a user process can read but not write, e.g. page pointer and TLB Enable change of operation modes through special instructions