CS-3013 & CS-502, Summer 2006 Disks1 CS-3013 & CS502 Operating Systems.

Slides:



Advertisements
Similar presentations
Overview of Mass Storage Structure
Advertisements

Silberschatz, Galvin and Gagne Operating System Concepts Disk Scheduling Disk IO requests are for blocks, by number Block requests come in an.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Disk Scheduling Based on the slides supporting the text 1.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
OPERATING SYSTEMS CS3530 Summer 2014 OPERATING SYSTEMS CS3530 Summer 2014 Input/Output System Chapter 9.
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
Based on the slides supporting the text
DisksCS-4513, D-Term Disks CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz,
Disks, RAIDs, and Stable Storage CS-3013 A-term Disks, RAIDs, and Stable Storage CS-3013, Operating Systems A-term 2009 (Slides include materials.
Disks.
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
DisksCS-502 Fall Disks CS-502 Operating Systems Fall 2006 (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz, Galvin,
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
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
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Operating Systems CMPSC 473 I/O Management (4) December 09, Lecture 25 Instructor: Bhuvan Urgaonkar.
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.
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.
1Fall 2008, Chapter 12 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
DisksCS-502 Fall Disks CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz, Galvin,
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.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
Disks, RAIDs, and Stable Storage CS-502 (EMC) Fall Disks, RAIDs, and Stable Storage CS-502, Operating Systems Fall 2009 (EMC) (Slides include materials.
Chapter 14: Mass-Storage
Chapter 14: Mass-Storage Systems Disk Structure. Disk Scheduling. RAID.
Device Management Mark Stanovich Operating Systems COP 4610.
CS399 New Beginnings Jonathan Walpole. Disk Technology & Secondary Storage Management.
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.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
Disks 1 CS502 Spring 2006 Disks CS502 – Operating Systems Spring 2006.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 11: File System Implementation.
Chapter 10: Mass-Storage Systems
Operating System (013022) Dr. H. Iwidat
Sarah Diesburg Operating Systems CS 3430
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)
Disks and scheduling algorithms
Mass-Storage Systems.
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
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:

CS-3013 & CS-502, Summer 2006 Disks1 CS-3013 & CS502 Operating Systems

CS-3013 & CS-502, Summer 2006 Disks2 Outline – Tonight and next week General discussion of disks Architecture, mechanism, cost, performance Device characteristics General discussion of file systems Structure, access, behavior Role in system and applications Other disk topics CD-ROM, DVD, floppy, removable disks RAID’s Advanced file system topics Stable storage, Log-structured files, etc.

CS-3013 & CS-502, Summer 2006 Disks3 Context Early days: disks thought of as I/O devices Controlled like I/O devices Block transfer, DMA, interrupts, etc. Data in and out of memory (where action is) Today: disks as integral part of computing system Long term storage of information within system Implementer of fundamental abstraction (files) The real center of action

CS-3013 & CS-502, Summer 2006 Disks4 Disk Drives External Connection IDE/ATA SCSI USB Cache – independent of OS Controller Details of read/write Cache management Failure management

CS-3013 & CS-502, Summer 2006 Disks5 Price per Megabyte of Magnetic Hard Disk, From 1981 to 2000

CS-3013 & CS-502, Summer 2006 Disks6 Prices per GB (March 9, 2006) 52¢ per gigabyte – 250 GB Porsche (portable) 7200 rpm, 11 ms. avg. seek time, 2 MB drive cache USB 2.0 port (effective 40 MBytes/sec) $1.25 per GB – 40 GB Barracuda 7200 rpm, 8.5 ms. ms. avg. seek time, 2 MB drive cache EIDE (theoretical MBytes/sec) $4.52 per GB – 72 GB Hot-swap 10,000 rpm, 4.9 ms. avg. seek time SCSI (320 MB/sec) $6.10 per GB – 72 GB Ultra 15,000 rpm, 3.8 ms. avg. seek time SCSI (320 MB/sec)

CS-3013 & CS-502, Summer 2006 Disks7 Hard Disk Geometry Platters Two-sided magnetic material 1-16 per drive, 3,000 – 15,000 RPM Tracks Concentric rings bits laid out serially Divided into sectors (addressable) Cylinders Same track on each platter Arms move together Operation Seek: move arm to track Read/Write: –wait till sector arrives under head –Transfer data

CS-3013 & CS-502, Summer 2006 Disks8 More on Hard Disk Drives Manufactured in clean room Permanent, air-tight enclosure “Winchester” technology Spindle motor integral with shaft “Flying heads” Aerodynamically “float” over moving surface Velocities > 100 meters/sec Parking position for heads during power-off Excess capacity Sector re-mapping for bad blocks Managed by OS or by drive controller 20,000+ hours mean time between failures

CS-3013 & CS-502, Summer 2006 Disks9 More on Hard Disk Drives (continued) Early days Read/write platters in parallel for higher bandwidth Today Extremely narrow tracks, closely spaced –tolerances < 5-20 microns Thermal variations prevent precise alignment from one cylinder to the next Seek operation Move arm to approximate position Use feedback control for precise alignment Seek time  k * distance

CS-3013 & CS-502, Summer 2006 Disks10 Raw Disk Layout Track format – n sectors –200 < n < 2000 in modern disks –Some disks have fewer sectors on inner tracks Inter-sector gap –Enables each sector to be read or written independently Sector format –Sector address: Cylinder, Track, Sector –Optional header –Data –Each field separated by small gap and with its own CRC Sector length –Almost all operating systems specify uniform sector length –512 – 4096 bytes

CS-3013 & CS-502, Summer 2006 Disks11 Formatting the Disk Writes all sector addresses Writes and reads back various patterns on all sectors Tests all sectors Identifies bad blocks Bad block Any sector that does not reliably return the data that was written to it!

CS-3013 & CS-502, Summer 2006 Disks12 Bad Block Management Bad blocks are inevitable Part of manufacturing process (less than 1%) –Detected during formatting Occasionally, blocks become bad during operation Manufacturers add extra tracks to all disks Physical capacity = (1 + x) * rated_capacity Who handles them? Disk controller: Bad block list maintained internally –Automatically substitutes good blocks Formatter: Re-organize track to avoid bad blocks OS: Bad block list maintained by OS, bad blocks never used

CS-3013 & CS-502, Summer 2006 Disks13 Bad Sector Handling – within track a)A disk track with a bad sector b)Substituting a spare for the bad sector c)Shifting all the sectors to bypass the bad one

CS-3013 & CS-502, Summer 2006 Disks14 Logical vs. Physical Sector Addresses Some disk controllers convert [cylinder, track, sector] addresses into logical sector numbers –Linear array –No gaps in addressing –Bad blocks concealed by controller Reason: –Backward compatibility with older PC’s –Limited number of bits in C, T, and S fields

CS-3013 & CS-502, Summer 2006 Disks15 Disk Drive – Performance Seek time –Position heads over a cylinder – 1 to 25 ms Rotational latency –Wait for sector to rotate under head –Full rotation - 4 to 12 ms (15000 to 5400 RPM) –Latency averages ½ of rotation time Transfer Rate –approx MB/sec (aka bandwidth) Transfer of 1 Kbyte –Seek (4 ms) + rotational latency (2ms) + transfer = 6.04 ms –Effective BW here is about 170 KB/sec (misleading!)

CS-3013 & CS-502, Summer 2006 Disks16 Disk Reading Strategies Read and cache a whole track Automatic in some controllers Subsequent reads to same track have zero rotational latency – good for locality of reference! Disk arm available to seek to another cylinder Start from current head position Start filling cache with first sector under head Signal completion when desired sector is read Start with requested sector When no cache, or limited cache sizes

CS-3013 & CS-502, Summer 2006 Disks17 Disk Writing Strategies There are none The best one can do is –collect together a sequence of contiguous (or nearby) sectors for writing –Write them in a single sequence of disk actions Caching for later writing is (usually) a bad idea –Application has no confidence that data is actually written before a failure –Some network disk systems provide this feature, with battery backup power for protection

CS-3013 & CS-502, Summer 2006 Disks18 Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and large disk bandwidth. Access time has two major components –Seek time is the time for the disk 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. Minimize seek time Seek time ~ seek distance

CS-3013 & CS-502, Summer 2006 Disks19 Disk Arm Scheduling Seek time dominates the performance of disk drive transfers Can the disk arm be moved to improve the effective disk performance? Assume a request queue (0-199) 98, 183, 37, 122, 14, 124, 65, 67 with current head pointer at 53

CS-3013 & CS-502, Summer 2006 Disks20 Textbook solutions FCFS – First-come, first-served SSTF – Shortest seek time first SCAN (aka Elevator) – scan one direction, then the other C-SCAN – scan in one direction only … Tanenbaum, §5,4.3

CS-3013 & CS-502, Summer 2006 Disks21 FCFS First Come First Served Example total head movement cylinders. Pros –In order of applications –Fair to all requests Cons –Long seeks

CS-3013 & CS-502, Summer 2006 Disks22 SSTF Shortest Seek Time First - Selects the request with the minimum seek time from the current head position. Pro –minimize seek times Cons –Lingers in areas of high activity –Starvation, particularly at edges of disk Example –total head movement of 236 cylinders.

CS-3013 & CS-502, Summer 2006 Disks23 SSTF

CS-3013 & CS-502, Summer 2006 Disks24 SCAN or Elevator The disk arm starts at one end of the disk, moves toward the other end, servicing requests until reaching end of disk, then the head reverses and servicing continues. –i.e. Pick the closest request in same direction as last arm motion Con – more arm motion than SSTF Pro –Fair –Avoids starvation Example total head movement of 208 cylinders.

CS-3013 & CS-502, Summer 2006 Disks25 SSTF (Cont.)

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

CS-3013 & CS-502, Summer 2006 Disks27 C-SCAN (Cont.)

CS-3013 & CS-502, Summer 2006 Disks28 Selecting a Disk-Scheduling Algorithm SSTF is common and has a natural appeal. SCAN and C-SCAN perform better for systems that place heavy load on the disk. Performance depends on the number and types of requests. Requests for disk service are influenced by the file-allocation method.

CS-3013 & CS-502, Summer 2006 Disks29 However … In real systems, average disk queue length is often 1-2 requests All strategies are approximately equal! If your system has typical queues like 98, 183, 37, 122, 14, 124, 65, 67, … something is seriously wrong! Disk arm scheduling used only in a few very specialized situations Multi-media; some transaction-based systems

CS-3013 & CS-502, Summer 2006 Disks30 Performance metrics Transaction & database systems Number of transactions per second Focus on seek and rotational latency, not bandwidth Track caching may be irrelevant (except read-modify-write) Many little files (e.g., Unix) Same Big files Focus on bandwidth and contiguous allocation Seek time is secondary concern Paging support for VM A combination of both Track caching is highly relevant – locality of reference

CS-3013 & CS-502, Summer 2006 Disks31 Summary I/O drivers Character & Graphical User Interface Devices Network I/O Disks Programming Project #3 Reading Assignment: Tanenbaum §§5.1–5.7 Except §5.4.3 (Disk arm scheduling)