1 Tuesday, July 04, 2006 "Programs expand to fill the memory available to hold them." - Modified Parkinson’s Law.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Page Table Implementation
Memory Management.
Paging Hardware With TLB
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Main Memory CS Memory Management1. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main.
Chapter 9: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Chapter 9: Memory Management Background.
Background A program must be brought into memory and placed within a process for it to be executed. Input queue – collection of processes on the disk that.
Memory Management.
03/10/2004CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Memory Management Gordon College Stephen Brinton.
Chapter 7: Main Memory CS 170, Fall Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
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.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Chapter 8: Main Memory.
 Background  Swapping  Contiguous Allocation  Paging  Segmentation  Segmentation with Paging.
Chap 8 Memory Management. Background Program must be brought into memory and placed within a process for it to be run Input queue – collection of processes.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Chapter 8: Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Background Program must be brought.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 8: Memory Management.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 8: Main Memory.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Operating Systems Chapter 8
Chapter 8 Memory Management Dr. Yingwu Zhu. Outline Background Basic Concepts Memory Allocation.
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.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 34 Paging Implementation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Lecture 8: Memory Management. Lecture 8 / Page 2AE4B33OSS Silberschatz, Galvin and Gagne ©2005 Contents Problems of memory management Dynamic allocation.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
Memory Management 1. Background Programs must be brought (from disk) into memory for them to be run Main memory and registers are only storage CPU can.
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.
CE Operating Systems Lecture 14 Memory management.
1 Memory Management (b). 2 Paging  Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter.
Chapter 8: Memory-Management Strategies. 8.2Operating System Principles Chapter 8: Memory-Management Strategies Background Swapping Contiguous Memory.
9.1 Operating System Concepts Paging Example. 9.2 Operating System Concepts.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Paging Paging is a memory-management scheme that permits the physical-address space of a process to be noncontiguous. Paging avoids the considerable problem.
Chapter 8: Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation.
Page Table Implementation. Readings r Silbershatz et al:
Memory Management. Background Memory consists of a large array of words or bytes, each with its own address. The CPU fetches instructions from memory.
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.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 8: Main Memory.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging.
Chapter 2: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts.
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.
Ghsong  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with.
Memory: Page Table Structure CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Chapter 8: Main Memory.
Paging and Segmentation
Operating System Concepts
So far in memory management…
Presentation transcript:

1 Tuesday, July 04, 2006 "Programs expand to fill the memory available to hold them." - Modified Parkinson’s Law.

2 Contiguous allocation §Suffers from external fragmentation §Compaction is time consuming §Used in earlier batch systems §What if a process needs to grow beyond the partition allocated to it?

3 Paging §Permit address space of processes to be non-contiguous.

4 Paging – Hardware support §Pages and frames §Page number and offset §Internal fragmentation

5 Address Translation Architecture

6 §Why are page sizes powers of two?

7 §Every memory access has to go through the page table. §Hardware page table l Limited number of entries §Paging increases context switch time

8 Implementation of Page Table §Page table is kept in main memory. §Page-table base register (PTBR) points to the page table. §Context switch time compared to hardware page table.

9 Implementation of Page Table §In this scheme every data/instruction access requires two memory accesses. One for the page table and one for the data/instruction. §Solution: fast-lookup hardware cache called associative memory or translation look-aside buffers (TLBs).

10 Paging Hardware With TLB

11 TLB §Context switch §Address space IDs

12 Effective Access Time §Associative Lookup =  time unit §Assume memory cycle time is 1 microsecond §Hit ratio – percentage of times that a page number is found in the associative registers; ration related to number of associative registers. §Hit ratio = 

13 Effective Access Time §Associative Lookup =  time unit §Hit ratio =  §Effective Access Time (EAT) EAT = (1 +  )  + (2 +  )(1 –  ) = 2 +  – 

14 Page Table Size §Internal fragmentation §Unused program in memory §Page table size l Hardware page table §Transfers to and from disk

15 Memory Protection §Memory protection implemented by associating protection bit with each frame. §Valid-invalid bit attached to each entry in the page table: l “valid” indicates that the associated page is in the process’ logical address space, and is thus a legal page. l “invalid” indicates that the page is not in the process’ logical address space.

16 Valid (v) or Invalid (i) Bit In A Page Table

17 Two-Level Paging Example §A logical address (on 32-bit machine with 4K page size) is divided into: l a page number consisting of 20 bits. l a page offset consisting of 12 bits. §Since the page table is paged, the page number is further divided into: l a 10-bit page number. l a 10-bit page offset.

18 Two-Level Paging Example §Thus, a logical address is as follows: where p i is an index into the outer page table, and p 2 is the displacement within the page of the outer page table. page number page offset pipi p2p2 d 10 12

19

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

21 Inverted Page Table §One entry for each real page of memory. §Entry consists of the virtual 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.

22 Inverted Page Table Architecture

23 Hashed Page Tables §Common in address spaces > 32 bits. §The virtual page number is hashed into a page table. This page table contains a chain of elements hashing to the same location. §Virtual page numbers are compared in this chain searching for a match. If a match is found, the corresponding physical frame is extracted.

24 Hashed Page Table

25 Shared Pages Example

26 Virtual Memory That is Larger Than Physical Memory

27 Transfer of a Paged Memory to Disk Space

28 Valid-Invalid Bit §With each page table entry a valid– invalid bit is associated (1  in-memory, 0  not-in- memory) §Initially valid–invalid bit is set to 0 on all entries.

29 Valid-Invalid Bit §Example of a page table snapshot. During address translation, if valid– invalid bit in page table entry is 0  page fault  Frame #valid-invalid bit page table

30 Page Table When Some Pages Are Not in Main Memory