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

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

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

Hard Disk Drives (HDDs)

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

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

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

CSE 451: Operating Systems Spring Module 12 Secondary Storage

I/O Systems. Jo, Heeseung

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

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

CSE 153 Design of Operating Systems

Operating Systems. Operating Systems Professor Sina Meraji U of T

Computer Systems Laboratory Sungkyunkwan University

CSE 153 Design of Operating Systems Fall 2018

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

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

Chapter 12: Mass-Storage

Mass-Storage Structure

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

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

CS420: Operating Systems. Mass Storage Structure

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

V. Mass Storage Systems

CS3600 SYSTEMS AND NETWORKS

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

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

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

Chapter 10: Mass-Storage Systems

Mass-Storage. ICS332 Operating Systems

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

Disks: Structure and Scheduling

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

Chapter 10: Mass-Storage Systems

CSE 120 Principles of Operating Systems

Module 13: Secondary-Storage Structure

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

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

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

UNIT 4 Device Management

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

EIDE, ATA, SATA, USB,

CSC369 Lecture 9. Larry Zhang, November 16, 2015

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?

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

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

Chapter 10: Mass-Storage Systems

Operating Systems. V. Input / Output

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

Block Device Driver. Pradipta De

Disk Scheduling COMPSCI 386

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

Chapter 14: Mass-Storage Systems. Disk Structure

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

Tape pictures. CSE 30341: Operating Systems Principles

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

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

CSE 120 Principles of 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

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

Today: Secondary Storage! Typical Disk Parameters!

I/O Management and Disk Scheduling. Chapter 11

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

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

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

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

CSE506: Operating Systems CSE 506: Operating Systems

Overview of Mass Storage Structure

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

CS330: Operating System and Lab. (Spring 2006) I/O Systems

Chapter 14: Mass-Storage Systems

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

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

Disks October 22 nd, 2010

Block Device Scheduling. Don Porter CSE 506

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

Free Space Management

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

Block Device Scheduling. Don Porter CSE 506

Block Device Scheduling

Module 13: Secondary-Storage

Input/Output Management

Mass-Storage Structure

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

Disc Allocation and Disc Arm Scheduling?

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

Chapter 11. I/O Management and Disk Scheduling

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

EECS 482 Introduction to Operating Systems

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

Operating Systems. V. Input / Output. Eurecom

CS510 Operating System Foundations. Jonathan Walpole

Principles of Operating Systems CS 446/646

EECS 482 Introduction to Operating Systems

Introduction to I/O and Disk Management

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

Introduction to I/O and Disk Management

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

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

Disk Scheduling. Based on the slides supporting the text

Transcription:

I/O & Storage Jin-Soo Kim ( jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu

Today s Topics I/O systems Device characteristics: block vs. character I/O systems layers Storage systems HDDs (Hard Disk Drives) Disk scheduling policies 2

I/O Devices (1) Block device Stores information in fixed-size blocks, each one with its own address. 512B 32KB per block It is possible to read or write each block independently of all the other ones. Disks, tapes, etc. Character device Delivers or accepts a stream of characters. Not addressable and no seek operation. Printers, networks, mice, keyboards, etc. 3

I/O Devices (2) Device controller (or host adapter) I/O devices have components: Mechanical component Electronic component The electronic component is the device controller. May be able to handle multiple devices. Controller s tasks Convert serial bit stream to block of bytes. Perform error correction as necessary. Make available to main memory. 4

Goals of I/O Software Goals Device independence Uniform naming Error handling Synchronous vs. asynchronous Buffering Sharable vs. dedicated devices 5

I/O Systems User-level I/O Software Device-independent I/O Software Device Drivers Interrupt Handlers Hardware Network 6

I/O Systems Layers 7

Device Drivers (1) Device drivers Device-specific code to control each I/O device interacting with device-independent I/O software and interrupt handlers. Requires to define a well-defined model and a standard interface of how they interact with the rest of the OS. Implementing device drivers: 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). 8

Device Drivers (2) 9

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

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

Secondary Storage Secondary storage usually is anything that is outside of primary memory. does not permit direct execution of instructions or data retrieval via machine load/store instructions. Characteristics It s large: 100GB and more It s cheap: 2TB SATA3 disk costs 100,000 It s persistent: data survives power loss. It s slow: milliseconds to access. 12

HDDs (1) Electromechanical Rotating disks Arm assembly Electronics Disk controller Buffer Host interface 13

HDDs (2) Seagate ST40000DM000 (4TB) 8 Heads, 4 Discs Max. recording density: 1807K FCI (flux change/inch) Avg. track density: 340K TPI (tracks/inch) Avg. areal density: 625 Gbits/sq.inch Spindle speed: 7200rpm (8.3ms/rotation) Average seek time: < 12.0ms (read), < 12.0ms (write) Max. internal data transfer rate: 1813 Mbits/sec Max. I/O data transfer rate: 600MB/sec (SATA-3) Max. sustained data transfer rate: 180MB/sec Internal cache buffer: 64MB Max power-on to ready: < 18.0 sec 14

HDDs (3) Hard disk 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 mm-thick layers, will stay intact for years. 15

Managing Disks (1) Disks and the OS Disks are messy physical devices: Errors, bad blocks, missed seeks, etc. The job of the OS is to hide this mess from higherlevel software. Low-level device drivers (initiate a disk read, etc) Higher-level abstractions (files, databases, etc.) The OS may provide different levels of disk access to different clients. Physical disk block (surface, cylinder, sector) Disk logical block (disk block #) Logical file (filename, block or record or byte #) 16

Managing Disks (2) Interacting with disks Specifying disk requests requires a lot of info: Cylinder #, surface #, track #, sector #, transfer size, etc. Older disks required the OS to specify all of this The OS needs to know all disk parameters. Modern disks are more complicated. Not all sectors are the same size, sectors are remapped, etc. Current disks provide a higher-level interface (e.g., SCSI) The disks exports its data as a logical array of blocks [0..N-1] Disk maps logical blocks to cylinder/surface/track/sector. Only need to specify the logical block # to read/write. As a result, physical parameters are hidden from OS. 17

Managing Disks (3) Disk performance Performance depends on a number of steps Seek: moving the disk arm to the correct cylinder depends on how fast disk arm can move (increasing very slowly) Rotation: waiting for the sector to rotate under head depends on rotation rate of disk (increasing, but slowly) Transfer: transferring data from surface into disk controller, sending it back to the host. depends on density of bytes on disk (increasing, and very quickly) Disk scheduling: Because seeks are so expensive, the OS tries to schedule disk requests that are queued waiting for the disk. 18

FCFS FCFS (= do nothing) Reasonable when load is low. Long waiting times for long request queues. 19

SSTF Shortest seek time first Minimizes arm movement (seek time) Maximizes request rate Unfairly favors middle blocks May cause starvation of some requests 20

SCAN Elevator algorithm Service requests in one direction until done, then reverse Skews wait times non-uniformly 21

C-SCAN Circular SCAN Like SCAN, but only go in one direction (e.g. typewritters) Uniform wait times 22

LOOK / C-LOOK LOOK / C-LOOK Similar to SCAN/C-SCAN, but the arm goes only as far as the final request in each direction. C-LOOK 23

Disk Scheduling Selecting a disk scheduling algorithm SSTF is common and has a natural appeal. SCAN and C-SCAN perform better for systems that place a heavy load on the disk. Either SSTF or LOOK is a reasonable choice for the default algorithm. Performance depends on the number and types of requests. Requests for disk service can be influenced by the file allocation method. In general, unless there are request queues, disk scheduling does not have much impact. Important for servers, less so for PCs Modern disks often do the disk scheduling themselves. Disks know their layout better than OS, can optimize better. Ignores, undoes any scheduling done by OS. 24

Modern Disks Intelligent controllers A small CPU + many kilobytes of memory. They run a program written by the controller manufacturer to process I/O requests from the CPU and satisfy them. Intelligent features: Read-ahead: the current track Caching: frequently-used blocks Command queueing Request reordering: for seek and/or rotational optimality Request retry on hardware failure Bad block/track identification Bad block/track remapping: onto spare blocks and/or tracks 25

I/O Schedulers I/O scheduler s job Improve overall disk throughput Merging requests to reduce the number of requests Reordering and sorting requests to reduce disk seek time Prevent starvation Submit requests before deadline Avoid read starvation by write Provide fairness among different processes Guarantee quality-of-service (QoS) requirement 26