Page Replacement Implementation Issues

Slides:



Advertisements
Similar presentations
Chapter 4 Memory Management Page Replacement 补充:什么叫页面抖动?
Advertisements

Memory Management Paging &Segmentation CS311, CS350 & CS550.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Intel MP.
Configuring the Operating System Configure Performance Options Processor scheduling and memory usage Virtual memory Memory for network performance Configure.
OS Memory Addressing.
CSC 322 Operating Systems Concepts Lecture - 18: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Memory Management Design & Implementation Segmentation Chapter 4.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
Chapter 8.3: Memory Management
Memory Management (II)
1 Pertemuan 16 Isu-Isu pada Sistem Paging dan Segmentasi Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 121 Today’s class Operating System Machine Level.
Chapter 3.2 : Virtual Memory
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Operating System Machine.
Virtual Memory Management B.Ramamurthy. Paging (2) The relation between virtual addresses and physical memory addres- ses given by page table.
CS2422 Assembly Language & System Programming September 22, 2005.
1 Virtual Memory Management B.Ramamurthy Chapter 10.
Protected Mode. Protected Mode (1 of 2) 4 GB addressable RAM –( to FFFFFFFFh) Each program assigned a memory partition which is protected from.
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Chapter 3 Memory Management 3.7 Segmentation. A compiler has many tables that are built up as compilation proceeds, possibly including: The source text.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
Virtual Memory  Early computers had a small and fixed amount to memory. All programs had to be able to fit in this memory. Overlays were used when the.
Operating System Machine Level  An operating system is a program that, from the programmer’s point of view, adds a variety of new instructions and features,
UNIT 2 Memory Management Unit and Segment Description and Paging
CS333 Intro to Operating Systems Jonathan Walpole.
Microprocessor system architectures – IA32 segmentation Jakub Yaghob.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
Memory Management 3 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
1 Memory Management 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms.
CSC 660: Advanced Operating SystemsSlide #1 CSC 660: Advanced OS Memory Addressing / Kernel Modules.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
80386DX.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Chapter 4 Memory Management Segmentation. (a) One address space. (b) Separate I and D spaces. Separate Instruction and Data Spaces.
Memory Management Operating Systems CS550. Memory Manager Memory manager - manages allocation and de-allocation of main memory Plays significant impact.
操作系统原理 OPERATING SYSTEM Chapter 3 Memory Management 内存管理.
1 Microprocessors CSE Protected Mode Memory Addressing Remember using real mode addressing we were previously able to address 1M Byte of memory.
Page Replacement Implementation Issues Text: –Tanenbaum ch. 4.7.
Information Security - 2. Descriptor Tables There are two descriptor tables – Global Descriptor Tables – Local Descriptor Tables The global descriptor.
OS Memory Addressing. Architecture CPU – Processing units – Caches – Interrupt controllers – MMU Memory Interconnect North bridge South bridge PCI, etc.
1 Memory Management Chapter Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement.
Memory Management Chapter 5 Advanced Operating System.
Memory Management Chapter 3
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Memory Management Paging (continued) Segmentation
CSE 120 Principles of Operating
Session 3 Memory Management
COMBINED PAGING AND SEGMENTATION
Privilege Levels.
143A: Principles of Operating Systems Lecture 5: Address translation
Protection UQ: Explain the protection mechanism of X86 Intel family microprocessor(10 Marks)
x86 segmentation, page tables, and interrupts
Instructor: Junfeng Yang
Lecture 28: Virtual Memory-Address Translation
Operating Modes UQ: State and explain the operating modes of X86 family of processors. Show the mode transition diagram highlighting important features.(10.
Page Replacement.
Memory Management Paging (continued) Segmentation
Main Memory Background Swapping Contiguous Allocation Paging
The Operating System Machine Level
Page Replacement Implementation Issues
Memory management, part 3: outline
Lecture 37 Syed Mansoor Sarwar
Assembly Language for Intel-Based Computers, 5th Edition
Memory Management Paging (continued) Segmentation
COMP755 Advanced Operating Systems
CS444/544 Operating Systems II Virtual Memory
Presentation transcript:

Page Replacement Implementation Issues Text: Tanenbaum ch. 4.7

Instruction Backup Page handling involves restarting the instruction that causes the trap Need to determine the first byte of instruction - difficult for some CPUs CPU uses an internal hidden register to copy the PC before executing the instruction If page fault occurs here, where does the instruction begin?

Locking Page in Memory Virtual memory and I/O occasionally interact A process issues call for read from device into buffer while waiting for I/O, another process starts up has a page fault buffer for the first process may be paged out data from I/O may get loaded on the new page Need to specify some pages locked (pinning in memory) exempted from removal from memory

Backing Store (a) Paging to static swap area Proc size Proc size (a) Paging to static swap area - problem with process that increases in size after starting (b) Backing up pages dynamically - allocate disk space when the page is swapped out and deallocate it when it is swapped back in

Separation of Policy and Mechanism Where is the page replacement algorithm?

Growing Tables One dimensional address space with growing tables, one table may bump into another Consider a compiler table example:

Segmentation Divide the address space into segments and each segment can grow independent of each other segments have large address space to prevent bumping into each other two part address- a segment number and address within the segment

Advantages of Segmentation Modification and compilation of one segment’s procedure will not affect any other procedures in other segments (no starting address has been modified) Better sharing of procedures or data between processes (put shared libraries in a special segment) Different protection for different segments

Comparison of Paging and Segmentation

Implementation of Pure Segmentation Segments are of various sizes (different from paging) Evicting and loading segments cause checker- boarding as in d) Need expensive memory compaction in e) to fill gaps

Segmentation and Paging To overcome the problem with pure segmentation, combine segmentation and paging. See reference in: http://www.ece.cmu.edu/~ece447/s13/lib/exe/fetch.php?media= onur-447-spring13-lecture18-virtual-memory-iii-afterlecture.pdf

x86 Segmentation with Paging x86 has 16K segments each holding 4GB of data To access a segment, x86 first loads a selector into one of CPU’s six segment registers (cs, ds, ss, es, fs, gs). The corresponding LDT or GDT is fetched and stored in microprogram registers. Requestor’s

Segment Descriptor Each program uses a Local Descriptor Table (LDT) to describe the code, data, stack etc. A single Global Descriptor Table(GDT) shared among all programs describes OS etc. Code segment descriptor:

Details about GDT From https://staktrace.com/nuggets/index.php?id=11&replyTo=0 Bits 63-56: Bits 31-24 of the base address  Bit 55: Granularity bit (set means the limit gets multiplied by 4K)  Bit 54: 16/32-bit segment (0=16-bit, 1=32-bit)  Bit 53: Reserved, should be zero  Bit 52: Reserved for OS  Bits 51-48: Bits 19-16 of the segment limit  Bit 47: The segment is present in memory (used for virtual memory stuff)  Bits 46-45: Descriptor privilege level (0=highest, 3=lowest)  Bit 44: Descriptor bit (0=system descriptor, 1=code/data descriptor)  Bits 43-41: The descriptor type (see below for an enumeration of the types)  Bit 40: Accessed bit (again, for use with virtual memory)  Bits 39-16: Bits 23-0 of the base address  Bits 15-0: Bits 15-0 of the segment limit  The type of the segment is stored in bits 43-41, and has one of the following values:  Bit 43: executable (0=data segment, 1=code segment)  Bit 42: expansion direction (for data segments), conforming (for code segments)  Bit 41: read/write (for data segments: 0=RO, 1=RW) (for code segments: 0=Execute only, 1=Read/execute) 

Conversion to Linear Address Segment translation- logical address (what the applications see) to linear address (address for each segment) Page translation- linear address to physical address Logical(Virtual) Address 16-bit 32-bit Local/Global

Mapping of a linear address onto a physical address

Protection on x86 Both Linux and Win32, only 0 and 3 are used Access to segments done by evaluating: CPL: internal register stores current privilege level DPL: descriptor privilege level RPL: requestor’s privilege level Level