CSE 471 Autumn 1998 Virtual memory

Slides:



Advertisements
Similar presentations
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.
Advertisements

Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
CS 153 Design of Operating Systems Spring 2015
Memory Management and Paging CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han.
Translation Buffers (TLB’s)
Virtual Memory and Paging J. Nelson Amaral. Large Data Sets Size of address space: – 32-bit machines: 2 32 = 4 GB – 64-bit machines: 2 64 = a huge number.
Virtual Memory I Chapter 8.
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.
Vir. Mem II CSE 471 Aut 011 Synonyms v.p. x, process A v.p. y, process B v.p # index Map to same physical page Map to synonyms in the cache To avoid synonyms,
Lecture 19: Virtual Memory
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
Page 110/20/2015 CSE 30341: Operating Systems Principles So far…  Page  Fixed size pages solve page allocation problem (and external fragmentation) 
Chapter 4 Memory Management Virtual Memory.
1 Memory Management. 2 Fixed Partitions Legend Free Space 0k 4k 16k 64k 128k Internal fragmentation (cannot be reallocated) Divide memory into n (possible.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
Virtual Memory Chapter 8.
CS161 – Design and Architecture of Computer
Translation Lookaside Buffer
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Virtual Memory Chapter 7.4.
ECE232: Hardware Organization and Design
Memory COMPUTER ARCHITECTURE
CS161 – Design and Architecture of Computer
CS352H: Computer Systems Architecture
Lecture 12 Virtual Memory.
Memory Caches & TLB Virtual Memory
CS703 - Advanced Operating Systems
Cache Memory Presentation I
Morgan Kaufmann Publishers
Virtual Memory Chapter 8.
Lecture 28: Virtual Memory-Address Translation
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Evolution in Memory Management Techniques
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Main Memory Background Swapping Contiguous Allocation Paging
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSE 451: Operating Systems Autumn 2005 Memory Management
Translation Buffers (TLB’s)
Virtual Memory Overcoming main memory size limitation
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Contents Memory types & memory hierarchy Virtual memory (VM)
Chapter 8: Memory Management strategies
CSE451 Virtual Memory Paging Autumn 2002
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 451: Operating Systems Autumn 2004 Page Tables, TLBs, and Other Pragmatics Hank Levy 1.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Translation Buffers (TLB’s)
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Paging and Segmentation
Evolution in memory management techniques
CSE 451: Operating Systems Lecture 10 Paging & TLBs
CSE 451: Operating Systems Winter 2005 Page Tables, TLBs, and Other Pragmatics Steve Gribble 1.
Main Memory Background
Evolution in memory management techniques
Evolution in memory management techniques
Virtual Memory Lecture notes from MKP and S. Yalamanchili.
CSE 542: 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.
Synonyms v.p. x, process A v.p # index Map to same physical page
Review What are the advantages/disadvantages of pages versus segments?
CSE 542: Operating Systems
Presentation transcript:

CSE 471 Autumn 1998 Virtual memory Paging (segmented) systems predate caches Same type of questions (mapping, replacement, writing policy) Paging: fixed block sizes Easy to map, translate, replace, transfer to/from disk Does not correspond to semantic objects, hence internal fragmentation Segmentation: variable block sizes “Difficult” to translate (need to check segment length) , place and replace (external fragmentation), transfer to/from disk Corresponds to semantic objects Segmentation (somewhat of a misnomer) with paging Good for large objects Breaks up page tables 5/2/2019 CSE 471 Autumn 1998 Virtual memory

Two extremes in the memory hierarchy 5/2/2019 CSE 471 Autumn 1998 Virtual memory

Other extreme differences Mapping: Restricted (L1) vs. general (Paging) Hardware assist for virtual addres translation (TLB) Miss handler Harware only for caches Software only for paging system (context-switch) Hardware and/or software for TLB Replacement algorithm Not that important for caches Very important for paging system Write policy Always write back for paging systems 5/2/2019 CSE 471 Autumn 1998 Virtual memory

Virtual Memory Mapping: Page tables Page tables contain page table entries (PTE): Virtual page number (implicit/explicit), physical page number,valid, protection, dirty, use bits (for LRU-like replacement) etc. Hardware register points to the page table of the running process Various page table organizations Single level (contiguous); multi level (segmented) etc. In some systems, inverted page tables (with a hash table) In all modern systems, use of a TLB to cache some PTE’s 5/2/2019 CSE 471 Autumn 1998 Virtual memory

CSE 471 Autumn 1998 Virtual memory TLB’s Cache for PTE’s TLB miss handled by hardware or by software (e.g., PAL code in Alpha): depends on the implementation TLB miss 10-100 cycles -> no context-switch Addressed in parallel with access to the L1 cache Since smaller, goes faster It’s on the critical path For a given TLB size (number of entries) Larger page size -> larger mapping range 5/2/2019 CSE 471 Autumn 1998 Virtual memory

CSE 471 Autumn 1998 Virtual memory Choosing a page size Large page size Smaller page table Better coverage in TLB Amortize time to bring in page from disk Allow fast access to larger L1 (virtually addressed; physically tagged) BUT more fragmentation (unused portions of the page) Longer time for start-up Recent micros support multiple (two) page sizes Better use of TLB is main reason 5/2/2019 CSE 471 Autumn 1998 Virtual memory

CSE 471 Autumn 1998 Virtual memory Protection Protect user processes from each other Disallow an unauthorized process to access (read, write, execute) part of the addressing space of another process Disallow the use of some instructions by user processes E.g., disallow process A to change the access rights to process B Leads to Kernel mode (operating system) vs. user mode Only kernel mode can use some privileged instructions (e.g., disabling interrupts, I/O functions) Providing system calls whereby CPU can switch between user and kernel mode 5/2/2019 CSE 471 Autumn 1998 Virtual memory

Where to put access rights Associate protection bits with PTE e.g., disallow user to read/write /execute in kernel space e.g., allow one process to share-read some data with another but not modifying it etc. User/kernel protection model can be extended with rings of protection. Further extension leads to the concept of capabilities. 5/2/2019 CSE 471 Autumn 1998 Virtual memory

I/O and caches (a first look at cache coherence) I/O data passes through the cache on its way from/to memory No coherency problem but contention for cache access I/O interacts directly with main memory (DMA) Case 1: Software solution Output: (1) Write-through cache. No problem ;(2)Write back cache purge the cache via O.S. interaction Input (WT and WB). Use a non-cacheable buffer space. Then after input is finished make the buffer cacheable 5/2/2019 CSE 471 Autumn 1998 Virtual memory

I/O consistency -- hardware approach Subset of the shared-bus multiprocessor cache coherence protocol (see Chapter 9 and forthcoming slides) Cache has duplicate set of tags Cache controller snoops on the bus On input, if there is a match in tags, store in both the cache and main memory On output, if there is a match in tags: if WT invalidate the entry; if WB take the cache entry instead of the memory contents and invalidate. 5/2/2019 CSE 471 Autumn 1998 Virtual memory