Page Table Structure. Hierarchical Paging. Hashed Page Tables. Inverted Page Tables

Similar documents
Chapter 8: Memory Management

Chapter 9: Memory Management. Background

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management

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

Module 8: Memory Management

Chapter 8: Main Memory

Chapter 8: Main Memory

Chapter 8: Memory Management Strategies

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

CS3600 SYSTEMS AND NETWORKS

Chapter 8: Memory- Manage g me m nt n S tra r t a e t gie i s

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

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

Module 8: Memory Management

Memory Management. Memory Management

Module 9: Memory Management. Background. Binding of Instructions and Data to Memory

Main Memory (II) Operating Systems. Autumn CS4023

CS307: Operating Systems

SHANDONG UNIVERSITY 1

Logical versus Physical Address Space

Memory Management. Memory

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Chapter 8: Main Memory

Chapter 8: Memory-Management Strategies

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

Chapter 8: Main Memory. Operating System Concepts 9 th Edition

Chapter 8: Main Memory

Lecture 8 Memory Management Strategies (chapter 8)

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

Multi-Process Systems: Memory (2) Memory & paging structures: free frames. Memory & paging structures. Physical memory

Goals of Memory Management

CS 3733 Operating Systems:

Main Memory. CISC3595, Spring 2015 X. Zhang Fordham University

CS307 Operating Systems Main Memory

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

Chapter 8: Memory- Management Strategies

Chapter 8 Main Memory

CSE 421/521 - Operating Systems Fall Lecture - XII Main Memory Management. Tevfik Koşar. University at Buffalo. October 18 th, 2012.

Memory Management Cache Base and Limit Registers base limit Binding of Instructions and Data to Memory Compile time absolute code Load time

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

Principles of Operating Systems

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

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

Chapter 8 Memory Management

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University

CS370 Operating Systems

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

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

Memory Management. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University

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

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1

Memory Management. CSCI 315 Operating Systems Design Department of Computer Science

Main Memory Yi Shi Fall 2017 Xi an Jiaotong University

Chapter 8: Memory- Management Strategies Dr. Varin Chouvatut

CSE 4/521 Introduction to Operating Systems. Lecture 14 Main Memory III (Paging, Structure of Page Table) Summer 2018

Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation

Chapter 8: Memory Management

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Unit-03 Deadlock and Memory Management Unit-03/Lecture-01

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management

Main Memory (Part II)

Memory management, part 3: outline

Paging & Segmentation

Memory management, part 3: outline

Chapter 9 Memory Management

P r a t t hr h ee e : e M e M m e o m r o y y M a M n a a n g a e g m e e m n e t 8.1/72

Memory Management and Protection

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

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

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

Memory Management. Dr. Yingwu Zhu

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

Memory and multiprogramming

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition

Background. Contiguous Memory Allocation

Memory Management (2)

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

CS370: Operating Systems [Spring 2016] Dept. Of Computer Science, Colorado State University

Introduction to Operating Systems

Operating System 1 (ECS-501)

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table

Operating Systems, Fall Lecture 5, Tiina Niklander 1

CS6401- Operating System UNIT-III STORAGE MANAGEMENT

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

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

Page Size Page Size Design Issues

Operating Systems, Fall Lecture 5 1

UNIT-III VIRTUAL MEMORY

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Memory Management. Dr. Yingwu Zhu

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

Move back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t

Memory Management Ch. 3

Operating Systems, Fall Lecture 5 1. Overhead due to page table and internal fragmentation. Tbl 8.2 [Stal05] 4.

PROCESS VIRTUAL MEMORY. CS124 Operating Systems Winter , Lecture 18

VII. Memory Management

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

CS420: Operating Systems. Paging and Page Tables

390 Chapter 8 Main Memory

Transcription:

Page Table Structure Hierarchical Paging Hashed Page Tables Inverted Page Tables 1

Hierarchical Page Tables Problem: for very large logical address spaces (2 32 and 2 64 ) the page table itself becomes very large. Solution: break up the logical address space into multiple page tables. A simple technique is a two-level page table. 2

Two-Level Paging Example A logical address (on 32-bit machine with 4K page size) is divided into: a page number consisting of 20 bits. a page offset consisting of 12 bits. Since the page table is paged, the page number is further divided into: a 10-bit page number. a 10-bit page offset. Thus, a logical address is as follows: page number page offset p 1 p 2 d 10 10 12 where p 1 is an index into the outer page table, and p 2 is the index into the inner page table. 3

Two-Level Page-Table Scheme PTBR: base address of the outer-page table PTLR: number of the inner-page tables 4

Address-Translation Scheme Address-translation scheme for a two-level 32-bit paging architecture 5

Three-level Paging Scheme for 64-bit address space

Hashed Page Table Scheme Common in address spaces > 32 bits. The logical page number is hashed into a page table. This page table contains a chain of elements in the form of <page#, frame#> hashing to the same location. Logical page number is compared in this chain searching for a match. If a match is found, the corresponding physical frame# is extracted. 7

Hashed Page Table

Hash tables 67 % 20 = 7 46 % 20 = 6 88 % 20 = 8 91 % 20 = 11 734 % 20 = 14 67 % 10 = 7 46 % 10 = 6 88 % 10 = 8 91 % 10 = 1 734 % 10 = 4 Only Key, Value not shown. (Key, Value) pairs. 9

Hash Table Example of Telephone Directory Hash collision resolved by chaining Hash collision resolved by linear probing (interval = 1) 10

Inverted Page Table One entry for each frame of physical memory. Entry consists of the logical address of the page stored in that real memory location, with information about the process that owns that page. Decreases memory needed to store each page table, but increases time needed to search the table when a page reference occurs. Use hash table to limit the search to one or at most a few page-table entries. 11

Inverted Page Table Architecture

Shared Pages Shared code One copy of read-only (reentrant) code shared among processes (i.e., text editors, compilers, window systems). Shared code must appear in same location in the logical address space of all processes Private code and data Each process keeps a separate copy of the code and data. The pages for the private code and data can appear anywhere in the logical address space. 13

Shared Pages Example 14

Segmentation Memory-management scheme that supports user view of program. User does not look at program as an array of memory data A program is a collection of segments. A segment is a logical unit such as: main program, procedure, function, method, object, local variables, global variables, common block, stack, symbol table, arrays 15

User s View of a Program & Logical View of Segmentation Segmentation MMU 1 2 1 4 3 4 2 3 user space physical memory space 16

Segmentation Architecture Logical address consists of a two tuple: <segment-number, offset>, Segment table maps two-dimensional logical addresses; each table entry has: base contains the starting physical address where the segments reside in memory. limit specifies the length of the segment. Segment-table base register (STBR) points to the segment table s location in memory. Segment-table length register (STLR) indicates number of segments used by a program; segment number s is legal if s < STLR. 17

Features: Segmentation Architecture (Cont.) Relocation. dynamic by segment table Sharing. shared segments same segment number Allocation. first fit/best fit external fragmentation 18

Segmentation Architecture (Cont.) Protection. With each entry in segment table associate: validation bit = 0 illegal segment read/write/execute privileges Protection bits associated with segments; code sharing occurs at segment level. Since segments vary in length, memory allocation is a dynamic storage-allocation problem. A segmentation example is shown in the following diagram 19

Segmentation Hardware 20

Example of Segmentation for process Px for process Px for 21

Sharing of Segments 22

Segmentation with Paging The MULTICS and Intel 80386 systems solved problems of external fragmentation and lengthy search time for empty slot by paging the segments. Solution differs from pure segmentation in that the segment-table entry contains not the base address of the segment, but rather the base address of a page table for this segment. PowerPc Processor Memory Management: http://playground.sun.com/1275/bindings/ppc/release/ppc-2_1.html#hdr4 23

MULTICS Address Translation Scheme 24

Intel 80386 The Intel 386 uses segmentation with paging for memory management with a two-level paging scheme. Logical address consists of a segment selector (in one of the segment registers of CPU) and 32 bits address that is generated on the address bus. Each process can have up to 8000 private segments and up to 8000 shared segments to be shared by other processes. Each segment can have up to 1 million pages (each page is 4K bytes) hence the size of a segment can be up to 4 Giga bytes. The pages of a segment are scattered throughout the memory frames. A 32 bit address points to the start of a segment of pages and a 32 bit address from address bus is used as the offset in that segment. This offset is used to access the locations in the pages of the segment. Intel 386 has hardware to support virtual memory management effectively. 25

Segmentation with Paging Intel 386 The Intel 386 uses segmentation with paging for memory management with a two-level paging scheme. 32 bit offset CPU address bus Intel 80386 address translation GDT or LDT 8 bytes 32 bits base adrs 10 10 12 13 1 2 segment g p Selector part of logical address. Stored in one of the CPU s segment registers: CS, DS, SS, ES,.. 26

80386 Architecture for MMU 27

80386 Architecture 28

Example: The Intel Pentium Supports both segmentation and segmentation with paging CPU generates logical address Given to segmentation unit Which produces linear addresses Linear address given to paging unit Which generates physical address in main memory Paging units form equivalent of MMU

Logical to Physical Address Translation in Pentium

Intel Pentium Segmentation

Pentium Paging Architecture

Linear Address in Linux Broken into four parts:

Three-level Paging in Linux