COMP25212 - SYSTEM ARCHITECTURE CACHES IN SYSTEMS Sergio Davies Feb/Mar 2014COMP25212 – Lecture 4.

Slides:



Advertisements
Similar presentations
1 Lecture 13: Cache and Virtual Memroy Review Cache optimization approaches, cache miss classification, Adapted from UCB CS252 S01.
Advertisements

Lecture 12 Reduce Miss Penalty and Hit Time
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.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
Cs 325 virtualmemory.1 Accessing Caches in Virtual Memory Environment.
1 Copyright © 2012, Elsevier Inc. All rights reserved. Chapter 2 (and Appendix B) Memory Hierarchy Design Computer Architecture A Quantitative Approach,
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011 Computer Science Cornell University P & H Chapter
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Virtual Memory 2 P & H Chapter
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.
CS Lecture 10 Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-Associative Cache and Prefetch Buffers N.P. Jouppi Proceedings.
CSCE 212 Chapter 7 Memory Hierarchy Instructor: Jason D. Bakos.
Modified from notes by Saeid Nooshabadi
Computer ArchitectureFall 2007 © November 21, 2007 Karem A. Sakallah Lecture 23 Virtual Memory (2) CS : Computer Architecture.
331 Lec20.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed, Nov 9, 2005 Topic: Caches (contd.)
331 Lec20.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
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:
CS 241 Section Week #12 (04/22/10).
Lecture 33: Chapter 5 Today’s topic –Cache Replacement Algorithms –Multi-level Caches –Virtual Memories 1.
Computer Architecture Lecture 28 Fasih ur Rehman.
Lecture 19: Virtual Memory
Lecture 15: Virtual Memory EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014, Dr.
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
The Memory Hierarchy 21/05/2009Lecture 32_CA&O_Engr Umbreen Sabir.
Caches in Systems COMP25212 Cache 4. Learning Objectives To understand: –“3 x C’s” model of cache performance –Time penalties for starting with empty.
CSIE30300 Computer Architecture Unit 08: Cache Hsin-Chou Chi [Adapted from material by and
1  1998 Morgan Kaufmann Publishers Recap: Memory Hierarchy of a Modern Computer System By taking advantage of the principle of locality: –Present the.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
Nov. 15, 2000Systems Architecture II1 Machine Organization (CS 570) Lecture 8: Memory Hierarchy Design * Jeremy R. Johnson Wed. Nov. 15, 2000 *This lecture.
CS.305 Computer Architecture Memory: Caches Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made available.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 5:
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)
COMP SYSTEM ARCHITECTURE PRACTICAL CACHES Sergio Davies Feb/Mar 2014COMP25212 – Lecture 3.
Summary of caches: The Principle of Locality: –Program likely to access a relatively small portion of the address space at any instant of time. Temporal.
1 Adapted from UC Berkeley CS252 S01 Lecture 17: Reducing Cache Miss Penalty and Reducing Cache Hit Time Hardware prefetching and stream buffer, software.
High Performance Computing1 High Performance Computing (CS 680) Lecture 2a: Overview of High Performance Processors * Jeremy R. Johnson *This lecture was.
3/1/2002CSE Virtual Memory Virtual Memory CPU On-chip cache Off-chip cache DRAM memory Disk memory Note: Some of the material in this lecture are.
COMP 3221: Microprocessors and Embedded Systems Lectures 27: Cache Memory - III Lecturer: Hui Wu Session 2, 2005 Modified.
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
CS 704 Advanced Computer Architecture
CMSC 611: Advanced Computer Architecture
COMP SYSTEM ARCHITECTURE
Caches in Systems Feb 2013 COMP25212 Cache 4.
CS161 – Design and Architecture of Computer
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.
CS510 Operating System Foundations
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011
Part V Memory System Design
CMSC 611: Advanced Computer Architecture
Andy Wang Operating Systems COP 4610 / CGS 5765
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Summary 3 Cs: Compulsory, Capacity, Conflict Misses Reducing Miss Rate
CS 3410, Spring 2014 Computer Science Cornell University
CSC3050 – Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Lecture 24: Virtual Memory, Multiprocessors
Lecture 8: Efficient Address Translation
Translation Lookaside Buffers
Cache - Optimization.
Sarah Diesburg Operating Systems CS 3430
Sarah Diesburg Operating Systems COP 4610
Presentation transcript:

COMP SYSTEM ARCHITECTURE CACHES IN SYSTEMS Sergio Davies Feb/Mar 2014COMP25212 – Lecture 4

Learning Objectives To understand: –“3 x C’s” model of cache performance –Time penalties for starting with empty cache –Systems interconnect issues with caching and solutions! –Caching and Virtual Memory Feb/Mar 2014COMP25212 – Lecture 4

Describing Cache Misses Compulsory Misses –Cold start Capacity Misses –Even with full associativity, cache cannot contain all the blocks of the program Conflict Misses –Multiple blocks compete for the same set. This would not happen in fully associative cache Feb/Mar 2014COMP25212 – Lecture 4

Cache Performance again Today’s caches, how long does it take: a) to fill L3 cache? (8MB) b) to fill L2 cache? (256KB) c) to fill L1 D cache? (32KB) –(e.g.) Number of lines = (cache size) / (line size) Number of lines = 32K/64 = x memory access times at 20nS = 10 uS 20,000 clock cycles at 2GHz Feb/Mar 2014COMP25212 – Lecture 4

Caches in Systems e.g. disk, network L1 Data Cache CPU RAM Memory On-chip L1 Inst Cache fetch data L2 Input/Output how often? (bandwidth required) Inter connect stuff Feb/Mar 2014COMP25212 – Lecture 4

Cache Consistency Problem 1 Problem: –I/O writes to mem; cache outdated Data Cache CPU RAM Memory On-chip L1 Inst Cache fetch data L2 “3” “5” Input/Output Inter connect stuff Feb/Mar 2014COMP25212 – Lecture 4

Cache Consistency Problem 2 Data Cache CPU RAM Memory On-chip L1 Inst Cache fetch data L2 “3” “5” Problem: –I/O reads mem; cache holds newer Input/Output Inter connect stuff Feb/Mar 2014COMP25212 – Lecture 4

Cache Consistency Software Solutions O/S knows where I/O takes place in memory –Mark I/O areas as non-cachable (how?) O/S knows when I/O starts and finishes –Clear caches before&after I/O? Feb/Mar 2014COMP25212 – Lecture 4

Hardware Solutions:1 Disadvantage: tends to slow down cache Data Cache CPU RAM Memory On-chip L1 Inst Cache fetch data L2 “5” Input/Output Inter connect stuff Feb/Mar 2014COMP25212 – Lecture 4

Hardware Solutions: 2 - Snooping Data Cache CPU RAM Memory On-chip L1 Inst Cache fetch data L2 “5” Snoop logic in cache observes every memory cycle snoop L2 keeps track of L1 contents Input/Output Inter connect stuff Feb/Mar 2014COMP25212 – Lecture 4

Caches and Virtual Addresses CPU addresses – virtual Memory addresses – physical Recap – use Translation-Lookaside Buffer (TLB) to translate V-to-P What addresses in cache? Feb/Mar 2014COMP25212 – Lecture 4

Option 1: Cache by Physical Addresses CPU RAM Memory On-chip address data $ TLB BUT: –Address translation in series with cache SLOW Feb/Mar 2014COMP25212 – Lecture 4

Option 2: Cache by Virtual Addresses CPU RAM Memory On-chip address data $ TLB BUT: –Snooping? –Aliasing? More Functional Difficulties Feb/Mar 2014COMP25212 – Lecture 4

3: Translate in parallel with Cache Lookup Translation only affects high-order bits of address Address within page remains unchanged Low-order bits of Physical Address = low-order bits of Virtual Address Select “index” field of cache address from within low- order bits Only “Tag” bits changed by translation Feb/Mar 2014COMP25212 – Lecture 4

Option 3 in operation: within line index virtual page no Virtual address data line tag line multiplexer compare = ? TLB Physical address Hit? Data Feb/Mar 2014COMP25212 – Lecture 4

The Last Word on Caching? RAM Memory On-chip L1 Data Cache CPU L1 Inst Cache fetch dat a L2 L1 Data Cache CPU L1 Inst Cache fetch dat a L2 L3 Input/Outp ut On-chip L1 Data Cache CPU L1 Inst Cache fetch dat a L2 L1 Data Cache CPU L1 Inst Cache fetch dat a L2 L3 On-chip L1 Data Cache CPU L1 Inst Cache fetch dat a L2 L1 Data Cache CPU L1 Inst Cache fetch dat a L2 L3 You ain’t seen nothing yet! Feb/Mar 2014COMP25212 – Lecture 4

Summary “3 x C’s” model of cache performance Systems interconnect issues with caching and solutions! –Non-cacheable areas –Cache flushing –Snooping Caching and Virtual Memory –Physical to virtual conversion (TLB) –Cache architectures to support P-to-V conversion Feb/Mar 2014COMP25212 – Lecture 4