SMD149 - Operating Systems - Memory

Similar documents
Chapter 9 Real Memory Organization and Management

Chapter 9 Real Memory Organization and Management

Memory management: outline

Memory management: outline

Operating Systems, Fall

Operating Systems, Fall

Memory Management. An expensive way to run multiple processes: Swapping. CPSC 410/611 : Operating Systems. Memory Management: Paging / Segmentation 1

CS 3733 Operating Systems:

Registers Cache Main memory Magnetic disk Magnetic tape

Operating Systems. 09. Memory Management Part 1. Paul Krzyzanowski. Rutgers University. Spring 2015

Virtual Memory: Mechanisms. CS439: Principles of Computer Systems February 28, 2018

The memory of a program. Paging and Virtual Memory. Swapping. Paging. Physical to logical address mapping. Memory management: Review

Preview. Memory Management

Virtual Memory. control structures and hardware support

MEMORY MANAGEMENT: Real Storage. Unit IV

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358

8: Memory Management

Virtual Memory. Chapter 8

Memory Management. Dr. Yingwu Zhu

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 12, 2018 L16-1

Chapter 9 Memory Management

Memory and multiprogramming

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1

CS307 Operating Systems Main Memory

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

Chapter 8 Memory Management

Main Memory. Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & APPS 1

CS399 New Beginnings. Jonathan Walpole

COSC Operating Systems Design, Fall 2001, Byunggu Yu. Chapter 9 Memory Management (Lecture Note #8) 1. Background

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 13: Address Translation

Memory management. Requirements. Relocation: program loading. Terms. Relocation. Protection. Sharing. Logical organization. Physical organization

20-EECE-4029 Operating Systems Spring, 2013 John Franco

VIRTUAL MEMORY II. Jo, Heeseung

a process may be swapped in and out of main memory such that it occupies different regions

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner

CPS 104 Computer Organization and Programming Lecture 20: Virtual Memory

Address Translation. Tore Larsen Material developed by: Kai Li, Princeton University

Chapter 8. Virtual Memory

CPE300: Digital System Architecture and Design

Computer Science 146. Computer Architecture

Outlook. Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium

Memory Management Topics. CS 537 Lecture 11 Memory. Virtualizing Resources

1. Creates the illusion of an address space much larger than the physical memory

Memory Management. Memory Management

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2

Operating Systems and Computer Networks. Memory Management. Dr.-Ing. Pascal A. Klein

Memory Management. Dr. Yingwu Zhu

Virtual Memory. Today. Handling bigger address spaces Speeding translation

Memory Management. Contents: Memory Management. How to generate code? Background

Chapter 8: Memory Management. Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging

Learning Outcomes. An understanding of page-based virtual memory in depth. Including the R3000 s support for virtual memory.

Learning Outcomes. An understanding of page-based virtual memory in depth. Including the R3000 s support for virtual memory.

Virtual to physical address translation

Goals of Memory Management

PROCESS VIRTUAL MEMORY. CS124 Operating Systems Winter , Lecture 18

Lecture 13: Virtual Memory Management. CSC 469H1F Fall 2006 Angela Demke Brown

Address Translation. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Chapter 9: Memory Management. Background

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8 Main Memory

Operating Systems. Paging... Memory Management 2 Overview. Lecture 6 Memory management 2. Paging (contd.)

CS370 Operating Systems

Virtual Memory 2. q Handling bigger address spaces q Speeding translation

CS307: Operating Systems

Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) Advantages of Multi-level Page Tables

MEMORY MANAGEMENT/1 CS 409, FALL 2013

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation

Memory Management. Memory

Memory Management (Chaper 4, Tanenbaum)

Virtual Memory: From Address Translation to Demand Paging

Chapter 3 - Memory Management

Section 7: Wait/Exit, Address Translation

12: Memory Management

Part Three - Memory Management. Chapter 8: Memory-Management Strategies

Memory Management. CSE 2431: Introduction to Operating Systems Reading: , [OSC]

Virtual Memory 2. To do. q Handling bigger address spaces q Speeding translation

Virtual Memory: From Address Translation to Demand Paging

Memory Management. Goals of Memory Management. Mechanism. Policies

Processes and Tasks What comprises the state of a running program (a process or task)?

CS5460: Operating Systems Lecture 14: Memory Management (Chapter 8)

Motivation. Memory Management. Memory Management. Computer Hardware Review

I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed CHAPTER 8: MEMORY

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory management units

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY

Memory: Page Table Structure. CSSE 332 Operating Systems Rose-Hulman Institute of Technology

UNIT III MEMORY MANAGEMENT

Virtual Memory 2. Today. Handling bigger address spaces Speeding translation

CS450/550 Operating Systems

Memory Management (2)

Chapter 8: Main Memory

Memory Management (Chaper 4, Tanenbaum)

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition

Module 8: Memory Management

Chapter 8: Main Memory

Transcription:

SMD149 - Operating Systems - Memory Roland Parviainen November 8, 2005 1/57 Outline Overview Mostly historical management Paging 2/57

Overview 3/57 Memory hierarchy Memory divided into tiers Main memory Relatively expensive Relatively small capacity High-performance Secondary storage Cheap Large capacity Slow Main memory requires careful management 4/57

5/57 Management Memory manager When to load, try to anticipate, what to replace Where to place things in memory? Strategies Fetch Strategies - on-demand and anticipatory Placement Strategies Replacement Strategies History From single user systems to modern segmentation/paging systems 6/57

Evolution of memory organizations 7/57 Single user contiguous memory allocation 8/57

Overlays 9/57 Protection in single user os 10 /57

Processor utilization 11 /57 Fixed partition multiprogramming 12 /57

Memory waste 13 /57 Relocatable translation and loading 14 /57

Memory protection 15 /57 Internal fragmentation 16 /57

Variable partioning 17 /57 Memory holes 18 /57

Coalescing 19 /57 Compaction 20 /57

Memory placement: First fit 21 /57 Best fit 22 /57

Worst fit 23 /57 Single process swapping 24 /57

Create the illusion of larger memory Increase the degree of multiprogramming 25 /57 Evolution of memory organizations 26 /57

Address spaces Physical, real, main memory addresses Virtual addresses Translated by the MMU (memory managemet unit) Dynamic Address Translation V: Virtual Address Space R: Real Address Space V much larger than R Two level storage: main memory and secondary storage 27 /57 Two level storage 28 /57

29 /57 Block mapping Dynamic address translation must maintain address translation maps Can not contain entries for every address in V Mapping information should be a fraction of main memory Blocks Tradeoff in size Fixed size blocks: paging Variable size blocks: segmentation Ordered pairs: v = (b, d) Have to be fast 30 /57

Block mapping 31 /57 Paging Pages: fixed size blocks Page frames: blocks in main memory Page table contains mappings from page numbers to page frame numbers v = (p, d) r = ps*p + d n bits in address: p: n - m bits, d: m bits Concatenation, not addition, can be used Page table stores Page Table Entries (PTEs) 32 /57

33 /57 Page table entry 34 /57

Direct mapping One entry in page table for each page in this process virtual memory space, V Any entry can be directly accessed Like accessing an array Page table often in main memory One extra memory access - half the speed? High speed cache memory? 35 /57 Direct mapping 36 /57

Associative mapping Using content addressed associative mapping Fast and expensive All entries search simultaneously Not used 37 /57 Associative mapping 38 /57

Direct/Associative mapping Combination of Direct and Associative Mapping Smaller associative memory: translation lookaside buffer (TLB) Store small number of often used PTEs Utilizes locality TLB hit: entry is in TLB TLB miss: entry is not in TLB, fetch from page table 64-128 TLB entries can achieve more than 90% of AM performance 39 /57 Direct/Associative mapping 40 /57

Multilevel page tables 32 bit virtual address space, 4KB pages: 2 20 entries for each process 32 bit/entry: 4MB per process Most memory is not used: table fragmentation Multilevel (hierarchical) page tables For two levels: v = (p, t, d) Can reduce page table fragmentation by 99% Overhead: one more memory access per level Relies on high TLB hit ratios 41 /57 Multilevel page tables 42 /57

Inverted page tables Some applications use most of 32bit address space 64bit systems need even more memory for page tables Inverted Page Tables stores one PTE for each page frame Memory needed: proportional to physical memory size, not virtual address space Hash functions to map virtual address to PTEs Collisions handled by chaining Collisions can be reduced by using a hash anchor table 43 /57 Inverted page tables 44 /57

IPT with hash anchor table 45 /57 Sharing in a paging system Allow more than one process reference the same page frame Only nonmodifiable data can be shared Copy-on-write Read-only pages Exception on write - make copy now 46 /57

Sharing in a paging system 47 /57 Variable size blocks: segments No internal fragmentation Can have large external fragmentation 48 /57

49 /57 50 /57

51 /57 /paging system Combination of segmentation and paging Segments occupy one or more pages A complete segment need not be in main memory v = (s, p, d) 52 /57

/paging system 53 /57 54 /57

Protection 55 /57 56 /57

http://www.sm.luth.se/csee/courses/smd/149/ No lecture on monday, 14 november. Next: management 57 /57