COMP 3500 Introduction to Operating Systems TLB and Memory Accesses Dr. Xiao Qin Auburn University Slides.

Slides:



Advertisements
Similar presentations
Page Table Implementation
Advertisements

Operating Systems Lecture Notes Memory Management Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
Paging Hardware With TLB
Modified from Silberschatz, Galvin and Gagne Lecture 16 Chapter 8: Main Memory.
Memory Management.
Chapter 3.2 : Virtual Memory
Virtual Memory. Why do we need VM? Program address space: 0 – 2^32 bytes –4GB of space Physical memory available –256MB or so Multiprogramming systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
03/24/2004CSCI 315 Operating Systems Design1 Memory Management and Virtual Memory (Problem session)
Chapter 7: Main Memory CS 170, Fall Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Chapter 8.2: Memory Management
03/22/2004CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
A. Frank - P. Weisberg Operating Systems Simple/Basic Paging.
Memory Management 2 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
Silberschatz, Galvin and Gagne  Operating System Concepts Segmentation Memory-management scheme that supports user view of memory. A program.
Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
1 Tuesday, July 04, 2006 "Programs expand to fill the memory available to hold them." - Modified Parkinson’s Law.
CS 241 Section Week #12 (04/22/10).
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 8: Memory Management.
Chapter 8 Memory Management Dr. Yingwu Zhu. Outline Background Basic Concepts Memory Allocation.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 08 Main Memory (Page table questions)
8.4 paging Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous. The basic method for implementation.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 34 Paging Implementation.
Operating Systems COMP 4850/CISG 5550 Page Tables TLBs Inverted Page Tables Dr. James Money.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Paging Physical address space of a process can be noncontiguous Avoids.
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Implementation of Page Table Page table is kept in main memory Page-table base.
1 Memory Management (b). 2 Paging  Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter.
Virtual Memory 1 1.
9.1 Operating System Concepts Paging Example. 9.2 Operating System Concepts.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Virtual Memory Hardware.
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.
Paging Paging is a memory-management scheme that permits the physical-address space of a process to be noncontiguous. Paging avoids the considerable problem.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Objectives To provide a detailed description of various ways of organizing.
Page Table Implementation. Readings r Silbershatz et al:
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)
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Memory and Addressing It all starts.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
Silberschatz, Galvin and Gagne  Operating System Concepts Paging Logical address space of a process can be noncontiguous; process is allocated.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 8: Main Memory.
COMP 3500 Introduction to Operating Systems Paging: Translation Look-aside Buffers (TLB) Dr. Xiao Qin Auburn University
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
W4118 Operating Systems Instructor: Junfeng Yang.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 33 Paging Read Ch. 9.4.
Memory Management & Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory.
COMP 3500 Introduction to Operating Systems Paging: Basic Method Dr. Xiao Qin Auburn University Slides.
Memory: Page Table Structure CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Project 4 Awards First Place Group 7 Samuel Bartlett Michael Phillips Norman Chen.
COMP 3500 Introduction to Operating Systems Memory Management: Part 2 Dr. Xiao Qin Auburn University Slides.
Memory: Page Table Structure
Basic Paging (1) logical address space of a process can be made noncontiguous; process is allocated physical memory whenever the latter is available. Divide.
Virtual Memory Chapter 7.4.
Virtual Memory - Part II
Chapter 8: Main Memory Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Paging and Segmentation
EECE.4810/EECE.5730 Operating Systems
Lecture 29: Virtual Memory-Address Translation
Virtual Memory فصل هشتم.
Lecture 33 Syed Mansoor Sarwar
So far in memory management…
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
4.3 Virtual Memory.
Virtual Memory 1 1.
Presentation transcript:

COMP 3500 Introduction to Operating Systems TLB and Memory Accesses Dr. Xiao Qin Auburn University Slides are adopted and modified from materials developed by Drs. Silberschatz, Galvin, and Gagne 1

Review: Two-Level Page-Table Scheme 2

Why two-level page-table scheme? Q1: We assume that page size is 4KB (i.e., 2 12 ), each page table entry is 4 bytes. How large is the page table for a 32-bit logical address space? 1 million page table entries (2 32 / 2 12 ) If each entry is 4 bytes -> 4 MB of physical address space / memory for page table alone 4 MB cost a lot 20 years ago. How to solve this problem? 3

Hierarchical Page Tables Break up the logical address space into multiple page tables A simple technique is a two-level page table Keep level 2 page tables in a hard disk. 4

Address-Translation in a Two- level Paying Scheme Basic Idea: Page the page tables 5

Paging Hardware with Translation Look-aside Buffers (TLB) 6 Q2: Why TLBs are typically small (64 to 1,024 entries)?

Parallel Searching the TLB How to search TLB? – Associative memory: parallel search Address translation (p, d) – If p is in associative register, get frame # out – Otherwise get frame # from page table in memory 7

Q3: Why some TLBs store address-space identifiers (ASIDs) in each TLB entry – uniquely identifies each process? Address Space ID in TLBs To provide address-space protection for that process 8

Q4: What happens on a TLB miss? 9 Value (?) is loaded into the TLB for faster access next time Replacement policies must be considered

Effective Memory Access Time Associative Lookup = T tlb time unit TLB hit ratio = h – percentage of times that a page number is found in the associative registers; T_hit = T_tlb + T_mem T_miss = T_tlb + T_mem + T_tlb_update + T_mem T_miss = T_tlb + T_mem + T_mem access page table access data Effective Access Time = h*T_hit + (1-h)*T_miss 10

Ex1: Effective Access Time Consider a single-level paging scheme. The TLB has 32 entries. The TLB access time is 10 ns; memory access time is 200ns. 1.How long does it take to access data in memory if there is a TLB hit? 2.How long does it take to access data in memory if there is a TLB miss? 3.What is the effective memory-access time if we have a TLB hit ratio of 80%? 4.What is the minimal hit ratio that guarantees the effective access time of at most 220ns? 11

Summary Hierarchical Page Tables Translation Look-aside Buffers (TLBs) Effective Memory Access Time 12