18-447 Computer Architecture Recitation 3 Presenter: Kevin Chang Prof. Onur Mutlu Carnegie Mellon University Spring 2015, 3/16/2015.

Slides:



Advertisements
Similar presentations
Virtual Memory In this lecture, slides from lecture 16 from the course Computer Architecture ECE 201 by Professor Mike Schulte are used with permission.
Advertisements

Virtual Memory Really this is in OS – but We need to see how the OS will interact with the HW Peer Instruction Lecture Materials for Computer Architecture.
Lecture 12 Reduce Miss Penalty and Hit Time
Virtual Memory. The Limits of Physical Addressing CPU Memory A0-A31 D0-D31 “Physical addresses” of memory locations Data All programs share one address.
CSIE30300 Computer Architecture Unit 10: Virtual Memory Hsin-Chou Chi [Adapted from material by and
Virtual to Physical Address Translation Effective Address TLB Lookup Page Table Walk Update TLBPage Fault OS Table Walk Protection Check Physical Address.
1 Memory Systems Virtual Memory Lecture 25 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Cs 325 virtualmemory.1 Accessing Caches in Virtual Memory Environment.
Malloc & VM By sseshadr. Agenda Administration – Process lab code will be inked by Thursday (pick up in ECE hub) – Malloc due soon (Thursday, November.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Virtual Memory I Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
Technical University of Lodz Department of Microelectronics and Computer Science Elements of high performance microprocessor architecture Virtual memory.
Principle Behind Hierarchical Storage  Each level memorizes values stored at lower levels  Instead of paying the full latency for the “furthermost” level.
ECE 232 L27.Virtual.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 27 Virtual.
©UCB CS 162 Ch 7: Virtual Memory LECTURE 13 Instructor: L.N. Bhuyan
Memory: Virtual MemoryCSCE430/830 Memory Hierarchy: Virtual Memory CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu.
©UCB CS 161 Ch 7: Memory Hierarchy LECTURE 24 Instructor: L.N. Bhuyan
EECS 370 Discussion 1 SMBC. EECS 370 Discussion Exam 2 Solutions posted online Will be returned in next discussion (12/9) – Grades hopefully up on CTools.
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
CSE431 L22 TLBs.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 22. Virtual Memory Hardware Support Mary Jane Irwin (
Carnegie Mellon /18-243: Introduction to Computer Systems Instructors: Bill Nace and Gregory Kesden (c) All Rights Reserved. All work.
1 Recitation #9, Section F, , Sp 06 Virtual memory Reminders: Quiz today: virtual memory Shell Lab due Thursday TA: Jernej Barbic Modified from:
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)
University of Amsterdam Computer Systems – virtual memory Arnoud Visser 1 Computer Systems Virtual Memory.
Virtual Memory Additional Slides Slide Source: Topics Address translation Accelerating translation with TLBs class12.ppt.
4.3 Virtual Memory. Virtual memory  Want to run programs (code+stack+data) larger than available memory.  Overlays programmer divides program into pieces.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
Lecture 17 Final Review Prof. Mike Schulte Computer Architecture ECE 201.
Carnegie Mellon 1 Bryant and O’Hallaron, Computer Systems: A Programmer’s Perspective, Third Edition Virtual Memory: Concepts Slides adapted from Bryant.
Carnegie Mellon Introduction to Computer Systems / Spring 2009 March 23, 2009 Virtual Memory.
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 Topics: virtual memory, TLB/cache access (Sections 2.2)
Memory Hierarchy and Cache Design (4). Reducing Hit Time 1. Small and Simple Caches 2. Avoiding Address Translation During Indexing of the Cache –Using.
CS203 – Advanced Computer Architecture Virtual Memory.
18-447: Computer Architecture Lecture 17: Virtual Memory II Yoongu Kim Carnegie Mellon University Spring 2013, 2/27.
Memory Hierarchy— Five Ways to Reduce Miss Penalty.
18-447: Computer Architecture Lecture 24: Advanced Caches Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 4/1/2013.
Computer Architecture Lecture 12: Virtual Memory I
CS161 – Design and Architecture of Computer
CMSC 611: Advanced Computer Architecture
COSC6385 Advanced Computer Architecture Lecture 7. Virtual Memory
Vivek Seshadri 15740/18740 Computer Architecture
Virtual Memory Samira Khan Apr 27, 2017.
Computer Architecture Lecture 20: Virtual Memory
ECE232: Hardware Organization and Design
CS161 – Design and Architecture of Computer
18-447: Computer Architecture Lecture 23: Caches
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
18-447: Computer Architecture Lecture 21: Virtual Memory
CSE 153 Design of Operating Systems Winter 2018
Guest Lecturer: Justin Hsia
CSCI206 - Computer Organization & Programming
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Page that info back into your memory!
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Translation Buffers (TLB’s)
Virtual Memory Overcoming main memory size limitation
CSE 153 Design of Operating Systems Winter 2019
Translation Buffers (TLBs)
CS161 – Design and Architecture of Computer
Review What are the advantages/disadvantages of pages versus segments?
4.3 Virtual Memory.
Design of Digital Circuits Lecture 25b: Virtual Memory
Presentation transcript:

Computer Architecture Recitation 3 Presenter: Kevin Chang Prof. Onur Mutlu Carnegie Mellon University Spring 2015, 3/16/2015

Assignment and Exam Reminders Lab 5: Due March 22 (Sunday)  Data cache HW 4: March 18 (Wednesday) Midterm 1: March 20 (Friday)  12:30 to 2:20pm  Arrive early, sit with one seat in between you and the next person  Closed book/notes, but you can bring a single 8.5 x 11 note sheet  Look over the past midterms 2

Mid-Semester Grade Average: 18.6 Median: 19.1 STDDEV: 4.8 3

Review of Last Lecture Virtual memory is a level of indirection that  Provides the illusion of a large address space while having a small physical memory 64-bit: ~16,000,000,000,000,000,000 (16 quintillion) bytes  This illusion is provided separately for each program Benefits of virtual memory  Efficiency through demand paging: Cache the pages that are accessed in memory from disk  Simplicity through automatic management by both SW and HW  Safety: Address space separation and per-page protection 4

Basic Mechanisms Virtual addresses are provided to a program Address translation: Virtual addresses  physical addresses Page table: The data structure that stores the translations  Problem 1: Too large Solution: Hierarchical page tables  Problem 2: Too slow Solution: Translation Lookaside Buffer (TLB) 5

Address Translation and Caching Cache: Virtually addressed or physically addressed  Virtual vs. physical cache Problem 1: Homonym  Same VA can map to different PAs  Reason: VA is in different processes Problem 2: Synonym  Different VAs can map to the same PA  Reason: Different virtual pages can share the same physical frame  Due to: Shared libraries, copy-on-write, etc. 6

Cache-VM Interaction 7 CPU TLB cache lower hier. CPU cache tlb lower hier. VA PA CPU cachetlb lower hier. VA PA VA PA physical cachevirtual (L1) cache virtual-physical cache

Cache-VM Interaction 8 CPU TLB cache lower hier. CPU cache tlb lower hier. VA PA CPU cachetlb lower hier. VA PA VA PA physical cachevirtual (L1) cache virtual-physical cache No homonym and synonym High latency to fast L1 Homonym and synonym Low latency to fast L1 No Homonym and synonym ( ? ) Low latency to fast L1

Virtually-Indexed Physically-Tagged Cache If C≤(page_size  associativity), the cache index bits come only from page offset (same in VA and PA) If both L1 cache and TLB are on chip  Index both arrays concurrently using VA bits  Check cache tag (physical) against TLB output at the end  Physical tag eliminates the homonym problem 9 VPNPage Offset TLB PPN IndexBiB physical cache tagdata = cache hit?TLB hit? Virtual address

Virtually-Indexed Physically-Tagged Cache How about synonym?  No problem in this setup due to index bits from the PPO When does synonym become a problem?  C>(page_size  associativity), the cache index bits include V 10 VPNPage Offset TLB PPN IndexBiB physical cache tagdata = cache hit?TLB hit? Virtual address

Virtually-Indexed Physically-Tagged Cache How about synonym?  No problem in this setup due to index bits from the PPO When does synonym become a problem?  C>(page_size  associativity), the cache index bits include V 11 VPNPage Offset TLB PPN IndexBiB physical cache tagdata = cache hit?TLB hit? Virtual address

Some Solutions to the Synonym Problem Limit cache size to (page size times associativity)  Get index from the page offset On a write to a block, search all possible indices that can contain the same physical block, and update/invalidate  Used in Alpha 21264, MIPS R10K Restrict page placement in OS  Make sure index(VA) = index(PA)  Called page coloring  Used in many SPARC processors 12

An Exercise (I) 13

14 An Exercise (II)

15

An Exercise (Concluded) 16

Solutions to the Exercise =wiki:midterm:midterm_s09_solution.pdf =wiki:midterm:midterm_s09_solution.pdf And, more exercises are in past exams and in your homework… 17

Questions on Lab5? 18