Introduction to I/O and Disk Management

Similar documents
Introduction to I/O and Disk Management

CS420: Operating Systems. Mass Storage Structure

COS 318: Operating Systems. Storage Devices. Kai Li Computer Science Department Princeton University

COS 318: Operating Systems. Storage Devices. Vivek Pai Computer Science Department Princeton University

COS 318: Operating Systems. Storage Devices. Jaswinder Pal Singh Computer Science Department Princeton University

Secondary storage. CS 537 Lecture 11 Secondary Storage. Disk trends. Another trip down memory lane

Chapter 10: Mass-Storage Systems

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006

CS3600 SYSTEMS AND NETWORKS

Mass-Storage Structure

Chapter 10: Mass-Storage Systems

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

Today: Secondary Storage! Typical Disk Parameters!

Disks. Storage Technology. Vera Goebel Thomas Plagemann. Department of Informatics University of Oslo

V. Mass Storage Systems

Storage. CS 3410 Computer System Organization & Programming

BBM371- Data Management. Lecture 2: Storage Devices

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

u Covered: l Management of CPU & concurrency l Management of main memory & virtual memory u Currently --- Management of I/O devices

Mass-Storage. ICS332 - Fall 2017 Operating Systems. Henri Casanova

CSE 153 Design of Operating Systems

Lecture 29. Friday, March 23 CS 470 Operating Systems - Lecture 29 1

CSE 120. Operating Systems. March 27, 2014 Lecture 17. Mass Storage. Instructor: Neil Rhodes. Wednesday, March 26, 14

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Chapter 12: Mass-Storage

I/O CANNOT BE IGNORED

CSE 451: Operating Systems Spring Module 12 Secondary Storage

CSE 153 Design of Operating Systems Fall 2018

CSE 451: Operating Systems Spring Module 12 Secondary Storage. Steve Gribble

Chapter 10: Mass-Storage Systems

Chapter 13: Mass-Storage Systems. Disk Scheduling. Disk Scheduling (Cont.) Disk Structure FCFS. Moving-Head Disk Mechanism

Chapter 13: Mass-Storage Systems. Disk Structure

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Tape pictures. CSE 30341: Operating Systems Principles

CSE 451: Operating Systems Winter Secondary Storage. Steve Gribble. Secondary storage

Mass-Storage. ICS332 Operating Systems

CS 537 Fall 2017 Review Session

CSCI-GA Database Systems Lecture 8: Physical Schema: Storage

I/O CANNOT BE IGNORED

CISC 7310X. C11: Mass Storage. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 4/19/2018 CUNY Brooklyn College

Storage and File Structure. Classification of Physical Storage Media. Physical Storage Media. Physical Storage Media

Module 13: Secondary-Storage Structure

Chapter 6. Storage and Other I/O Topics

Part IV I/O System. Chapter 12: Mass Storage Structure

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition,

COMP283-Lecture 3 Applied Database Management

Operating Systems. Operating Systems Professor Sina Meraji U of T

Magnetic Disks. Tore Brox-Larsen Including material developed by Pål Halvorsen, University of Oslo (primarily) Kai Li, Princeton University

Hard Disk Drives. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

Hard Disk Drives (HDDs) Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Mass-Storage Systems. Mass-Storage Systems. Disk Attachment. Disk Attachment

Ch 11: Storage and File Structure

I/O, Disks, and RAID Yi Shi Fall Xi an Jiaotong University

Hard Disk Drives (HDDs)

Storage Systems. Storage Systems

Lecture 16: Storage Devices

Deadlock Revisited. CS439: Principles of Computer Systems April 23, 2018

Chapter 14: Mass-Storage Systems. Disk Structure

Mass-Storage Structure

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili

Disk Scheduling COMPSCI 386

Chapter 14: Mass-Storage Systems

CSE 451: Operating Systems Winter Lecture 12 Secondary Storage. Steve Gribble 323B Sieg Hall.

Chapter 12: Mass-Storage

Chapter 12: Mass-Storage

Storing and Retrieving Data. Storing Data: Disks and Files. Solution 1: Techniques for making disks faster. Disks. Why Not Store Everything in Tapes?

CMSC 424 Database design Lecture 12 Storage. Mihai Pop

Principles of Data Management. Lecture #2 (Storing Data: Disks and Files)

Chapter 12: Secondary-Storage Structure. Operating System Concepts 8 th Edition,

Storing Data: Disks and Files. Storing and Retrieving Data. Why Not Store Everything in Main Memory? Database Management Systems need to:

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

Part IV I/O System Chapter 1 2: 12: Mass S torage Storage Structur Structur Fall 2010

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Disks. Protection & Security

Session: Hardware Topic: Disks. Daniel Chang. COP 3502 Introduction to Computer Science. Lecture. Copyright August 2004, Daniel Chang

Disk Scheduling. Based on the slides supporting the text

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition,

High-Performance Storage Systems

Storing and Retrieving Data. Storing Data: Disks and Files. Solution 1: Techniques for making disks faster. Disks. Why Not Store Everything in Tapes?

Database Systems II. Secondary Storage

Storing Data: Disks and Files. Storing and Retrieving Data. Why Not Store Everything in Main Memory? Chapter 7

CHAPTER 12: MASS-STORAGE SYSTEMS (A) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Data Storage and Query Answering. Data Storage and Disk Structure (2)

Module 13: Secondary-Storage

Overview of Mass Storage Structure

EECS 482 Introduction to Operating Systems

I/O & Storage. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University

CS370 Operating Systems

Chapter 12: Mass-Storage Systems. Operating System Concepts 9 th Edition

Storage: HDD, SSD and RAID

Storing Data: Disks and Files

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Computer Architecture ECE 568

Storage System COSC UCB

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

UNIT 2 Data Center Environment

Free Space Management

CS143: Disks and Files

CS370 Operating Systems

Database Systems. November 2, 2011 Lecture #7. topobo (mit)

Transcription:

1 Secondary Storage Management Disks just like memory, only different Introduction to I/O and Disk Management Why have disks? Ø Memory is small. Disks are large. Short term storage for memory contents (e.g., swap space). Reduce what must be kept in memory (e.g., code pages). Ø Memory is volatile. Disks are forever (?!) File storage. GB/dollar dollar/gb RAM 0.013(0.015,0.01) $77($68,$95) Disks 3.3(1.4,1.1) 30 (71,90 ) Capacity : GB vs. 1TB GB vs. 400GB 1GB vs 30GB How to approach persistent storage Different types of disks Disks first, then file systems. Ø Bottom up. Ø Focus on device characteristics which dominate performance or reliability (they become focus of SW). Disk capacity (along with processor performance) are the crown jewels of computer engineering. File systems have won, but at what cost victory? Ø Ipod, iphone, TivO, PDAs, laptops, desktops all have file systems. Ø Google is made possible by a file system. Ø File systems rock because they are: Persistent. Heirarchical (non-cyclical (mostly)). Rich in metadata (remember cassette tapes?) Indeible (hmmm, a weak point?) The price is compleity of implementation. Advanced Technology Attachment (ATA) Ø Standard interface for connecting storage devices (e.g., hard drives and CD-ROM drives) Ø Referred to as IDE (Integrated Drive Electronics), ATAPI, and UDMA. Ø ATA standards only allow cable lengths in the range of 18 to 36 inches. CHEAP. Small Computer System Interface (SCSI) Ø Requires controller on computer and on disk. Ø Controller commands are sophisticated, allow reordering. USB or Firewire connections to ATA disc Ø These are new bus technologies, not new control. Microdrive impressively small motors 3 4 Different types of disks Flash: An upcoming technology Bandwidth ratings. Ø These are unachievable. Ø 50 MB/s is ma off platters. Ø Peak rate refers to transfer from disc device s memory cache. SATA II (serial ATA) Ø 3 Gb/s (still only 50 MB/s off platter, so why do we care?) Ø Cables are smaller and can be longer than pata. SCSI 30 MB/s Ø Enables multiple drives on same bus Mode UDMA0 UDMA1 UDMA UDMA3 UDMA4 UDMA5 UDMA6 Speed 16.7 MB/s 5.0 MB/s 33.3 MB/s 44.4 MB/s 66.7 MB/s 100.0 MB/s 133 MB/s Flash memory gaining popularity Ø One laptop per child has 1GB flash (no disk) Ø Vista supports Flash as accelerator Ø Future is hybrid flash/disk or just flash? Ø Erased a block at a time (100,000 write-erase-cycles) Ø Pages are 51 bytes or,048 bytes Ø Read 18MB/s, write 15MB/s Ø Lower power than (spinning) disk GB/dollar dollar/gb RAM 0.013(0.015,0.01) $77($68,$95) Disks 3.3 (1.4,1.1) 30 (71,90 ) Flash 0.1 $10 5 6

7 Anatomy of a Disk Basic components Disk structure: the big picture Track /Sector s 1 0 1 Head Cylinder Physical structure of disks Surface Spindle Platter 8 Anatomy of a Disk Seagate 73.4 GB Fibre Channel Ultra 160 SCSI disk Anatomy of a Disk Eample: Seagate Cheetah ST373405LC (March 00) Specs: Ø 1 Platters Ø 4 Heads Ø Variable # of sectors/track Ø 10,000 RPM Average latency:.99 ms Ø Seek times Track-to-track: 0.6/0.9 ms Average: 5.6/6. ms Includes acceleration and settle time. Ø 160-00 MB/s peak transfer rate 1-8K cache Ø 1 Arms Ø 14,100 Tracks Ø 51 bytes/sector Specs: Ø Capacity: 73GB Ø 8 surfaces per pack Ø # cylinders: 9,549 Ø Total number of tracks per system: 36,394 Ø Variable # of sectors/track (776 sectors/track (avg)) Ø 10,000 RPM average latency:.9 ms. Ø Seek times track-to-track: 0.4 ms Average/ma: 5.1 ms/9.4ms Ø 50-85 MB/s peak transfer rate 4MB cache Ø MTBF: 1,00,000 hours 9 10 Disk Operations Read/Write operations Disk access latency Present disk with a sector address Ø Old: DA = (drive, surface, track, sector) Ø New: Logical block address (LBA) Heads moved to appropriate track Ø seek time Ø settle time The appropriate head is enabled Which component of disk access time is the longest? Ø A. Rotational latency Ø B. Transfer latency Ø C. Seek latency Wait for the sector to appear under the head Ø rotational latency Read/write the sector Ø transfer time Read time: seek time + latency + transfer time (5.6 ms +.99 ms + 0.014 ms) 11 1

13 Disk Addressing Disk Addressing Mapping a 3-D structure to a 1-D structure Software wants a simple disc virtual address space consisting of a linear array of sectors. Ø Sectors numbered 1..N, each 51 bytes (typical size). Ø Writing 8 surfaces at a time writes a 4KB page. Hardware has structure: Ø Which platter? Ø Which track within the platter? Ø Which sector within the track? The hardware structure affects latency. Ø Reading from sectors in the same track is fast. Ø Reading from the same cylinder group is faster than seeking. p 1 0 t 1 1 0 s 1 0 1 Sector Mapping criteria Ø block n+1 should be as close as possible to block n Surface Track? 0 n File blocks 14 The Impact of File Mappings File access times: Contiguous allocation The Impact of File Mappings File access times: Contiguous allocation Array elements map to contiguous sectors on disk Ø Case1: Elements map to the middle of the disk 5.6 + 3.0 + 6.0,048 44 = 8.6 + 9.0 = 37.6 ms Array elements map to contiguous sectors on disk Ø Case1: Elements map to the middle tracks of the platter 5.6 + 3.0 + 6.0,048 = 8.6 + 9.0 = 37.6 ms 44 Seek Time Constant Terms Latency Transfer Time Variable Term = time per revolution number of revolutions required to transfer data Case: Elements map to the inner tracks of the platter 5.6 + 3.0 + 6.0,048 1 5.6 + 3.0 + 6.0,048 636 = 8.6 + 58.0 = 66.6 ms Case3: Elements map to the outer tracks of the platter = 8.6 + 19.3 = 7.9 ms 15 16 Disk Addressing The impact of file mappings: Non-contiguous allocation Array elements map to random sectors on disk Ø Each sector access results in a disk seek,048 (5.6 + 3.0) = 17.6 seconds 0 n File blocks p 1 0 t 1 1 0 s 1 0 1 Practical Knowledge If the video you are playing off your hard drive skips, defragment your file system. OS block allocation policy is complicated. Defragmentation allows the OS to revisit layout with global information. Uni file systems need defragmentation less than Windows file systems, because they have better allocation policies. 17 18

19 Defragmentation Decisions Maimizing disk throughput Files written when the disk is nearly full are more likely to be fragmented. Ø A. True Ø B. False In a multiprogramming/timesharing environment, a queue of disk I/O requests can form (surface, track, sector) Disk CPU Other I/O The OS maimizes disk I/O throughput by minimizing head movement through disk head scheduling 0 Eamples Eamples Assume a queue of requests eists to read/write tracks: Ø 83 7 14 147 16 150 and the head is on track 65 0 5 50 65 75 100 15 150 Assume a queue of requests eists to read/write tracks: Ø 83 7 14 147 16 150 and the head is on track 65 0 5 50 65 75 100 15 150 FCFS scheduling results in the head moving 550 tracks Can we do better? 1 Minimizing head movement Minimizing head movement Greedy scheduling: shortest seek time first Ø Rearrange queue from: 83 7 14 147 16 150 To: 14 16 150 147 8 7 0 5 50 75 100 15 150 Greedy scheduling: shortest seek time first Ø Rearrange queue from: 83 7 14 147 16 150 To: 14 16 150 147 8 7 0 5 50 75 100 15 150 SSTF scheduling results in the head moving 1 tracks Can we do better? 3 4

5 SCAN scheduling Other variations Rearrange queue from: To: 83 7 150 147 14 83 147 7 16 14 150 16 C-SCAN scheduling ( Circular -SCAN) Ø Move the head in one direction until an edge of the disk is reached and then reset to the opposite edge 0 5 50 75 100 15 150 0 5 50 75 100 15 150 SCAN scheduling: Move the head in one direction until all requests have been serviced and then reverse. Also called elevator scheduling. Moves the head 187 tracks LOOK scheduling Same as C-SCAN ecept the head is reset when no more requests eist between the current head position and the approaching edge of the disk 6 Disk Performance Disk partitioning Disks are typically partitioned to minimize the largest possible seek time Ø A partition is a collection of cylinders Ø Each partition is a logically separate disk Disks Technology Trends Disks are getting smaller in size Ø Smaller à spin faster; smaller distance for head to travel; and lighter weight Disks are getting denser Ø More bits/square inch à small disks with large capacities Partition A Partition B Disks are getting cheaper Ø /year since 1991 Disks are getting faster Ø Seek time, rotation latency: 5-10%/year (-3 per decade) Ø Bandwidth: 0-30%/year (~10 per decade) Overall: Ø Disk capacities are improving much faster than performance 7 8 Management of Multiple Disks Using multiple disks to increase disk throughput Management of Multiple Disks Using multiple disks to improve reliability & availability Disk striping (RAID-0) Ø s broken into sub-blocks that are stored on separate disks similar to memory interleaving Ø Provides for higher disk bandwidth through a larger effective block size To increase the reliability of the disk, redundancy must be introduced Ø Simple scheme: disk mirroring (RAID-1) Ø Write to both disks, read from either. 1 3 OS disk block 8 9 10 11 3 14 15 0 1 3 8 9 10 11 3 14 15 0 1 3 0 0 0 1 0 1 0 1 0 Primary disk 0 0 0 1 0 1 0 1 0 Mirror disk Physical disk blocks 9 30

31 Who controls the RAID? Hardware Ø +Tend to be reliable (hardware implementers test) Ø +Offload parity computation from CPU Hardware is a bit faster for rewrite intensive workloads Ø -Dependent on card for recovery (replacements?) Ø -Must buy card (for the PCI bus) Ø -Serial reconstruction of lost disk Software Ø -Software has bugs Ø -Ties up CPU to compute parity Ø +Other OS instances might be able to recover Ø +No additional cost Ø +Parallel reconstruction of lost disk Management of Multiple Disks Using multiple disks to increase disk throughput RAID (redundant array of inepensive disks) disks Ø Byte-wise striping of the disks (RAID-3) or block-wise striping of the disks (RAID-0/4/5) Ø Provides better performance and reliability Eample: storing the byte-string 101 in a RAID-3 system 1 1 0 3 1 3 Improving Reliability and Availability RAID-4 Improving Reliability and Availability RAID-5 interleaved parity striping interleaved parity striping Ø Allows one to recover from the crash of any one disk Ø Eample: storing 8, 9, 10, 11, 1, 13, 14, 15, 0, 1,, 3 Disk 1 Disk Disk 3 Disk 4 Disk 5 Disk 1 Disk Disk 3 Parity Disk 8 9 0 0100 0 0 0110 0 0 0130 0 0 014 0 10 0 0 1 0 015 0 1 3 0 1 0 0 0 1 0 1 0 Parity 0 RAID-4 layout: 0 0 33 34 Improving Reliability and Availability RAID-5 interleaved parity striping Disk 1 Disk Disk 3 Disk 4 Disk 5 +1 + +3 8 9 0 0100 0 1 1 1 + 0 Parity 0 0 0 m no y z 0 0 aa0 0 0 0110 0 0 0130 0 0 0 a0 0 b 0 0 c0 0 0 0 0 0 1 + 1 0 Parity 0 0 0 0 0 bb0 0 cc 0 0 dd0 0 0 014 0 10 0 0 1 0 015 0 1 3 0 1 0 0 0 1 0 1 0 Parity 0 0 0 d 0 1 g0 0 j0 1 0 0 e 0 1 hi 0 1 0 1 kl 1 0 0 0 f 0 1 0 1 0 0 0 0 p 0 1 s0 0 v0 1 0 0 q 0 1 tu 0 1 0 1 w 1 0 0 0 r 0 1 0 1 0 0 0 0 0 1 ee0 0 hh0 1 0 +3 0 0 1 ff 0 1 0 1 ii 1 0 0 Parity 0 0 1 gg0 1 0 1 jj 1 0 35