Simulation of Memory Management Using Paging Mechanism in Operating Systems Tarek M. Sobh and Yanchun Liu Presented by: Bei Wang University of Bridgeport.

Slides:



Advertisements
Similar presentations
PROCESS SCHEDULING AND SYNCRONIZATION
Advertisements

Lecture 5 Memory Management Part I. Lecture Highlights  Introduction to Memory Management  What is memory management  Related Problems of Redundancy,
CS 149: Operating Systems February 3 Class Meeting
OS, , Part II CPU Scheduling Department of Computer Engineering, PSUWannarat Suntiamorntut.
Operating Systems Review.
Allocating Memory.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Chapter 3: CPU Scheduling
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Memory Management Chapter 4. Memory hierarchy Programmers want a lot of fast, non- volatile memory But, here is what we have:
Scheduling in Batch Systems
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Cs238 CPU Scheduling Dr. Alan R. Davis. CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU.
Computer Organization and Architecture
04/21/2004CSCI 315 Operating Systems Design1 Disk Scheduling.
Maninder Kaur VIRTUAL MEMORY 24-Nov
Memory Management Part II
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Maximum CPU utilization.
Chapter 6: CPU Scheduling
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
Lecture 7 Disc Scheduling.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
OPERATING SYSTEMS - I. What is an Operating System OS is a program that manages the computer hardware It provides a basis for application programs and.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Parametric Optimization Of Some Critical Operating System Functions An Alternative Approach To The Study Of Operating Systems Design.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 5: CPU Scheduling Basic.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
CS 149: Operating Systems March 5 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Memory Management.
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
UNIT–IV: Memory Management
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 15 – Part 1 The Internal Operating System
Operating System Concepts
So far… Text RO …. printf() RW link printf Linking, loading
Chapter3 Memory Management Techniques
Main Memory Background Swapping Contiguous Allocation Paging
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
CPU SCHEDULING SIMULATION
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
CPU Scheduling ( Basic Concepts)
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Module IV Memory Organization.
Presentation transcript:

Simulation of Memory Management Using Paging Mechanism in Operating Systems Tarek M. Sobh and Yanchun Liu Presented by: Bei Wang University of Bridgeport

Table of Content Parametric Optimization Introduction Memory Management Paging CPU Scheduling Simulation Specifications Variable Parameters Fixed Parameters Other Parameters Simulation Goal Memory Management Paging Model CPU Scheduling Model Implementation Framework Simulation Results Conclusion

Parametric Optimization An Alternative Approach of OS Study What is the critical OS function? What are the parameters involved? How to measure the performance? What is the relationship between parameter and performance? How to achieve optimization using simulation techniques?

Parametric Optimization of Some Critical Operating System Functions Some Critical Operating System Functions Memory Management Synchronization and Deadlock Handling CPU Scheduling Disc Scheduling study parameter performance relationships achieve parametric optimization using simulation technique … … … … … … The Integrated Perspective

Introduction Multi-Process OS Memory Management Paging Mechanism CPU Scheduling

Memory Management Keep track of memory in use Memory allocation Manage swapping between main memory and disk

Memory Management (Cont.) Three disadvantage related to memory management are Synchronization Redundancy Fragmentation

Memory Management (Cont.) Parameters involved Memory Size Disc access time (transfer time, latency and seek) Time slot for RR Compaction thresholds (percentage and hole size) RAM access time Fitting Algorithm Disc Scheduling algorithm choice (FIFO, SSTF, SCAN, LOOK, etc) Disc Structure and Capacity (Surfaces/tracks/etc.) Disc writing mechanism (where to write back processed pages)

Paging Paging entails division of physical memory into many equal-sized frames When a process is to be executed, its pages are loaded into any available memory frames

Paging Parameters Involved The parameters involved in this memory management scheme are: Page Size Page Replacement Algorithms, such as First-In-First-Out, Least-Recent-Used, Least-Frequently-Used and Random

Paging Effect of Page Size Large page size: internal fragmentation Small page size: requires large amounts of memory space to be allocated for page tables and more memory accesses potentially Finding an optimal page size: not easy, dependent on the process mix and the pattern of access.

Paging Effect of Page Replacement Algorithms LRU, FIFO, LFU and Random replacement are four of the more common schemes in use LRU is often used and is considered to be quite good LRU may require substantial hardware assistance

Paging Performance Measures Average Waiting Time Average Turnaround Time CPU utilization CPU throughput Replacement ratio (The ratio of number of page replacement to total number page accesses )

CPU Scheduling Round Robin Mechanism Scheduling Criteria

CPU Scheduling Round Robin Mechanism Timesharing systems: a small unit of time – a time quantum is used Ready queue: circular queue CPU scheduler: traverses the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum

CPU Scheduling Scheduling Criteria CPU utilization: 40 percent (lightly loaded) to 90 percent (heavily used) Throughput: The number of processes that are completed per time unit. Turnaround time: The interval from the time of submission of a process to the time of completion. Waiting time

Simulation Specifications Methodology 4 page replacement algorithms Randomizer: page access pattern dynamic algorithm: number of memory pages to be assigned to a process Analyze the collected data and examine their inter-relationship

Simulation Specifications Variable parameters Disc access time (seek + latency + (job size (in bytes)/500000) ms, where, seek and latency are variable parameters) Round Robin time Slot (a variable parameter, multiple of 1ms)

Simulation Specifications Fixed parameters Disc configuration (8 surfaces and 300 tracks/surface). Process sizes range (20KB to 2MB) Disc writing mechanism Disc capacity (512 MB, initially 50% full with jobs) Memory Size (32MB) RAM Access Time (14ms) Process execution times (2 ms to 100ms)

Simulation Specifications Other Parameters Page access: random generator Timing wheel data structure CPU Round Robin fashion: as long as there are processes in the first level of the queue

Simulation Specifications Simulation goal The goal is to optimize some of the following performance measures such as: Average waiting time Average turnaround time CPU utilization Maximum turnaround time Maximum waiting time CPU throughput

Memory Management Paging Module Disk: m processes are created (50% full) Page assignment: pages in memory proportional with process size Place new page in transfer queue from disk to memory Processor execute a chosen process: RR Move finished process from memory to disk (FCFS) Simultaneous execution of processes and transfer between disk and memory Page fault: a page is not available in the memory

Memory Management Paging Module (Cont.) Page sequences to be fetched from memory are generated randomly using the following mechanism : no new page is requested if a previously requested page is in transfer Remove page which belongs to current process: 4 algorithms, FIFO queue The current process transfers to a wait state: caused the page fault The simulation ends when all the processes finish execution and the queue is free.

Implementation Framework Process control block Queue Main memory Disk Drive CPU Simulator

Simulation Results Different combinations of parameters Eliminate the worst performing parameter combinations For example, if the simulation shows that a large time slot is superior to small ones, only large time slots are used in the simulation.

Simulation Result Parameters change according to page sizes FIFO/Time Slot 8 FIFO/Time Slot 4

Simulation Result Parameters change according to page sizes (Cont.) LRU/Time slot 8 LRU/Time slot 4

Simulation Result Parameters change according to page replacement schemes Page Size 2KB/Time slot 6 Page Size 2KB/Time slot 12

Simulation Result Parameters change according to page replacement schemes (Cont.) Page Size 4KB/Time slot 6.Page Size 4KB/Time slot 12

Simulation Result Effects of different time slots on different parameters Page Size 8KB/FIFOPage Size 16KB/RAND

Conclusion Parameter Analysis Page Size Page Replacement Algorithm Round Robin Time Slot Best Combination of parameters

Conclusion Parameter Analysis (Cont.) Smaller page: more references in memory  longer ATT Smaller page: less internal fragmentation, more disk access time Large page: degeneration to continuous memory scheme; shorten ATT and increase CPU performance

Conclusion Parameter Analysis (Cont.) Random replacement performs best Page replacement ratio of LFU: high if page size >= 4KB Small RR time slot: higher context switch time, low CPU utilization, high turnaround time and waiting time

Future Work Modify to serve a specific platform or system Test the parameters in extremely multiplexed systems Some other parameters could also be simulated For example, the disk drive searching mechanism affects the turn around time of a process

References Tarek M.Sobh & Abhilasha Tibrewal, Parametric optimization of some critical operating system functions-an alternative approach to the study of operating system design, Bridgeport, CT, University of Bridgeport, Department of Computer Science and Engineering Wenle Zhao, Non-Platform Based Operating System Optimization, Bridgeport, CT, University of Bridgeport, Department of Computer Science and Engineering Avi Silberschatz, Peter Gal,1999, Applied operating system concepts, John Wiiley & Sons, Inc. Abraham Silberschatz, Peter Baer, 1999, Operating System Concepts (5th ed.).New York: John Wiley & Sons, Inc. Andrew S.Tan, Operating systems: design and implementation. New Jersey: Prentice-Hall, Inc.

Thank You