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

Similar documents
Hard Disk Drives (HDDs)

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

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

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

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

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

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

I/O Systems. Jo, Heeseung

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CSE 153 Design of Operating Systems Fall 2018

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

CSE 153 Design of Operating Systems

CSE 451: Operating Systems Spring Module 12 Secondary Storage

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

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

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

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

Disks: Structure and Scheduling

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

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

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

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

Chapter 12: Mass-Storage

CS420: Operating Systems. Mass Storage Structure

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

CS3600 SYSTEMS AND NETWORKS

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

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

Computer Systems Laboratory Sungkyunkwan University

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Operating Systems. V. Input / Output

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

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. (done)

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

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

V. Mass Storage Systems

Chapter 11. I/O Management and Disk Scheduling

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

16:30 18:00, June 20 (Monday), 2011 # (even student IDs) # (odd student IDs) Scope

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

Chapter 10: Mass-Storage Systems

Operating Systems. Operating Systems Professor Sina Meraji U of T

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

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

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

Mass-Storage Structure

Chapter 10: Mass-Storage Systems

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

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

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

Operating Systems. V. Input / Output. Eurecom

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

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

Introduction to I/O and Disk Management

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

Introduction to I/O and Disk Management

EIDE, ATA, SATA, USB,

I/O Systems and Storage Devices

I/O Management and Disk Scheduling. Chapter 11

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

Overview of Mass Storage Structure

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

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

Mass-Storage Structure

Chapter 10: Mass-Storage Systems

Mass-Storage. ICS332 Operating 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

Free Space Management

Disk Scheduling COMPSCI 386

Disks October 22 nd, 2010

Devices and Device Controllers. secondary storage (disks, tape) and storage controllers

Bus Architecture Example

EECS 482 Introduction to Operating Systems

EECS 482 Introduction to Operating Systems

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

UNIT 2 Data Center Environment

CSC369 Lecture 9. Larry Zhang, November 16, 2015

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

UNIT 4 Device Management

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

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Spring 2018

CHAPTER 12 AND 13 - MASS-STORAGE STRUCTURE & I/O- SYSTEMS

Disc Allocation and Disc Arm Scheduling?

Outline. Operating Systems: Devices and I/O p. 1/18

Today: Secondary Storage! Typical Disk Parameters!

Principles of Operating Systems CS 446/646

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

Chapter 14: Mass-Storage Systems. Disk Structure

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

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

Storage. CS 3410 Computer System Organization & Programming

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

CS370 Operating Systems

Tape pictures. CSE 30341: Operating Systems Principles

Input/Output. Chapter 5: I/O Systems. How fast is I/O hardware? Device controllers. Memory-mapped I/O. How is memory-mapped I/O done?

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Fall 2017

1 What is an operating system?

Input Output (IO) Management

Transcription:

Hard Disk Drives (HDDs) Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu

Virtualization Virtual CPUs Virtual memory Concurrency Threads Synchronization Three Pieces Persistence How to make information persist, despite computer crashes, disk failures, or power outages? Storage File systems 2

Modern System Architecture Up to 1536 GB 19.2 GB/s per channel Broadwell 4.8 GHz Up to 22 cores 19.2 GB/s per link Up to 400 MB/s Up to 2 GB/s 1 GB/s per lane 500 MB/s per lane Up to 600 MB/s Platform Controller Hub (PCH) Up to 40 GbE 3

A Typical I/O Device Device interface: Registers Status Command Data Hidden internals: Micro-controller (CPU) Memory (DRAM or SRAM or both) Other device-specific mechanical/electronic components Firmware Control: Special instructions (e.g. in & out in x86) vs. memory-mapped I/O (e.g. load & store) Data transfer: Programmed I/O (PIO) vs. DMA Status check: Polling vs. Interrupts 4

Classifying I/O Devices Block device Stores information in fixed-size blocks, each one with its own address Typically, 512B or 4KB per block Can read or write each block independently Disks, tapes, etc. Character device Delivers or accepts a stream of characters Not addressable and no seek operation supported Printers, networks, mouse, keyboard, etc. 5

I/O Stack I/O request I/O reply User processes Make I/O call, format I/O, spooling Device-independent software Naming, protection, blocking, buffering, allocation Device drivers Interrupt handlers Hardware Set up device registers, check status Wake up driver when I/O completed Perform I/O operation 6

Device Drivers Device-specific code to control each I/O device Require to define a well-defined model and a standard interface Implementation Statically linked with the kernel Selectively loaded into the system during boot time Dynamically loaded into the system during execution (especially for hot pluggable devices) Variety is a challenge Many, many devices Each has its own protocol 7

OS Reliability 8

OS Reliability and Device Drivers Reliability remains a crucial, but unresolved problem 5% of Windows systems crash every day Huge cost of failures: stock exchange, e-commerce, etc. Growing unmanaged systems : digital appliances, CE devices OS extensions are increasingly prevalent 70% of Linux kernel code Over 35,000 drivers with over 120,000 versions on WinXP Written by less experienced programmer Extensions are a leading cause of OS failure Drivers cause 85% of WinXP crashes Drivers are 7 times buggier than the kernel in Linux 9

Secondary Storage Anything that is outside of primary memory Does not permit direct execution of instructions or data retrieval via machine load/instructions Abstracted as an array of sectors Each sector is typically 512 bytes or 4096 bytes HDD (Hard Disk Drive) Characteristics It s large: 100 GB or more It s cheap: 3TB SATA3 hard disk costs 100,000won It s persistent: data survives power loss It s slow: milliseconds to access 10

HDD Architecture Electromechanical Rotating disks Arm assembly Electronics Disk controller Buffer Host interface 11

A Modern HDD Seagate Barracuda ST5000DM000 (5TB) 8 Heads, 4 Discs 63 sectors/track, 16,383 cylinders Avg. track density: 455K TPI (tracks/inch) Avg. areal density: 826 Gbits/sq.inch Spindle speed: 7200 rpm (8.3 ms/rotation) Internal cache buffer: 128 MB Average seek time: < 12.0 ms Max. I/O data transfer rate: 600 MB/s (SATA3) Max. sustained data transfer rate: 160 MB/s Max power-on to ready: < 22.0 sec 12

HDD Internals Our Boeing 747 will fly at the altitude of only a few mm at the speed of approximately 65mph periodically landing and taking off And still the surface of the runway, which consists of a few mmthink layers, will stay intact for years 13

Interfacing with HDDs Cylinder-Head-Sector (CHS) scheme Each block is addressed by <Cylinder #, Head #, Sector #> The OS needs to know all disk geometry parameters Logical block addressing (LBA) scheme First introduced in SCSI Disk is abstracted as a logical array of blocks [0,, N-1] Address a block with a logical block address (LBA) Disk maps an LBA to its physical location Physical parameters of a disk are hidden from OS Read <2, 2> Write <8, 4> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15... 14

HDD Performance Factors Seek time (T seek ) Moving the disk arm to the correct cylinder Depends on the cylinder distance (not purely linear cost) Average seek time is roughly one-third of the full seek time Rotational delay (T rotation ) Waiting for the sector to rotate under head Depends on rotations per minute (RPM) 5400, 7200 RPM is common, 10K or 15K RPM for servers Transfer time (T transfer ) Transferring data from surface into disk controller, sending it back to the host 15

HDD Performance Comparison Cheetah 15K.5 Barracuda Capacity 300 GB 1 TB RPM 15,000 7,200 Avg. Seek 4 ms 9 ms Max Transfer 125 MB/s 105 MB/s Platters 4 4 Cache 16MB 16/32 MB Interface SCSI SATA Random Read (4 KB) Sequential Read (100 MB) T seek = 4ms T rotation = 60 / 15000 / 2 = 2ms T transfer = 4KB / 125MB = 32μs R I/O 4KB / 6ms = 0.66 MB/s T transfer = 100MB / 125MB = 0.8s R I/O 100MB / 0.8s = 125 MB/s T seek = 9ms, T rotation = 60 / 7200 / 2 = 4.2ms T transfer = 4KB / 105MB = 37μs R I/O 4KB / 13.2ms = 0.31 MB/s T transfer = 100MB / 105MB = 0.95s R I/O 100MB / 0.95s = 105 MB/s 16

Disk Scheduling Given a stream of I/O requests, in what order should they be served? Much different than CPU scheduling Seeks are so expensive Position of disk head relative to request position matters more than length of a job Work conserving schedulers Always try to do work if there s work to be done Non-work-conserving schedulers Sometimes, it s better to wait instead if system anticipates another request will arrive 17

FCFS First-Come First-Served (= do nothing) Reasonable when load is low Long waiting times for long request queues 18

SSTF Shortest Seek Time First Minimizes arm movement (seek time) Unfairly favors middle blocks May cause starvation Nearest-Block-First (NBF) when the drive geometry is not available to the host OS 19

SCAN SCAN Service requests in one direction until done, then reverse Skews wait times non-uniformly Favors middle blocks F-SCAN Freezes the queue when it is doing a sweep Avoids starvation of far-away requests 20

C-SCAN Circular SCAN Like SCAN, but only goes in one direction (e.g. typewriter) Uniform wait times SCAN and C-SCAN are referred to as the elevator algorithm Both do not consider rotation 21

Modern Disk Scheduling I/O scheduler in the host OS Improve overall disk throughput Merge requests to reduce the number of requests Sort requests to reduce disk seek time Prevent starvation Provide fairness among different processes Disk drive Disk has multiple outstanding requests e.g. SATA NCQ (Native Command Queueing): up to 32 requests Disk schedules requests using its knowledge of head position and track layout e.g. SPTF (Shortest Positioning Time First): consider rotation as well 22