I/O Management and Disk Structure Introduction to Operating Systems: Module 14.

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

I/O Management and Disk Scheduling
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Silberschatz, Galvin and Gagne Operating System Concepts Disk Scheduling Disk IO requests are for blocks, by number Block requests come in an.
I/O Management and Disk Scheduling
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
I/O Management and Disk Scheduling
CS 6560: Operating Systems Design
Disk Scheduling Based on the slides supporting the text 1.
Input/Output Management and Disk Scheduling
Operating Systems 1 K. Salah Module 5.0: I/O and Disks I/O hardware Polling and Interrupt-driven I/O DMA Bock and character devices Blocking and nonblocking.
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Mass-Storage Structure
Based on the slides supporting the text
Disks.
Device Management.
1 Disk Scheduling Chapter 14 Based on the slides supporting the text.
Disks CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Secondary Storage CSCI 444/544 Operating Systems Fall 2008.
12.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 12: Mass-Storage Systems.
Disk and I/O Management
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
Mass storage Structure Unit 5 (Chapter 14). Disk Structures Magnetic disks are faster than tapes. Disk drives are addressed as large one- dimensional.
1 Lecture 8: Secondary-Storage Structure 2 Disk Architecture Cylinder Track SectorDisk head rpm.
Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13+14: I/O Systems and Mass- Storage Structure I/O Hardware Application I/O.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 12: Mass-Storage Systems Overview of Mass.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable Used to communicate with the user Printers Video display terminals.
1 IO Management and Disk Scheduling Chapter Categories of I/O Devices n Human readable u used to communicate with the user u video display terminals.
1 I/O Management and Disk Scheduling Chapter
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable  Used to communicate with the user  Printers  Video display.
Page 110/12/2015 CSE 30341: Operating Systems Principles Network-Attached Storage  Network-attached storage (NAS) is storage made available over a network.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 12: Mass-Storage.
CS 6502 Operating Systems Dr. J.. Garrido Device Management (Lecture 7b) CS5002 Operating Systems Dr. Jose M. Garrido.
CE Operating Systems Lecture 20 Disk I/O. Overview of lecture In this lecture we will look at: Disk Structure Disk Scheduling Disk Management Swap-Space.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display.
O VERVIEW OF M ASS S TORAGE S TRUCTURE Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at 60 to 250 times per second.
I/O Management and Disk Scheduling Chapter 11. Categories of I/O Devices Human readable Used to communicate with the user  Printers, Display terminals,
1 I/O Management and Disk Scheduling Chapter I/O Devices Can be group into three categories: 1.Human readable Used to communicate with the computer.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1.  Disk Structure Disk Structure  Disk Scheduling Disk Scheduling  FCFS FCFS  SSTF SSTF  SCAN SCAN  C-SCAN C-SCAN  C-LOOK C-LOOK  Selecting a.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
Chapter 14: Mass-Storage
Chapter 14: Mass-Storage Systems Disk Structure. Disk Scheduling. RAID.
Chapter 9 I/O System. 2 Input/Output System I/O Major objectives are: Take an application I/O request and send it to the physical device. Then, take whatever.
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
1 Chapter 13 Mass-Storage Structure. 2 Disk Structure Disk drives are addressed as large 1- dimensional arrays of logical blocks, where the logical block.
M ASS S TORAGE S TRUCTURES Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Chapter 101 I/O Management and Disk Scheduling Chapter 11.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 11: File System Implementation.
Operating System (013022) Dr. H. Iwidat
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Chapter 12: Mass-Storage Structure
Operating System I/O System Monday, August 11, 2008.
Disk Scheduling Algorithms
Mass-Storage Structure
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Chapter 14 Based on the slides supporting the text
Chapter 12: Mass-Storage Systems
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Overview Continuation from Monday (File system implementation)
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

I/O Management and Disk Structure Introduction to Operating Systems: Module 14

Operating System Design Objectives u I/O is extremely slow compared to main memory, CPU u Use of multiprogramming allows for some processes to be waiting on I/O while another process executes u Efficiency and generality are important u Try to handle all I/O devices in a uniform manner u Hide most of the details of device I/O in lower-level routines so that processes and upper levels see devices in general terms such as Read, Write, Open, and Close

A Model of I/O Organization Scheduling & Control Device I/O Scheduling & Control Scheduling & Control Local peripheral deviceCommunications portFile System Device I/O Device I/O Hardware User Processes User Processes User Processes User Processes User Processes User Processes Logical I/O Comm. Architecture Directory Management File System Physical Organization

I/O Buffering u Reasons for buffering  Process responsiveness  a writing processes must wait for I/O to complete before proceeding  A reading process cannot do other things while waiting for data  Pages must remain in main memory during I/O

I/O Buffering u Block-oriented  information is stored in fixed sized blocks  transfers are made a block at a time  used for disks and tapes u Stream-oriented  transfer information as a stream of bytes  used for terminals, printers, communication ports, mouse, and most other devices that are not secondary storage

No Buffering Operating SystemUser Process No buffering I/O Device In

Single Buffer u Operating system assigns a buffer in main memory for an I/O request u Block-oriented  input transfers made to buffer  block moved to user space when needed  another block is moved into the buffer  read ahead Operating SystemUser Process Single buffering I/O Device InMove

Single Buffer u Block-oriented  user process can process one block of data while next block is read in  swapping can occur since input is taking place in system memory, not user memory  operating system keeps track of assignment of system buffers to user processes  output is accomplished by the user process writing a block to the buffer and later actually written out

Single Buffer u Stream-oriented  used a line (or word, or char) at a time  user input from a terminal is one line at a time with carriage return signaling the end of the line  output to the terminal is one line at a time

Double Buffer u Use two system buffers instead of one u A process can transfer data to or from one buffer while the operating system empties or fills the other buffer I/O Device In Move Operating SystemUser Process Double buffering

Circular Buffer u More than two buffers are used u Each individual buffer is one unit in a circular buffer u Used when I/O operation must keep up with process I/O Device InMove Operating SystemUser Process Circular buffering..

Disk Structure u Disk drives are addressed as large 1-dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer u The 1-dimensional array of logical blocks is mapped into the 3-dimensional disk, where the 3 dimensions are cylinder, sector, surface  Sector 0 is the first sector of the first track on the outermost cylinder (top surface)  Mapping proceeds in order through that track, then the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost

Disk Structure u All of the sectors that can be accessed without moving the read/write heads belong to the same cylinder u This disk has 12 surfaces u A sector is, like a pie slice, a small angular displacement

Disk Data Layout Inter-sector gap SectorsTracks Inter-track gap

Disk Layout: Constant Angular Velocity Track 2, Sector 7 Track 0, Sector 0

Disk Management u Low-level formatting, or physical formatting — Dividing a disk into sectors that the disk controller can read and write u To use a disk to hold files, the operating system still needs to record its own data structures on the disk  Partition the disk into one or more groups of cylinders  Logical formatting or “making a file system” u Boot block initializes system.  The bootstrap is stored in ROM  Bootstrap loader program u Methods such as sector sparing used to handle bad blocks

Disk Reliability u Several improvements in disk-use techniques involve the use of multiple disks working cooperatively u Disk striping uses a group of disks as one storage unit u RAID schemes improve performance and improve the reliability of the storage system by storing redundant data  Mirroring or shadowing keeps duplicate of each disk  Block interleaved parity uses much less redundancy

RAID 0 (non-redundant) strip 0 strip 4 strip 8 strip 12 strip 1 strip 5 strip 9 strip 13 strip 2 strip 6 strip 10 strip 14 strip 3 strip 7 strip 11 strip 15

RAID 1 (mirrored) strip 0 strip 4 strip 8 strip 12 strip 1 strip 5 strip 9 strip 13 strip 2 strip 6 strip 10 strip 14 strip 3 strip 7 strip 11 strip 15 strip 0 strip 4 strip 8 strip 12 strip 1 strip 5 strip 9 strip 13 strip 2 strip 6 strip 10 strip 14 strip 3 strip 7 strip 11 strip 15

RAID 2 (redundancy through Hamming code) f 0 (b) b2b2 b1b1 b0b0 b2b2 f 1 (b) f 2 (b)

RAID 3 (bit-interleaved parity) P(b) b2b2 b1b1 b0b0 b2b2

RAID 4 (block-level parity) block 0 block 4 block 8 block 12 block 1 block 5 block 9 block 13 block 2 block 6 block 10 block 14 block 3 block 7 block 11 block 15 P(0-3) P(4-7) P(8-11) P(12-15)

RAID 5 (block-level distributed parity) block 0 block 4 block 8 block 12 P(16-19) block 1 block 5 block 9 P(12-15) block 16 block 2 block 6 P(8-11) block 13 block 17 block 3 P(4-7) block 10 block 14 block 18 P(0-3) block 7 block 11 block 15 block 19

Data Mapping for RAID Level 0 Array strip 0 strip 4 strip 8 strip 12 strip 1 strip 5 strip 9 strip 13 strip 2 strip 6 strip 10 strip 14 strip 3 strip 7 strip 11 strip 15 Physical Disk 0 Physical Disk 1 Physical Disk 2 Physical Disk 3 strip 0 strip 1 strip 2 strip 3 strip 4 strip 15 strip 14 strip 13 strip 12 strip11 strip 10 strip 9 strip 8 strip 7 strip 6 strip 5 Array Management Software

Disk Cache u Buffer in main memory for disk sectors u Contains a copy of some of the sectors on the disk

Least Recently Used u The block that has been in the cache the longest with no reference to it is replaced u The cache consists of a stack of blocks u Most recently referenced block is on the top of the stack u When a block is referenced or brought into the cache, it is placed on the top of the stack

Least Recently Used u The block on the bottom of the stack is removed when a new block is brought in u Blocks don’t actually move around in main memory u A stack of pointers is used

Least Frequently Used u The block that has experienced the fewest references is replaced u A counter is associated with each block u Counter is incremented each time block accessed u Some blocks may be referenced many times in a short period of time and then not needed any more

Disk Scheduling u The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and high disk bandwidth. u Access time has two major components  Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector.  Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head. u Minimize seek time u Seek time  seek distance u Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer

Disk Scheduling u Several algorithms exist to schedule the servicing of disk I/O requests. u We illustrate them with a request queue (0-199). 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53

FCFS Illustration shows total head movement of 640 cylinders

SSTF u Selects the request with the minimum seek time from the current head position u SSTF scheduling may cause starvation of some requests u Illustration shows total head movement of 236 cylinders

SSTF

SCAN u The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues u Sometimes called an elevator algorithm u Illustration shows total head movement of 236 cylinders

SCAN

C-SCAN u Provides a more uniform wait time than SCAN u The head moves from one end of the disk to the other, servicing requests as it goes  When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip u Treats the cylinders as a circular list that wraps around from the last cylinder to the first one

C-SCAN

C-LOOK u Version of C-SCAN u Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk

C-LOOK