Disks: Structure and Scheduling

Similar documents
STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

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

Hard Disk Drives (HDDs)

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

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

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

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

CSE 451: Operating Systems Spring Module 12 Secondary Storage

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

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

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

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

CS3600 SYSTEMS AND NETWORKS

CS420: Operating Systems. Mass Storage Structure

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

CSE 153 Design of Operating Systems

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

Chapter 10: Mass-Storage Systems

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

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

CSE506: Operating Systems CSE 506: Operating Systems

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

Disc Allocation and Disc Arm Scheduling?

Chapter 14: Mass-Storage Systems. Disk Structure

Disks October 22 nd, 2010

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

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

Chapter 13: Mass-Storage Systems. Disk Structure

Block Device Driver. Pradipta De

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Anatomy of a disk. Stack of magnetic platters. Disk arm assembly

Mass-Storage Structure

CSE 153 Design of Operating Systems Fall 2018

Module 13: Secondary-Storage Structure

Disk Scheduling. Based on the slides supporting the text

Main Points. File systems. Storage hardware characteris7cs. File system usage Useful abstrac7ons on top of physical devices

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

V. Mass Storage Systems

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

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Disk Scheduling. Chapter 14 Based on the slides supporting the text and B.Ramamurthy s slides from Spring 2001

Ref: Chap 12. Secondary Storage and I/O Systems. Applied Operating System Concepts 12.1

Chapter 10: Mass-Storage Systems

Chapter 10: Mass-Storage Systems

Chapter 12: Mass-Storage

[537] I/O Devices/Disks. Tyler Harter

Overview of Mass Storage Structure

Introduction to I/O and Disk Management

Disks March 15, 2010

CSE325 Principles of Operating Systems. Mass-Storage Systems. David P. Duggan. April 19, 2011

Introduction to I/O and Disk Management

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

Mass-Storage Structure

EIDE, ATA, SATA, USB,

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

Free Space Management

Disks March 26 th, 2007

Main Points. File systems. Storage hardware characteris7cs. File system usage Useful abstrac7ons on top of physical devices

CS370 Operating Systems

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

Operating Systems. Operating Systems Professor Sina Meraji U of T

Principles of Operating Systems CS 446/646

Disk Scheduling COMPSCI 386

37. Hard Disk Drives. Operating System: Three Easy Pieces

Chapter 14: Mass-Storage Systems

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

I/O Device Controllers. I/O Systems. I/O Ports & Memory-Mapped I/O. Direct Memory Access (DMA) Operating Systems 10/20/2010. CSC 256/456 Fall

Department of Computer Engineering University of California at Santa Cruz. File Systems. Hai Tao

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

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

EECS 482 Introduction to Operating Systems

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

Disk scheduling Disk reliability Tertiary storage Swap space management Linux swap space management

CSE Opera+ng System Principles

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware

CSCI-GA Operating Systems. I/O : Disk Scheduling and RAID. Hubertus Franke

Block Device Scheduling. Don Porter CSE 506

Mass-Storage Systems

Chapter 11. I/O Management and Disk Scheduling

Storage. CS 3410 Computer System Organization & Programming

Tape pictures. CSE 30341: Operating Systems Principles

I/O Systems and Storage Devices

File. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling

Block Device Scheduling. Don Porter CSE 506

Block Device Scheduling

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

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

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

Chapter 11: Mass-Storage Systems

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

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

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

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

Today: Secondary Storage! Typical Disk Parameters!

CS370 Operating Systems

Module 13: Secondary-Storage

Transcription:

Disks: Structure and Scheduling COMS W4118 References: Opera;ng Systems Concepts (9e), Linux Kernel Development, previous W4118s Copyright no2ce: care has been taken to use only those web images deemed by the instructor to be in the public domain. If you see a copyrighted image on any slide and are the copyright owner, please contact the instructor. It will be removed. 1

Disk Structure Range from 30GB to 3TB per drive Aluminum plasers with magne;c coa;ng Commonly, 2-5 plasers per drive Common plaser sizes: 3.5, 2.5, and 1.8 Magne;c heads 2

The First Commercial Disk Drive 1956 IBM RAMDAC computer included the IBM Model 350 disk storage system 5M (7 bit) characters 50 x 24 plasers Access ;me = < 1 second 3

Disk Interface From FS perspec;ve: disk is addressed as a one dimension array of logical sectors Disk controller maps logical sector to physical sector iden;fied by track #, surface #, and sector # 9 10 8 18 11 7 19 17 23 0 12 20 22 16 Note: Old drives allowed direct C/H/S (cylinder/head/sector) addressing by OS. Modern drives export LBA (logical block address) and do the mapping to C/H/S internally. 6 21 1 13 15 14 5 2 4 3 4

Disk Latencies Rota;onal delay: rotate disk to get to the right sector Seek ;me: move disk arm to get to the right track Transfer ;me: get bits off the disk 5

Seek Time Must move arm to the right track Can take a while (e.g., 5 10ms) Accelera;on, coas;ng, sesling (can be significant, e.g., 2ms) 11 0 1 10 19 12 20 13 2 9 18 23 21 14 3 22 8 17 16 15 4 7 6 5 6

Transfer Time Transfer bits out of disk Actually presy fast (e.g., 125MB/s) 11 0 1 10 19 12 20 13 2 9 18 23 21 14 3 22 8 17 16 15 4 7 6 5 7

I/O Time (T) and Rate (R) T = Rota;onal delay + seek ;me + txfer ;me R = Size of transfer / T Workload 1: large sequen;al accesses? Workload 2: small random accesses? 8

Example: I/O Time and Rate Barracuda Cheetah 15K.5 Capacity 1TB 300GB Rota;onal speed 7200 RPM 15000 RPM Rota;onal latency (ms) 4.2 2.0 Avg seek (ms) 9 4 Max Transfer 105 MB/s 125 MB/s PlaSers 4 4 Connects via SATA SCSI Random 4KB read Barracuda: T = 13.2ms, R = 0.31MB/s Cheetah: T = 6ms, R = 0.66MB/s Sequen;al 100 MB read Barracuda: T = 950ms, R = 105 MB/s Cheetah: T = 800ms, R = 125 MB/s 9

Design ;p: Use Disks Sequen;ally! Disk performance differs by a factor of 200 or 300 for random v.s. sequen;al accesses When possible, access disks sequen;ally 10

Mapping of logical sectors to physical Logical sector 0: the first sector of the first (outermost) track of the first surface Logical sector address incremented within track, then tracks within cylinder, then across cylinders, from outermost to innermost Track skew 0 9 10 8 18 11 7 19 17 23 12 20 22 16 6 21 1 13 15 14 5 2 4 3 11

Parallel Reading from Heads All heads should point to same place on track Why not read from all heads in parallel? Need perfectly aligned heads Hard to do in prac;ce Heads not perfectly aligned because of Mechanical vibra;ons Thermal gradients Mechanical imperfec;ons High density makes problem worse Needs high throughput read/write circuitry Consequence: most drives have a single ac;ve head at a ;me 12

Pros and cons of default mapping Pros Simple to program Default mapping reduces seek ;me for sequen;al access Cons FS can t precisely see mapping Reverse- engineer mapping in OS is difficult # of sectors per track changes Disk silently remaps bad sectors 13

Disk cache Internal memory (8MB- 32MB) used as cache Read- ahead: track buffer Read contents of en;re track into memory during rota;onal delay Write caching with vola;le memory Write back or immediate repor;ng: claim wrisen to disk when not Faster, but data could be lost on power failure Write through: ack aoer data wrisen to plaser 14

Disk scheduling Goal: minimize posi;oning ;me Performed by both OS and disk itself Why? OS can control: Sequence of workload requests Disk knows: Geometry, accurate posi;oning ;mes 15

FCFS Disk Scheduling Schedule requests in order received (FCFS) Advantage: fair Disadvantage: high seek cost and rota;on Total head movement of 640 cylinders 16

SSTF: Shortest Seek Time First Shortest seek ;me first (SSTF): Form of Shortest Job First (SJF) scheduling Handle nearest cylinder next Advantage: reduces arm movement (seek ;me) Disadvantage: unfair, can starve some requests Total head movement of 236 cylinders 17

Elevator (aka SCAN or C- SCAN) Disk arm sweeps across disk If request comes for a block already serviced in this sweep, queue it for next sweep 11 0 1 10 19 12 20 13 2 9 18 23 21 14 3 22 8 17 16 15 4 7 6 5 18

SCAN (Elevator) Disk Scheduling Make up and down passes across all cylinders Pros: efficient, simple Cons: Unfair. Oldest requests (furthest away) also wait longest. Total head movement of 208 cylinders 19

C- SCAN Provides a more uniform wait ;me 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, however, 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 Total number of cylinders? 20

C- SCAN (Elevator) Scheduling Head reads in one direc;on only Wrap around without reading when end is reached (like circular linked list) Provides a more uniform wait ;me than SCAN 21

C- LOOK Scheduling In prac;ce, don t need to scan to ends of disk Wrap around when no more requests Wrap to earliest outstanding request 22

Modern disk scheduling issues Elevator (or SSTF) ignores rota;on! Shortest posi;oning ;me first (SPTF) OS + disk work together to implement 11 0 1 10 19 12 20 13 2 9 18 23 21 14 3 22 8 17 16 15 4 7 6 5 23

I/O Scheduling in Prac;ce Simple: Linus Elevator scheduler Default un;l 2.4 Variant of C- LOOK algorithm Merge new request with exis;ng where possible Otherwise, insert in sorted order between exis;ng requests If no suitable loca;on found, insert at queue tail In prac;ce situa;on is more complicated due to Interac;ons with filesystem (data layout) Interac;ons with caches (write- back vs. write- through) Write and read requests have different priority Delay sensi;ve applica;ons such as mul;media Addi;onal algorithms: Deadline, Completely Fair Queuing (CFQ) Will look in a bit more depth later 24

Disk technology trends Data more dense More bits per square inch Disk head closer to surface Create smaller disk with same capacity Disk geometry smaller Spin faster Increase b/w, reduce rota;onal delay Faster seek Lighter weight Disk price cheaper Density improving more than speed (mechanical limita;ons) 25

New mass storage technologies New memory- based mass storage technologies avoid seek ;me and rota;onal delay No moving parts means more reliable, shock resistant NAND Flash: ubiquitous in mobile devices BaSery- backed DRAM (NVRAM) Disadvantages Price: more expensive than same capacity disk Reliability: more likely to lose data Other significant quirk: cant rewrite easily Open research ques;on: how to effec;vely use flash in commercial storage systems Will look in more depth later 26