I/O and Disk Scheduling CS 470 - Spring 2002. Overview Review of I/O Techniques I/O Buffering Disk Geometry Disk Scheduling Algorithms RAID.

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

I/O Management and Disk Scheduling Chapter 11. I/O Driver OS module which controls an I/O device hides the device specifics from the above layers in the.
I/O Management and Disk Scheduling
Faculty of Information Technology Department of Computer Science Computer Organization Chapter 7 External Memory Mohammad Sharaf.
I/O Management and Disk Scheduling
CS 6560: Operating Systems Design
Disk Scheduling Based on the slides supporting the text 1.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
Input/Output Management and Disk Scheduling
CPSC-608 Database Systems Fall 2008 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #6.
Other Disk Details. 2 Disk Formatting After manufacturing disk has no information –Is stack of platters coated with magnetizable metal oxide Before use,
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
Based on the slides supporting the text
Chapter 12 – Disk Performance Optimization Outline 12.1 Introduction 12.2Evolution of Secondary Storage 12.3Characteristics of Moving-Head Disk Storage.
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
Avishai Wool lecture Introduction to Systems Programming Lecture 9 Input-Output Devices.
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
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Storage Systems.
1 Recitation 8 Disk & File System. 2 Disk Scheduling Disks are at least four orders of magnitude slower than main memory –The performance of disk I/O.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
Topic: Disks – file system devices. Rotational Media Sector Track Cylinder Head Platter Arm Access time = seek time + rotational delay + transfer time.
Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo1 Disk & disk scheduling.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
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.
Disks and Storage Systems
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.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
Disks Chapter 5 Thursday, April 5, Today’s Schedule Input/Output – Disks (Chapter 5.4)  Magnetic vs. Optical Disks  RAID levels and functions.
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.
I/O Management and Disk Scheduling Chapter 11. Disk Performance Parameters To read or write, the disk head must be positioned at the desired track and.
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.
I/O Devices. Characteristics of I/O Devices  Block Devices  Information are stored and accessed in fixed-size blocks  Addressable, can have sequential.
Chapter 14: Mass-Storage Systems Disk Structure. Disk Scheduling. RAID.
Device Management Mark Stanovich Operating Systems COP 4610.
Disk Average Seek Time. Multi-platter Disk platter Disk read/write arm read/write head.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Chapter 101 I/O Management and Disk Scheduling Chapter 11.
Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
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.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems DISK I/0.
I/O Management and Disk Scheduling
Sarah Diesburg Operating Systems CS 3430
Multiple Platters.
External Memory.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
I/O Resource Management: Software
Operating System I/O System Monday, August 11, 2008.
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Overview Continuation from Monday (File system implementation)
Persistence: hard disk drive
Disks and 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.
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

I/O and Disk Scheduling CS Spring 2002

Overview Review of I/O Techniques I/O Buffering Disk Geometry Disk Scheduling Algorithms RAID

Review Input / Output techniques –Programmed I/O –Interrupt Driven I/O –Direct Memory access I/O Layering –Application –Device Independent I/O –Driver –Interrupt Service Routine

I/O Buffering Advantages –Overlap I/O and computation –Separates I/O from computation e.g. I/O can occur even if buffer is swapped Time measurement parameters –T = I/O transfer time –C = computation time –M = block move time Effect of buffering on program performance

No Buffers: T + C Disk User Copy CPU T Disk User Copy CPU C

One Buffer: max(T, C) + M System Buffer Disk User Copy CPU System Buffer Disk User Copy CPU T C M

Two Buffers: max(T, C + M) System Buffer 1 Disk User Copy CPU T C System Buffer 2 User Copy CPU M System Buffer 2

I/O Buffering Summary Buffering Alternatives –No buffering: T + C –Single buffer: max(T, C) + M –Double buffer: max(T, C + M) –Circular buffers: smooths out I/O demand Disk cache - analogy to memory management –Fetch Policy - read ahead –Replacement choice: LRU, LFU, FIFO –When to do these: On demand or preplanned.

Classic Disk Geometry Disk medium is a number of platters fixed to a axle spinning at high speed. There is one read/write head for each surface of each platter. Heads are attached to an arm which varies by discrete amounts the distance to the axle of all heads simultaneously. For each position of the arm, a head describes a circular track as the disk spins. Track is divided into segments called sectors which hold the data.

Disk Layout Sector Track Intersector Gap Intertrack Gap

Disk Performance Seek time: time to move arm to right cylinder. Roughly linear in nbr. of tracks crossed: #tracks  Trk2Trk + Startup. Average is seek over half the tracks. Rotational delay: time to spin around to right sector on track Access time: seek time + rotational delay Transfer speed: how fast data spins past the head Rotational speed and average seek time determine these parameters

Retail $100 IDE Disk Drive Geometry –8 platters (16 surfaces, 16 heads, 1 arm) –7763 cylinders (7763 tracks per surface) –63 sectors of 512 bytes each per track –Total: 16  7763  63  512 bytes = 3913 MB Performance –Avg seek: 11 ms, Rotational speed: 5400 rpm –Avg rot. delay: 0.5/5400 min = 5.5 ms –Avg access time: = 16.5 ms –trans speed: 63  5400  512 b/m = 2.8 MB/sec

Disk Scheduling Algorithms FIFO - simple and fair Priority LIFO - serve current process well Shortest service time first (SSTF) SCAN - Back and forth over disk C-SCAN - unidirectional scan N-step SCAN - N jobs per queue FSCAN - 2 queues

FIFO, Priority, and LIFO Disk Enter Disk Enter Disk Enter

Shortest Service Time Next 23 Disk Jobs Entered In Sorted Order Current Location Select Closest Job Starvation when arm is stuck in one area for extended period Numbers are Disk locations of data

Scan (Bidirectional) 23 Disk Jobs Entered In Sorted Order Current Location Scan Left to Right, Then Right to Left Uneven response time at ends of disk

C-Scan (Unidirectional) 23 Disk Jobs Entered In Sorted Order Current Location Scan Left to Right, Then Return to left Can Still Exhibit Starvation

N-step-Scan 23 Disk Jobs entered in sorted groups of N jobs Groups Serviced In FIFO Order Case where N = 1 is FIFO

F-Scan 23 Disk Jobs Queued in Sorted Order Roles of two groups swapped when current group of jobs serviced. Queue Group Dequeue Group

Basic Disks Master boot record (MBR) –Located on first sector of primary drive –Boot code –Partition Table (Up to 4 Entries) Location and size of partition File system type (e.g. FAT32, NTFS) Extended Partition is a file system type –Recursively contains MBR and Partitions itself Partitions –File System begins with boot sector

Dynamic Disks (1 of 2) Logical Disk Manager (LDM) Database –Single database for all drives – includes multipartition volume descriptions –Replicated with one copy on each dynamic drive –1 MB in size, located at end of drive Master Boot Record (MBR) –Describes System and Boot partitions –If none, single partition from MBR to LDM –Boot and legacy software can’t read LDM

Dynamic Disks (2 of 2) LDM Structure –Private Header GUID for dynamic drive and disk group name Replicated at end of LDM –Table of Contents –128 byte database records Entries all have name and id Partitions: size, offset, disk id, parent component Components: parent volume (2 for mirrors) Volume: size, state, GUID, drive hint Disk: GUID –Transactional Log

RAID Redundant Array of Independent Disks Six flavors –Level 0: Disk striping –Level 1: Disk mirroring –Level 2: Small strips, ECC e.g. Hamming –Level 3: Small strips with parity –Level 4: Large strips, fixed parity drive –Level 5: Large strips, round robin parity Disk Spanning (not RAID)

Striping and Mirroring Mirroring Provides Data Redundancy at cost of doubling number of drives Has Fast Read Access Stripes are fast; but not redundant

Raid Levels 2 and C C C C C C C C Disk arms are in lock step; each access involves all disk drives. Fast access for large individual jobs - high overhead for many small I/O’s. Level 2 avoided because of added cost. Small Byte-sized StripsRedundancy

Raid Levels 4 and P P P P Large Strips with Parity Strip P 17 P P 0 P Single drive for parity stays very busy Round robin parity

RAID Level 4 and 5 Redundancy Principle – Bit values for parity drive are sum mod 2 of the corresponding bits on other drives When a block is changed, the new parity can be computed in terms of the old value of the parity: –new parity = sum of old & new value and old parity bit modulo 2 –So one write requires: 2 reads and 2 writes Reading requires just one read

RAID 5 Sector Calculation Assume: – RAID 5 with k drives and sector sized strips – Sector/Drive numbers zero based Effective capacity is k-1 times the size of a single drive RAID logical sector N location: –R = N % (k * (k - 1)) –Drive = R%(k-1) + ((R%(k-1)>=R/(k-1)) ? 1 : 0) –Sector = N / (k - 1) –Parity Drive = R / (k – 1)