LOGICAL AND PHYSICAL ORGANIZATION MEMORY MANAGEMENT TECHNIQUES (CONT D)

Size: px
Start display at page:

Download "LOGICAL AND PHYSICAL ORGANIZATION MEMORY MANAGEMENT TECHNIQUES (CONT D)"

Transcription

1 MEMORY MANAGEMENT Requirements: Relocation (to different memory areas) Protection (run time, usually implemented together with relocation) Sharing (and also protection) Logical organization Physical organization Key terms: Frame a fixed-size block of the main memory Page a fixed-size block of data (secondary memory) A page may temporarily be copied into a frame Segment a variable-size block of data (secondary memory) An entire segment may temporarily be copied into the main memory (segmentation) or the segment may be divided into pages which can be individually copied into the main memory (combined segmentation and paging) LOGICAL AND PHYSICAL ORGANIZATION Logical organization is linear Different parts of the memory can have different permissions (read-write, read-only, etc.) Best implemented using segmentation Physical organization cannot be linear Cannot leave the responsibility of managing memory to the programmer Memory requirements may exceed physical memory, are unknown at build time anyway MEMORY MANAGEMENT/1 MEMORY MANAGEMENT/2 MEMORY MANAGEMENT TECHNIQUES MEMORY MANAGEMENT TECHNIQUES (CONT D) External fragmentation = memory exists to satisfy a request, but is not contiguous Internal fragmentation = allocated memory may be slightly larger than requested memory; difference not used Fixed Partitioning: Main memory is divided into a number of static partitions; a process may be loaded into a partition of equal or greater size Simple to implement, but inefficient (internal fragmentation) Maximum number of active processes is fixed Dynamic Partitioning: Partitions are created dynamically, so that each process is loaded into a partition of exactly the same size as that process No internal fragmentation, more efficient use of main memory Need for compaction to counter external fragmentation (increased CPU load) Simple Paging: Main memory divided into a number of equal-size frames; each process is divided into a number of equal-size pages (same size as frames); a process is loaded by loading all of its pages into available, not necessarily contiguous, frames No external fragmentation; some (small) internal fragmentation Simple Segmentation: Process divided into a number of segments; process is loaded by loading all of its segments into dynamic partitions (need not be contiguous) No internal fragmentation, improved memory utilization, reduced overhead vs. dynamic partitioning External fragmentation Virtual Memory Paging: As with simple paging, except that it is not necessary to load all of the pages of a process; nonresident pages are brought in later, as needed No external fragmentation, higher degree of multiprogramming, large virtual address space Overhead of complex memory management Virtual Memory Segmentation: As with simple segmentation, but is not necessary to load all of the segments; nonresident segments are brought in later, as needed No internal fragmentation, higher degree of multiprogramming, large virtual address space, protection and sharing support Overhead of complex memory management MEMORY MANAGEMENT/3 MEMORY MANAGEMENT/4

2 PARTITIONING Same-size partitions All programs occupy the same amount of space no matter their size = inefficient, internal fragmentation (whenever program data smaller than partition size) Unequal size partitions Existence of smaller partitions reduce the internal fragmentation Memory assignment: queues of processes waiting to be brought into main memory A single queue or one queue per partition size The fixed number of partitions limits the number of active processes in the system Small jobs will not utilize partition space efficiently Programs larger than any partition loaded via overlays OS can only swap out whole processes if needed DYNAMIC PARTITIONING Process is allocated exactly as much memory as it requires = partitions of variable length and number Used by IBM s mainframe operating system OS/MVT Placement algorithms: Best-fit: chooses the block that is closest in size to the request First-fit: first block that is large enough Next-fit: next large enough block since the last allocation Main disadvantage: external fragmentation Memory utilization declines as memory becomes more and more fragmented Solution: compacting = OS shifts processes in memory so that they are contiguous and free memory is in one block; costly MEMORY MANAGEMENT/5 MEMORY MANAGEMENT/6 DYNAMIC PARTITIONING DYNAMIC PARTITIONING (CONT D) Process is allocated exactly as much memory as it requires = partitions of variable length and number Used by IBM s mainframe operating system OS/MVT Placement algorithms: Best-fit: chooses the block that is closest in size to the request First-fit: first block that is large enough Next-fit: next large enough block since the last allocation Main disadvantage: external fragmentation Memory utilization declines as memory becomes more and more fragmented Solution: compacting = OS shifts processes in memory so that they are contiguous and free memory is in one block; costly MEMORY MANAGEMENT/6 MEMORY MANAGEMENT/7

3 RELOCATION PAGING Logical address = reference to memory location independent on the assignment of data to memory Relative address = address expressed as a location relative to some known point Physical/Absolute address: actual location in main memory Relocation: Logical address relative (to the beginning of the process) address physical address Needs hardware support = Memory Management Unit (MMU) Partition memory into equal fixed-size chunks that are relatively small (pages) Process is also divided into small fixed-size chunks of the same size (frames) Key data structure: page table Maintained by operating system for each process Contains the frame location for each page in the process Processor must know how to access for the current process Used by processor to produce a physical address MEMORY MANAGEMENT/8 MEMORY MANAGEMENT/9 LOGICAL ADDRESS AND PAGING/SEGMENTATION LOGICAL ADDRESS AND PAGING MEMORY MANAGEMENT/10 MEMORY MANAGEMENT/11

4 SEGMENTATION LOGICAL ADDRESS AND SEGMENTATION A program can be subdivided into segments May vary in length Maximum length usually given Addressing consists of two parts: Segment number Offset Similar to dynamic partitioning Eliminates internal fragmentation MEMORY MANAGEMENT/12 MEMORY MANAGEMENT/13 VIRTUAL MEMORY PRINCIPLE OF LOCALITY Not necessary that all the process is in memory as long as all references are logical addresses and address space can be split into pages OS brings into main memory a few pieces of the program = resident set An interrupt is generated when an address is needed but is in the virtual memory (usually on disk) instead of the main memory OS places the process in a Blocked state while the missing piece is brought into the main memory Operating system issues a disk I/O Read request (usually) Another process is dispatched to run while the disk I/O takes place When disk I/O is complete (interrupt), the affected process is placed back in the Ready state More processes can be maintained in the main memory Only some of the pieces of each process are loaded With so many processes in main memory it is very likely a process will be in the Ready state at any particular time A process can even be larger than all of the main memory! Main problem: Thrashing = the system spends most of its time swapping process pieces rather than executing instructions To avoid this, the OS tries to guess based on recent history which pieces are least likely to be used in the near future Guess is based on the principle of locality Program and data references within a process tend to cluster Only a few pieces of a process will be needed over a short period of time Therefore it is possible to make intelligent guesses about which pieces will be needed in the future MEMORY MANAGEMENT/14 MEMORY MANAGEMENT/15

5 HARDWARE SUPPORT FOR VIRTUAL MEMORY MEMORY MANAGEMENT FORMATS Hardware must support paging and segmentation OS must include software for managing the movement of pages and/or segments between secondary memory and main memory Virtual memory is usually associated with systems that employ paging Each process has its own page table Each page table entry contains the frame number of the corresponding page in main memory MEMORY MANAGEMENT/16 MEMORY MANAGEMENT/17 ADDRESS TRANSLATION TWO-LEVEL HIERARCHICAL PAGE TABLE MEMORY MANAGEMENT/18 MEMORY MANAGEMENT/19

6 ADDRESS TRANSLATION IN A TWO-LEVEL PAGING SYSTEM INVERTED PAGE TABLE Page number portion of a virtual address is mapped into a hash value Hash value points to inverted page table Fixed proportion of real memory is required for the tables regardless of the number of processes or virtual pages supported Structure is called inverted because it indexes page table entries by frame number rather than by virtual page number MEMORY MANAGEMENT/20 MEMORY MANAGEMENT/21 TRANSLATION LOOKASIDE BUFFER (TLB) TLB ALGORITHM Problem: Each virtual memory reference can cause two physical memory accesses: one to fetch the page table entry one to fetch the data Solution: use a special highspeed cache called a translation lookaside buffer MEMORY MANAGEMENT/22 MEMORY MANAGEMENT/23

7 ASSOCIATIVE MAPPING TLB AND CACHE TLB cannot be indexed on page number (it contains only some page table entries) TLB entry must include the page number as well as the complete page table entry Hardware that allows simultaneously interrogation of a number of TLB entries to determine if there is a match on page number = associative mapping MEMORY MANAGEMENT/24 MEMORY MANAGEMENT/25 PAGE SIZE COMBINED PAGING AND SEGMENTATION The smaller the page size, the lesser the amount of internal fragmentation However, more pages are required per process More pages per process means larger page tables For large programs in a heavily multiprogrammed environment some portion of the page tables of active processes must be in virtual memory instead of main memory The physical characteristics of most secondary-memory devices favor a larger page size for more efficient block transfer of data Computer Atlas Honeywell-Multics IBM 370/XA IBM 370/ESA VAX family IBM AS/400 DEC Alpha MIPS UltraSPARC Pentium IBM POWER Itanium Page Size bit words bit words 4 KB 512 bytes 512 bytes 8 KB 4 KB to 16 MB 8 KB to 4 MB 4 KB or 4 MB 4 KB 4 KB to 256 MB Segmentation allows programmer to view memory as consisting of multiple address spaces (or segments) Simplifies handling of large data structures Facilitates sharing data among processes Facilitates protection Each segment table entry contains the starting address of the corresponding segment in main memory and the length of the segment A bit is needed to determine if the segment is already in main memory Another bit is needed to determine if the segment has been modified since it was loaded in main memory In a combined paging/segmentation system a user s address space is broken up into a number of segments Each segment is broken up into a number of fixed-sized pages which are equal in length to a main memory frame Segmentation is visible to the programmer, paging is transparent MEMORY MANAGEMENT/26 MEMORY MANAGEMENT/27

8 ADDRESS TRANSLATION PROTECTION RELATIONSHIP Segmentation lends itself to the implementation of protection and sharing policies Each entry has a base address and length so inadvertent memory access can be controlled Sharing can be achieved by segments referencing multiple processes Each entry in segment table features: Validation bit (0 = illegal segment) Read/write/execute privileges MEMORY MANAGEMENT/28 MEMORY MANAGEMENT/29 OS MEMORY MANAGEMENT SOFTWARE VIRTUAL MEMORY FETCH POLICIES The design of the memory management portion of an operating system depends on three fundamental areas of choice: Whether or not to use virtual memory techniques The use of paging or segmentation or both The algorithms employed for various aspects of memory management Fetch policy: Determines when a page should be brought into memory Demand paging only brings pages into main memory when a reference is made to a location on the page Many page faults when process is first started But drops as more and more pages are brought in (principle of locality most future references will be to pages that have recently been brought in) Prepaging once a page is demanded, more are brought in Exploits the characteristics of most secondary memory devices If pages of a process are stored contiguously in secondary memory it is more efficient to bring in a number of pages at one time Ineffective if extra pages are not referenced MEMORY MANAGEMENT/30 MEMORY MANAGEMENT/31

9 VIRTUAL MEMORY PLACEMENT AND REPLACEMENT POLICIES Placement determines where in real memory a process piece is to reside Important design issue in a segmentation system But irrelevant to paging or combined paging with segmentation (hardware performs functions with equal efficiency) Replacement deals with the selection of a page in main memory to be replaced when a new page must be brought in Objective: the page that is removed is the page least likely to be referenced in the near future The more elaborate the better at guessing, but at the cost of greater hardware and software overhead Frame Locking: When a frame is locked the page currently stored in that frame may not be replaced The kernel as well as key control structures are held in locked frames I/O buffers and time-critical areas may be locked into main memory frames Achieved by associating a lock bit with each frame BASIC PAGE REPLACEMENT ALGORITHMS Optimal: Selects page for which the time to the next reference is the longest (ideal) Least Recently Used (LRU): Replaces the page that has not been referenced for the longest time Principle of locality LRU = page least likely to be referenced in the near future Difficult to implement, substantial overhead One approach is to tag each page with the time of last reference MEMORY MANAGEMENT/32 MEMORY MANAGEMENT/33 BASIC PAGE REPLACEMENT ALGORITHMS (CONT D) THE CLOCK REPLACEMENT ALGORITHM (CONT D) First-in-First-out (FIFO): Treats page frames allocated to a process as a circular buffer; pages are removed in round-robin style Simple to implement, page that has been in memory the longest is replaced Clock: Associates a use bit with each frame, initialized with 1 on load Any frame with a use bit of 1 is passed over by the algorithm (but the bit is reset) Page frames visualized as laid out in a circle MEMORY MANAGEMENT/34 MEMORY MANAGEMENT/35

10 COMPARISON OF PAGE REPLACEMENT ALGORITHMS ADDITIONAL REPLACEMENT POLICIES Page buffering: A replaced page is assigned to the free page list or modified page list (as the case might be) Pages are written to disk in clusters to improve efficiency Replacement Policy and Cache Size: With large caches replacement of pages can have a performance impact; if the page frame to be replaced is in the cache then that cache block is lost as well Resident Set Management: The OS must decide how many pages to bring into main memory The smaller the amount of memory allocated to each process, the more processes can reside in memory But small number of pages loaded increases page faults But beyond a certain size further allocation of pages will not effect page fault rate Fixed-allocation gives a process a fixed number of frames in main memory within which to execute (page fault one of the pages of that process is replaced) Variable-allocation allows the number of frames allocated to a process to vary MEMORY MANAGEMENT/36 MEMORY MANAGEMENT/37 ADDITIONAL REPLACEMENT POLICIES (CONT D) LOAD CONTROL Replacement Scope Local: chooses only among the resident pages of the process that generated the page fault Global: considers all unlocked pages in main memory (not possible for fixed allocation) Most used policy: variable allocation, global scope Cleaning policy: determine when a modified page should be written out to secondary memory Demand Cleaning: a page is written out only when it has been selected for replacement Precleaning: allows the writing of pages in batches Determines the number of processes that will be resident in main memory Critical in effective memory management Too few processes, many occasions when all processes will be blocked and much time will be spent in swapping Too many processes will lead to thrashing If the degree of multiprogramming is to be reduced, one or of the currently resident processes must be swapped out; six possibilities exist: Lowest-priority process Faulting process Last process activated Process with the smallest resident set Largest process Process with the largest remaining execution window Do not confuse swapping with page replacement! MEMORY MANAGEMENT/38 MEMORY MANAGEMENT/39

11 LINUX MEMORY MANAGEMENT Two main aspects: process virtual memory and kernel memory allocation Three-level page table structure for the virtual memory KERNEL MEMORY ALLOCATION IN LINUX Page allocator inefficient because the kernel usually requires small chunks in odd sizes A buddy algorithm (power-of-two allocator) and slab allocation are used so that memory for the kernel can be allocated and deallocated in units of one or more pages Page replacement based on the clock algorithm, with an 8-bit age variable (incremented each time a page is accessed, decremented periodically) An age of 0 not accessed in a long time, best candidate for replacement (LRU) MEMORY MANAGEMENT/40 MEMORY MANAGEMENT/41 OTHER ADVANTAGES OF VIRTUAL MEMORY COPY ON WRITE Process creation: Copy-on-write (COW) Allows both parent and child processes to initially share the same pages If either process modifies a shared page, only then is the page copied Allows more efficient process creation as only modified pages are copied Memory-mapped files Memory-mapped file I/O allows file I/O to be treated as routine memory access by mapping a disk block to a page in memory A file is initially read using demand paging. A page-sized portion of the file is read from the file system into a physical page. Subsequent reads/writes to/from the file are treated as ordinary memory accesses. Simplifies file access by treating file I/O through memory rather than read() and write() system calls Also allows several processes to map the same file allowing the pages in memory to be shared Mapping of shared libraries Before any writing takes place: MEMORY MANAGEMENT/42 MEMORY MANAGEMENT/43

12 COPY ON WRITE (CONT D) SHARED LIBRARIES As soon as Process 1 modifies Page C: MEMORY MANAGEMENT/44 MEMORY MANAGEMENT/45 MEMORY MAPPED FILES MEMORY MANAGEMENT/46

Chapter 7 Memory Management

Chapter 7 Memory Management Operating Systems: Internals and Design Principles Chapter 7 Memory Management Eighth Edition William Stallings Frame Page Segment A fixed-length block of main memory. A fixed-length block of data that

More information

Operating Systems, 6 th ed. Test Bank Chapter 7

Operating Systems, 6 th ed. Test Bank Chapter 7 True / False Questions: Chapter 7 Memory Management 1. T / F In a multiprogramming system, main memory is divided into multiple sections: one for the operating system (resident monitor, kernel) and one

More information

Chapter 7 Memory Management

Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 7 Memory Management Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Memory Management Subdividing

More information

Memory Management Outline. Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging

Memory Management Outline. Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging Memory Management Outline Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging 1 Background Memory is a large array of bytes memory and registers are only storage CPU can

More information

OPERATING SYSTEM - VIRTUAL MEMORY

OPERATING SYSTEM - VIRTUAL MEMORY OPERATING SYSTEM - VIRTUAL MEMORY http://www.tutorialspoint.com/operating_system/os_virtual_memory.htm Copyright tutorialspoint.com A computer can address more memory than the amount physically installed

More information

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering Memory management basics (1) Requirements (1) Operating Systems Part of E1.9 - Principles of Computers and Software Engineering Lecture 7: Memory Management I Memory management intends to satisfy the following

More information

OPERATING SYSTEM - MEMORY MANAGEMENT

OPERATING SYSTEM - MEMORY MANAGEMENT OPERATING SYSTEM - MEMORY MANAGEMENT http://www.tutorialspoint.com/operating_system/os_memory_management.htm Copyright tutorialspoint.com Memory management is the functionality of an operating system which

More information

Operating Systems. Virtual Memory

Operating Systems. Virtual Memory Operating Systems Virtual Memory Virtual Memory Topics. Memory Hierarchy. Why Virtual Memory. Virtual Memory Issues. Virtual Memory Solutions. Locality of Reference. Virtual Memory with Segmentation. Page

More information

Memory unit sees only the addresses, and not how they are generated (instruction counter, indexing, direct)

Memory unit sees only the addresses, and not how they are generated (instruction counter, indexing, direct) Memory Management 55 Memory Management Multitasking without memory management is like having a party in a closet. Charles Petzold. Programming Windows 3.1 Programs expand to fill the memory that holds

More information

& Data Processing 2. Exercise 3: Memory Management. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen

& Data Processing 2. Exercise 3: Memory Management. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen Folie a: Name & Data Processing 2 3: Memory Management Dipl.-Ing. Bogdan Marin Fakultät für Ingenieurwissenschaften Abteilung Elektro-und Informationstechnik -Technische Informatik- Objectives Memory Management

More information

Virtual vs Physical Addresses

Virtual vs Physical Addresses Virtual vs Physical Addresses Physical addresses refer to hardware addresses of physical memory. Virtual addresses refer to the virtual store viewed by the process. virtual addresses might be the same

More information

Virtual Memory. Virtual Memory. Paging. CSE 380 Computer Operating Systems. Paging (1)

Virtual Memory. Virtual Memory. Paging. CSE 380 Computer Operating Systems. Paging (1) Virtual Memory CSE 380 Computer Operating Systems Instructor: Insup Lee University of Pennsylvania Fall 2003 Lecture Note: Virtual Memory (revised version) 1 Recall: memory allocation with variable partitions

More information

The Deadlock Problem. Deadlocks. Deadlocks. Bridge Crossing Example

The Deadlock Problem. Deadlocks. Deadlocks. Bridge Crossing Example The Deadlock Problem Deadlocks A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example System has 2 tape drives. P 1 and P 2 each

More information

Memory Management 1. Memory Management. Multitasking without memory management is like having a party in a closet.

Memory Management 1. Memory Management. Multitasking without memory management is like having a party in a closet. Memory Management 1 Memory Management Multitasking without memory management is like having a party in a closet. Charles Petzold. Programming Windows 3.1 Programs expand to fill the memory that holds them.

More information

Lecture 17: Virtual Memory II. Goals of virtual memory

Lecture 17: Virtual Memory II. Goals of virtual memory Lecture 17: Virtual Memory II Last Lecture: Introduction to virtual memory Today Review and continue virtual memory discussion Lecture 17 1 Goals of virtual memory Make it appear as if each process has:

More information

W4118: segmentation and paging. Instructor: Junfeng Yang

W4118: segmentation and paging. Instructor: Junfeng Yang W4118: segmentation and paging Instructor: Junfeng Yang Outline Memory management goals Segmentation Paging TLB 1 Uni- v.s. multi-programming Simple uniprogramming with a single segment per process Uniprogramming

More information

COS 318: Operating Systems. Virtual Memory and Address Translation

COS 318: Operating Systems. Virtual Memory and Address Translation COS 318: Operating Systems Virtual Memory and Address Translation Today s Topics Midterm Results Virtual Memory Virtualization Protection Address Translation Base and bound Segmentation Paging Translation

More information

Computer-System Architecture

Computer-System Architecture Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection General System Architecture 2.1 Computer-System Architecture 2.2 Computer-System

More information

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont.

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont. CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont. Instructors: Vladimir Stojanovic & Nicholas Weaver http://inst.eecs.berkeley.edu/~cs61c/ 1 Bare 5-Stage Pipeline Physical Address PC Inst.

More information

Chapter 11 I/O Management and Disk Scheduling

Chapter 11 I/O Management and Disk Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ 2008, Prentice Hall I/O Devices Roadmap Organization

More information

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems Lecture Outline Operating Systems Objectives Describe the functions and layers of an operating system List the resources allocated by the operating system and describe the allocation process Explain how

More information

W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems. Instructor: Junfeng Yang W4118 Operating Systems Instructor: Junfeng Yang Outline x86 segmentation and paging hardware Linux address space translation Copy-on-write Linux page replacement algorithm Linux dynamic memory allocation

More information

Chapter 12. Paging an Virtual Memory Systems

Chapter 12. Paging an Virtual Memory Systems Chapter 12 Paging an Virtual Memory Systems Paging & Virtual Memory Virtual Memory - giving the illusion of more physical memory than there really is (via demand paging) Pure Paging - The total program

More information

Memory Management CS 217. Two programs can t control all of memory simultaneously

Memory Management CS 217. Two programs can t control all of memory simultaneously Memory Management CS 217 Memory Management Problem 1: Two programs can t control all of memory simultaneously Problem 2: One program shouldn t be allowed to access/change the memory of another program

More information

Computer Architecture

Computer Architecture Computer Architecture Slide Sets WS 2013/2014 Prof. Dr. Uwe Brinkschulte M.Sc. Benjamin Betting Part 11 Memory Management Computer Architecture Part 11 page 1 of 44 Prof. Dr. Uwe Brinkschulte, M.Sc. Benjamin

More information

Chapter 12 File Management

Chapter 12 File Management Operating Systems: Internals and Design Principles Chapter 12 File Management Eighth Edition By William Stallings Files Data collections created by users The File System is one of the most important parts

More information

OPERATING SYSTEMS MEMORY MANAGEMENT

OPERATING SYSTEMS MEMORY MANAGEMENT OPERATING SYSTEMS MEMORY MANAGEMENT Jerry Breecher 8: Memory Management 1 OPERATING SYSTEM Memory Management What Is In This Chapter? Just as processes share the CPU, they also share physical memory. This

More information

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study CS 377: Operating Systems Lecture 25 - Linux Case Study Guest Lecturer: Tim Wood Outline Linux History Design Principles System Overview Process Scheduling Memory Management File Systems A review of what

More information

Chapter 11 I/O Management and Disk Scheduling

Chapter 11 I/O Management and Disk Scheduling Operatin g Systems: Internals and Design Principle s Chapter 11 I/O Management and Disk Scheduling Seventh Edition By William Stallings Operating Systems: Internals and Design Principles An artifact can

More information

CS5460: Operating Systems

CS5460: Operating Systems CS5460: Operating Systems Lecture 13: Memory Management (Chapter 8) Where are we? Basic OS structure, HW/SW interface, interrupts, scheduling Concurrency Memory management Storage management Other topics

More information

Operating Systems CSE 410, Spring 2004. File Management. Stephen Wagner Michigan State University

Operating Systems CSE 410, Spring 2004. File Management. Stephen Wagner Michigan State University Operating Systems CSE 410, Spring 2004 File Management Stephen Wagner Michigan State University File Management File management system has traditionally been considered part of the operating system. Applications

More information

Chapter 12 File Management

Chapter 12 File Management Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 12 File Management Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Roadmap Overview File organisation and Access

More information

Chapter 12 File Management. Roadmap

Chapter 12 File Management. Roadmap Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 12 File Management Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Overview Roadmap File organisation and Access

More information

Board Notes on Virtual Memory

Board Notes on Virtual Memory Board Notes on Virtual Memory Part A: Why Virtual Memory? - Letʼs user program size exceed the size of the physical address space - Supports protection o Donʼt know which program might share memory at

More information

The Classical Architecture. Storage 1 / 36

The Classical Architecture. Storage 1 / 36 1 / 36 The Problem Application Data? Filesystem Logical Drive Physical Drive 2 / 36 Requirements There are different classes of requirements: Data Independence application is shielded from physical storage

More information

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2) RTOSes Part I Christopher Kenna September 24, 2010 POSIX Portable Operating System for UnIX Application portability at source-code level POSIX Family formally known as IEEE 1003 Originally 17 separate

More information

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems 1 Any modern computer system will incorporate (at least) two levels of storage: primary storage: typical capacity cost per MB $3. typical access time burst transfer rate?? secondary storage: typical capacity

More information

Two Parts. Filesystem Interface. Filesystem design. Interface the user sees. Implementing the interface

Two Parts. Filesystem Interface. Filesystem design. Interface the user sees. Implementing the interface File Management Two Parts Filesystem Interface Interface the user sees Organization of the files as seen by the user Operations defined on files Properties that can be read/modified Filesystem design Implementing

More information

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization Lesson Objectives To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization AE3B33OSD Lesson 1 / Page 2 What is an Operating System? A

More information

HY345 Operating Systems

HY345 Operating Systems HY345 Operating Systems Recitation 2 - Memory Management Solutions Panagiotis Papadopoulos panpap@csd.uoc.gr Problem 7 Consider the following C program: int X[N]; int step = M; //M is some predefined constant

More information

We r e going to play Final (exam) Jeopardy! "Answers:" "Questions:" - 1 -

We r e going to play Final (exam) Jeopardy! Answers: Questions: - 1 - . (0 pts) We re going to play Final (exam) Jeopardy! Associate the following answers with the appropriate question. (You are given the "answers": Pick the "question" that goes best with each "answer".)

More information

OS OBJECTIVE QUESTIONS

OS OBJECTIVE QUESTIONS OS OBJECTIVE QUESTIONS Which one of the following is Little s formula Where n is the average queue length, W is the time that a process waits 1)n=Lambda*W 2)n=Lambda/W 3)n=Lambda^W 4)n=Lambda*(W-n) Answer:1

More information

CS0206 OPERATING SYSTEMS Prerequisite CS0201, CS0203

CS0206 OPERATING SYSTEMS Prerequisite CS0201, CS0203 CS0206 OPERATING SYSTEMS Prerequisite CS0201, CS0203 L T P C 3 0 0 3 PURPOSE Every computer professional should have a basic understanding of how an operating system controls the computing resources and

More information

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing How is it possible for each process to have contiguous addresses and so many of them? Computer Systems Organization (Spring ) CSCI-UA, Section Instructor: Joanna Klukowska Teaching Assistants: Paige Connelly

More information

I/O Management. General Computer Architecture. Goals for I/O. Levels of I/O. Naming. I/O Management. COMP755 Advanced Operating Systems 1

I/O Management. General Computer Architecture. Goals for I/O. Levels of I/O. Naming. I/O Management. COMP755 Advanced Operating Systems 1 General Computer Architecture I/O Management COMP755 Advanced Operating Systems Goals for I/O Users should access all devices in a uniform manner. Devices should be named in a uniform manner. The OS, without

More information

Operating System Tutorial

Operating System Tutorial Operating System Tutorial OPERATING SYSTEM TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Operating System Tutorial An operating system (OS) is a collection

More information

Chapter 1 13 Essay Question Review

Chapter 1 13 Essay Question Review Chapter 1 13 Essay Question Review Chapter 1 1. Explain why an operating system can be viewed as a resource allocator. Ans: A computer system has many resources that may be required to solve a problem:

More information

Chapter 1 Computer System Overview

Chapter 1 Computer System Overview Operating Systems: Internals and Design Principles Chapter 1 Computer System Overview Eighth Edition By William Stallings Operating System Exploits the hardware resources of one or more processors Provides

More information

Chapter 2: OS Overview

Chapter 2: OS Overview Chapter 2: OS Overview CmSc 335 Operating Systems 1. Operating system objectives and functions Operating systems control and support the usage of computer systems. a. usage users of a computer system:

More information

Computer Organization and Architecture. Characteristics of Memory Systems. Chapter 4 Cache Memory. Location CPU Registers and control unit memory

Computer Organization and Architecture. Characteristics of Memory Systems. Chapter 4 Cache Memory. Location CPU Registers and control unit memory Computer Organization and Architecture Chapter 4 Cache Memory Characteristics of Memory Systems Note: Appendix 4A will not be covered in class, but the material is interesting reading and may be used in

More information

Outline: Operating Systems

Outline: Operating Systems Outline: Operating Systems What is an OS OS Functions Multitasking Virtual Memory File Systems Window systems PC Operating System Wars: Windows vs. Linux 1 Operating System provides a way to boot (start)

More information

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management. Overview Concepts of Mobile Operating Systems Lecture 11 Concepts of Mobile Operating Systems Mobile Business I (WS 2007/08) Prof Dr Kai Rannenberg Chair of Mobile Business and Multilateral Security Johann

More information

Devices and Device Controllers

Devices and Device Controllers I/O 1 Devices and Device Controllers network interface graphics adapter secondary storage (disks, tape) and storage controllers serial (e.g., mouse, keyboard) sound co-processors... I/O 2 Bus Architecture

More information

1 File Management. 1.1 Naming. COMP 242 Class Notes Section 6: File Management

1 File Management. 1.1 Naming. COMP 242 Class Notes Section 6: File Management COMP 242 Class Notes Section 6: File Management 1 File Management We shall now examine how an operating system provides file management. We shall define a file to be a collection of permanent data with

More information

Virtual Memory Behavior in Red Hat Linux Advanced Server 2.1

Virtual Memory Behavior in Red Hat Linux Advanced Server 2.1 Virtual Memory Behavior in Red Hat Linux Advanced Server 2.1 Bob Matthews Red Hat, Inc. Kernel Development Team Norm Murray Red Hat, Inc. Client Engineering Team This is an explanation of the virtual memory

More information

Chapter 5 Cloud Resource Virtualization

Chapter 5 Cloud Resource Virtualization Chapter 5 Cloud Resource Virtualization Contents Virtualization. Layering and virtualization. Virtual machine monitor. Virtual machine. Performance and security isolation. Architectural support for virtualization.

More information

Memory Allocation. Static Allocation. Dynamic Allocation. Memory Management. Dynamic Allocation. Dynamic Storage Allocation

Memory Allocation. Static Allocation. Dynamic Allocation. Memory Management. Dynamic Allocation. Dynamic Storage Allocation Dynamic Storage Allocation CS 44 Operating Systems Fall 5 Presented By Vibha Prasad Memory Allocation Static Allocation (fixed in size) Sometimes we create data structures that are fixed and don t need

More information

Chapter 10: Virtual Memory. Lesson 08: Demand Paging and Page Swapping

Chapter 10: Virtual Memory. Lesson 08: Demand Paging and Page Swapping Chapter 10: Virtual Memory Lesson 08: Demand Paging and Page Swapping Objective Learn demand paging, pages of data are only brought into the main memory when a program accesses them Learn swapping technique

More information

Distributed File Systems

Distributed File Systems Distributed File Systems Paul Krzyzanowski Rutgers University October 28, 2012 1 Introduction The classic network file systems we examined, NFS, CIFS, AFS, Coda, were designed as client-server applications.

More information

General Purpose Operating System Support for Multiple Page Sizes

General Purpose Operating System Support for Multiple Page Sizes The following paper was originally published in the Proceedings of the USENIX Annual Technical Conference (NO 98) New Orleans, Louisiana, June 1998 General Purpose Operating System Support for Multiple

More information

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture Chapter 2: Computer-System Structures Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture Operating System Concepts 2.1 Computer-System Architecture

More information

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer.

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer. Guest lecturer: David Hovemeyer November 15, 2004 The memory hierarchy Red = Level Access time Capacity Features Registers nanoseconds 100s of bytes fixed Cache nanoseconds 1-2 MB fixed RAM nanoseconds

More information

High-Performance Processing of Large Data Sets via Memory Mapping A Case Study in R and C++

High-Performance Processing of Large Data Sets via Memory Mapping A Case Study in R and C++ High-Performance Processing of Large Data Sets via Memory Mapping A Case Study in R and C++ Daniel Adler, Jens Oelschlägel, Oleg Nenadic, Walter Zucchini Georg-August University Göttingen, Germany - Research

More information

Operating Systems 4 th Class

Operating Systems 4 th Class Operating Systems 4 th Class Lecture 1 Operating Systems Operating systems are essential part of any computer system. Therefore, a course in operating systems is an essential part of any computer science

More information

Timing of a Disk I/O Transfer

Timing of a Disk I/O Transfer Disk Performance Parameters To read or write, the disk head must be positioned at the desired track and at the beginning of the desired sector Seek time Time it takes to position the head at the desired

More information

Presentation of Diagnosing performance overheads in the Xen virtual machine environment

Presentation of Diagnosing performance overheads in the Xen virtual machine environment Presentation of Diagnosing performance overheads in the Xen virtual machine environment September 26, 2005 Framework Using to fix the Network Anomaly Xen Network Performance Test Using Outline 1 Introduction

More information

Convenience: An OS makes a computer more convenient to use. Efficiency: An OS allows the computer system resources to be used in an efficient manner.

Convenience: An OS makes a computer more convenient to use. Efficiency: An OS allows the computer system resources to be used in an efficient manner. Introduction to Operating System PCSC-301 (For UG students) (Class notes and reference books are required to complete this study) Release Date: 27.12.2014 Operating System Objectives and Functions An OS

More information

Virtualization in Linux KVM + QEMU

Virtualization in Linux KVM + QEMU CS695 Topics in Virtualization and Cloud Computing KVM + QEMU Senthil, Puru, Prateek and Shashank 1 Topics covered KVM and QEMU Architecture VTx support CPU virtualization in KMV Memory virtualization

More information

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture Review from last time CS 537 Lecture 3 OS Structure What HW structures are used by the OS? What is a system call? Michael Swift Remzi Arpaci-Dussea, Michael Swift 1 Remzi Arpaci-Dussea, Michael Swift 2

More information

Virtual Machines. COMP 3361: Operating Systems I Winter 2015 http://www.cs.du.edu/3361

Virtual Machines. COMP 3361: Operating Systems I Winter 2015 http://www.cs.du.edu/3361 s COMP 3361: Operating Systems I Winter 2015 http://www.cs.du.edu/3361 1 Virtualization! Create illusion of multiple machines on the same physical hardware! Single computer hosts multiple virtual machines

More information

Chapter 6, The Operating System Machine Level

Chapter 6, The Operating System Machine Level Chapter 6, The Operating System Machine Level 6.1 Virtual Memory 6.2 Virtual I/O Instructions 6.3 Virtual Instructions For Parallel Processing 6.4 Example Operating Systems 6.5 Summary Virtual Memory General

More information

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Microkernels, virtualization, exokernels. Tutorial 1 CSC469 Microkernels, virtualization, exokernels Tutorial 1 CSC469 Monolithic kernel vs Microkernel Monolithic OS kernel Application VFS System call User mode What was the main idea? What were the problems? IPC,

More information

Data Storage - I: Memory Hierarchies & Disks

Data Storage - I: Memory Hierarchies & Disks Data Storage - I: Memory Hierarchies & Disks W7-C, Spring 2005 Updated by M. Naci Akkøk, 27.02.2004 and 23.02.2005, based upon slides by Pål Halvorsen, 11.3.2002. Contains slides from: Hector Garcia-Molina,

More information

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs Memory management Chater : Memory Management Part : Mechanisms for Managing Memory asic management Swaing Virtual Page relacement algorithms Modeling age relacement algorithms Design issues for aging systems

More information

INTRODUCTION ADVANTAGES OF RUNNING ORACLE 11G ON WINDOWS. Edward Whalen, Performance Tuning Corporation

INTRODUCTION ADVANTAGES OF RUNNING ORACLE 11G ON WINDOWS. Edward Whalen, Performance Tuning Corporation ADVANTAGES OF RUNNING ORACLE11G ON MICROSOFT WINDOWS SERVER X64 Edward Whalen, Performance Tuning Corporation INTRODUCTION Microsoft Windows has long been an ideal platform for the Oracle database server.

More information

COS 318: Operating Systems

COS 318: Operating Systems COS 318: Operating Systems File Performance and Reliability Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall10/cos318/ Topics File buffer cache

More information

Memory Management under Linux: Issues in Linux VM development

Memory Management under Linux: Issues in Linux VM development Memory Management under Linux: Issues in Linux VM development Christoph Lameter, Ph.D. Technical Lead, Linux Kernel Software Silicon Graphics Inc. clameter@sgi.com 2008-03-12 2008 SGI Sunnyvale, California

More information

COS 318: Operating Systems. Virtual Machine Monitors

COS 318: Operating Systems. Virtual Machine Monitors COS 318: Operating Systems Virtual Machine Monitors Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall10/cos318/ Introduction Have been around

More information

Computers: Tools for an Information Age

Computers: Tools for an Information Age Computers: Tools for an Information Age Chapter 3 Operating Systems: Software in the Background Objectives of Chapter 3 Describe the functions of an Operating System Explain the basics of a personal computer

More information

COSC 6374 Parallel Computation. Parallel I/O (I) I/O basics. Concept of a clusters

COSC 6374 Parallel Computation. Parallel I/O (I) I/O basics. Concept of a clusters COSC 6374 Parallel I/O (I) I/O basics Fall 2012 Concept of a clusters Processor 1 local disks Compute node message passing network administrative network Memory Processor 2 Network card 1 Network card

More information

Virtual Memory Paging

Virtual Memory Paging COS 318: Operating Systems Virtual Memory Paging Kai Li Computer Science Department Princeton University (http://www.cs.princeton.edu/courses/cos318/) Today s Topics Paging mechanism Page replacement algorithms

More information

CHAPTER 15: Operating Systems: An Overview

CHAPTER 15: Operating Systems: An Overview CHAPTER 15: Operating Systems: An Overview The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint

More information

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note: Chapter 7 OBJECTIVES Operating Systems Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the concept of virtual memory. Understand the

More information

KVM & Memory Management Updates

KVM & Memory Management Updates KVM & Memory Management Updates KVM Forum 2012 Rik van Riel Red Hat, Inc. KVM & Memory Management Updates EPT Accessed & Dirty Bits 1GB hugepages Balloon vs. Transparent Huge Pages Automatic NUMA Placement

More information

Computer Science 4302 Operating Systems. Student Learning Outcomes

Computer Science 4302 Operating Systems. Student Learning Outcomes Computer Science 4302 Operating Systems Student Learning Outcomes 1. The student will learn what operating systems are, what they do, and how they are designed and constructed. The student will be introduced

More information

Chapter 11: File System Implementation. Operating System Concepts 8 th Edition

Chapter 11: File System Implementation. Operating System Concepts 8 th Edition Chapter 11: File System Implementation Operating System Concepts 8 th Edition Silberschatz, Galvin and Gagne 2009 Chapter 11: File System Implementation File-System Structure File-System Implementation

More information

Peter J. Denning, Naval Postgraduate School, Monterey, California

Peter J. Denning, Naval Postgraduate School, Monterey, California VIRTUAL MEMORY Peter J. Denning, Naval Postgraduate School, Monterey, California January 2008 Rev 6/5/08 Abstract: Virtual memory is the simulation of a storage space so large that users do not need to

More information

1. Computer System Structure and Components

1. Computer System Structure and Components 1 Computer System Structure and Components Computer System Layers Various Computer Programs OS System Calls (eg, fork, execv, write, etc) KERNEL/Behavior or CPU Device Drivers Device Controllers Devices

More information

Storage in Database Systems. CMPSCI 445 Fall 2010

Storage in Database Systems. CMPSCI 445 Fall 2010 Storage in Database Systems CMPSCI 445 Fall 2010 1 Storage Topics Architecture and Overview Disks Buffer management Files of records 2 DBMS Architecture Query Parser Query Rewriter Query Optimizer Query

More information

Virtualization. Explain how today s virtualization movement is actually a reinvention

Virtualization. Explain how today s virtualization movement is actually a reinvention Virtualization Learning Objectives Explain how today s virtualization movement is actually a reinvention of the past. Explain how virtualization works. Discuss the technical challenges to virtualization.

More information

How To Write To A Linux Memory Map On A Microsoft Zseries 2.2.2 (Amd64) On A Linux 2.3.2 2.4.2 3.5.2 4.5 (Amd32) (

How To Write To A Linux Memory Map On A Microsoft Zseries 2.2.2 (Amd64) On A Linux 2.3.2 2.4.2 3.5.2 4.5 (Amd32) ( Understanding Linux Memory Management SHARE 102 Session 9241 Dr. Ulrich Weigand Linux on zseries Development, IBM Lab Böblingen Ulrich.Weigand@de.ibm.com Linux Memory Management - A Mystery? What does

More information

Record Storage and Primary File Organization

Record Storage and Primary File Organization Record Storage and Primary File Organization 1 C H A P T E R 4 Contents Introduction Secondary Storage Devices Buffering of Blocks Placing File Records on Disk Operations on Files Files of Unordered Records

More information

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines: Virtual Machines Uses for Virtual Machines Virtual machine technology, often just called virtualization, makes one computer behave as several computers by sharing the resources of a single computer between

More information

Operating Systems: Basic Concepts and History

Operating Systems: Basic Concepts and History Introduction to Operating Systems Operating Systems: Basic Concepts and History An operating system is the interface between the user and the architecture. User Applications Operating System Hardware Virtual

More information

This tutorial will take you through step by step approach while learning Operating System concepts.

This tutorial will take you through step by step approach while learning Operating System concepts. About the Tutorial An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is a vital component

More information

This Unit: Virtual Memory. CIS 501 Computer Architecture. Readings. A Computer System: Hardware

This Unit: Virtual Memory. CIS 501 Computer Architecture. Readings. A Computer System: Hardware This Unit: Virtual CIS 501 Computer Architecture Unit 5: Virtual App App App System software Mem CPU I/O The operating system (OS) A super-application Hardware support for an OS Virtual memory Page tables

More information

Segmentation. 16.1 Segmentation: Generalized Base/Bounds

Segmentation. 16.1 Segmentation: Generalized Base/Bounds 16 Segmentation So far we have been putting the entire address space of each process in memory. With the base and bounds registers, the OS can easily relocate processes to different parts of physical memory.

More information

Intel P6 Systemprogrammering 2007 Föreläsning 5 P6/Linux Memory System

Intel P6 Systemprogrammering 2007 Föreläsning 5 P6/Linux Memory System Intel P6 Systemprogrammering 07 Föreläsning 5 P6/Linux ory System Topics P6 address translation Linux memory management Linux page fault handling memory mapping Internal Designation for Successor to Pentium

More information

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Chapter 2 Basic Structure of Computers Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Functional Units Basic Operational Concepts Bus Structures Software

More information