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

Similar documents
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.

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

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

CSE 451: Operating Systems Spring Module 12 Secondary Storage

CSE 153 Design of Operating Systems

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

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

Disks and RAID. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, E. Sirer, R. Van Renesse]

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

Operating Systems. Operating Systems Professor Sina Meraji U of T

CSE 153 Design of Operating Systems Fall 2018

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

Introduction to I/O and Disk Management

Introduction to I/O and Disk Management

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

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

I/O CANNOT BE IGNORED

Hard Disk Drives (HDDs)

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

Mass-Storage Structure

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

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

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

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

Storage. CS 3410 Computer System Organization & Programming

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

I/O Devices & SSD. Dongkun Shin, SKKU

Mass-Storage Structure

Chapter 11. I/O Management and Disk Scheduling

Mass-Storage. ICS332 Operating Systems

Disks: Structure and Scheduling

I/O CANNOT BE IGNORED

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

Disk Scheduling COMPSCI 386

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

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

CS420: Operating Systems. Mass Storage Structure

Storage Technologies and the Memory Hierarchy

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture

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

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

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

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

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?

Operating Systems 2010/2011

Storage Technologies - 3

Chapter 10: Mass-Storage Systems

CS3600 SYSTEMS AND NETWORKS

Chapter 10: Mass-Storage Systems

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

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

CS510 Operating System Foundations. Jonathan Walpole

Computer Science 61C Spring Friedland and Weaver. Input/Output

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

Random-Access Memory (RAM) CS429: Computer Organization and Architecture. SRAM and DRAM. Flash / RAM Summary. Storage Technologies

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

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

Storage Systems : Disks and SSDs. Manu Awasthi July 6 th 2018 Computer Architecture Summer School 2018

Lecture 16: Storage Devices

Disc Allocation and Disc Arm Scheduling?

CSCI-UA.0201 Computer Systems Organization Memory Hierarchy

Block Device Scheduling. Don Porter CSE 506

Block Device Scheduling

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

EECS 482 Introduction to Operating Systems

CSE380 - Operating Systems. Communicating with Devices

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

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

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

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Outline of Today s Lecture. The Big Picture: Where are We Now?

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

CS370 Operating Systems

Storage Systems : Disks and SSDs. Manu Awasthi CASS 2018

Block Device Scheduling. Don Porter CSE 506

Computer Systems. Memory Hierarchy. Han, Hwansoo

V. Mass Storage Systems

CS143: Disks and Files

File System Management

L7: Performance. Frans Kaashoek Spring 2013

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

Storage Systems. Storage Systems

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

STORING DATA: DISK AND FILES

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

CS370 Operating Systems

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Administrivia. Midterm. Realistic PC architecture. Memory and I/O buses. What is memory? What is I/O bus? E.g., PCI

Chapter 6. Storage and Other I/O Topics

Module 1: Basics and Background Lecture 4: Memory and Disk Accesses. The Lecture Contains: Memory organisation. Memory hierarchy. Disks.

Readings. Storage Hierarchy III: I/O System. I/O (Disk) Performance. I/O Device Characteristics. often boring, but still quite important

Lecture 18: Memory Systems. Spring 2018 Jason Tang

Administrivia. CMSC 411 Computer Systems Architecture Lecture 19 Storage Systems, cont. Disks (cont.) Disks - review

UNIT 2 Data Center Environment

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

Bus Architecture Example

CSE 380 Computer Operating Systems

Mass-Storage Systems

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2017 Lecture 13

Transcription:

Secondary storage CS 537 Lecture 11 Secondary Storage Michael Swift Secondary storage typically: 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: 80GB-1TB it s cheap: 0.30 /GB it s persistent: data survives power loss it s slow: 100us-10 ms to access (compared to 100ns for ram) why is this slow?? 1 2 Another trip down memory lane Disk trends IBM 2314 About the size of 6 refrigerators 8 x 29MB (M!) Disk capacity, 1975-1989 doubled every 3+ years 25% improvement each year factor of 10 every decade exponential, but far less rapid than processor performance Disk capacity since 1990 doubling every 12 months 100% improvement each year factor of 1000 every decade 10x as fast as processor performance! 3 4 1

Rotating Disks vs. Solid-State Disks (AKA Flash) Forget everything you knew about rotating disks. SSDs are different Disks and the OS Disks are messy, messy devices errors, bad blocks, missed seeks, etc. Job of OS is to hide this mess from higher-level software low-level device drivers (initiate a disk read, etc.) higher-level abstractions (files, databases, etc.) OS may provide different levels of disk access to different clients physical disk block (surface, cylinder, sector) disk logical block (disk block #) file logical (filename, block or record or byte #) SSDs are complex software systems More later 6 I/O System Device Drivers user process! user process! OS! user process! file system! I/O system! device driver! device controller! Mechanism: Encapsulate details of device File system not aware of device details Much of OS code is in device drivers Responsible for many of the errors as well! Device driver interacts with device controller Read status registers, read data Write control registers, provide data for write operations How does device driver access controller? Special instructions Valid only in kernel mode, No longer popular Memory-mapped Read and write to special memory addresses Protect by placing in kernel address space only May map part of device in user address space for fast access disk! 7 8 2

Device Drivers: Starting I/O Programmed I/O (PIO) Must initiate and watch every byte Disadvantage: Large overhead for large transfers Direct Memory Access (DMA) Offload work from CPU to to special-purpose processor responsible for large transfers CPU: Write DMA command block into main memory Pointer to source and destination address Size of transfer CPU: Inform DMA controller of address of command block DMA controller: Handles transfer with I/O device controller Can use physical or virtual addresses (DVMA) Disadvantages of each approach?? Device Drivers: When is I/O complete? Polling Handshake by setting and clearing flags Controller sets flag when done CPU repeatedly checks flag Disadvantage: Busy-waiting CPU wastes cycles when I/O device is slow Must be attentive to device, or could lose data Interrupts: Handle asynchronous events Controller asserts interrupt request line when done CPU jumps to appropriate interrupt service routine (ISR) Interrupt vector: Table of ISR addresses Index by interrupt number Low priority interrupts postponed until higher priority finished Combine with DMA: Do not interrupt CPU for every byte 9 10 read/write head! Disk Terminology cylinder! spindle! track! platter! sector! surface! ZBR (Zoned bit recording): More sectors on outer tracks! 11 Example disk characteristics IBM Ultrastar 36XP drive form factor: 3.5 capacity: 36.4 GB rotation rate: 7,200 RPM (120 RPS) platters: 10 surfaces: 20 sector size: 512-732 bytes cylinders: 11,494 cache: 4MB transfer rate: 17.9 MB/s (inner) 28.9 MB/s (outer) full seek: 14.5 ms head switch: 0.3 ms 12 3

Disk Performance How long to read or write n sectors? Positioning time + Transfer time (n) Positioning time: Seek time + Rotational Delay Transfer time: n / (RPM * bytes/track) 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 seek times aren t diminishing very quickly (why?) rotation (latency): waiting for the sector to rotate under head depends on rotation rate of disk rates are increasing, but slowly (why?) transfer: transferring data from surface into disk controller, and from there sending it back to host depends on density of bytes on disk increasing, and very quickly When the OS uses the disk, it tries to minimize the cost of all of these steps particularly seeks and rotation 13 14 Disk Calculations Example disk: #surfaces: 4 #tracks/surface: 64K #sectors/track: 1K (assumption??) #bytes/sector: 512 RPM: 7200 = 120 tracks/sec Seek cost: 1.3ms - 16ms Questions How many disk heads? How many cylinders? How many sectors/cylinder? Capacity? What is the maximum transfer rate (bandwidth)? Average positioning time for random request? Time and bandwidth for random request of size: 4KB? 128 KB? 1 MB? Interacting with disks In the old days OS would have to specify cylinder #, sector #, surface #, transfer size i.e., OS needs to know all of the disk parameters Modern disks are even more complicated not all sectors are the same size, sectors are remapped, disk provides a higher-level interface, e.g., SCSI exports data as a logical array of blocks [0 N] maps logical blocks to cylinder/surface/sector OS only needs to name logical block #, disk maps this to cylinder/surface/sector on-board cache as a result, physical parameters are hidden from OS both good and bad 15 16 4

Disk Controller Responsible for interface between OS and disk drive Common interfaces: ATA/IDE vs. SCSI ATA/IDE used for personal storage: slow rotation, seek, high capacity SCSI for enterprise-class storage: faster rotation and seek QUESTION: which will be larger diameter? Which will have more platters? Basic operations Read block Write block OS does not know of internal complexity of disk Disk exports array of Logical Block Numbers (LBNs) Disks map internal sectors to LBNs Implicit contract: Large sequential accesses to contiguous LBNs achieve much better performance than small transfers or random accesses Disk Abstraction How should disk map internal sectors to LBNs? Goal: Sequential accesses (or contiguous LBNs) should achieve best performance Approaches: Traditional ordering Serpentine ordering 17 18 Reliability Buffering Disks fail more often... When continuously powered-on With heavy workloads Under high temperatures How do disks fail? Whole disk can stop working (e.g., motor dies) Transient problem (cable disconnected) Individual sectors can fail (e.g., head crash or scratch) Data can be corrupted or block not readable/writable Disks can internally fix some sector problems ECC (error correction code): Detect/correct bit flips Retry sector reads and writes: Try 20-30 different offset and timing combinations for heads Remap sectors: Do not use bad sectors in future How does this impact performance contract?? Disks contain internal memory (2MB-16MB) used as cache Read-ahead: Track buffer Read contents of entire track into memory during rotational delay Write caching with volatile memory Immediate reporting: Claim written to disk when not Data could be lost on power failure Use only for user data, not file system meta-data Command queueing Have multiple outstanding requests to the disk Disk can reorder (schedule) requests for better performance 19 20 5

Disk Scheduling Disk Scheduling Goal: Minimize positioning time Performed by both OS and disk itself; Why? FCFS: Schedule requests in order received Advantage: Fair Disadvantage: High seek cost and rotation Shortest seek time first (SSTF): Handle nearest cylinder next Advantage: Reduces arm movement (seek time) Disadvantage: Unfair, can starve some requests SCAN (elevator): Move from outer cylinder in, then back out again Advantage: More fair to requests, similar performance as SSTF Variation: Circular-Scan (C-Scan) Move head only from outer cylinder inward (then start over) Why??? (Two reasons) LOOK: SCAN, except stop at last request Calculate seek distance for workload with cylinder #s: 10, 2, 0, 85, 50, 40, 1, 37, 41; Start at #43, moving up 21 22 Flash disks: solid state storage Background A flash block is a grid of cells Single Level Cell (SLC) = 1 bit per cell (faster, more reliable) Multi Level Cell (MLC) = 2 bits per cell (slower, less reliable) 6

Write-in-Place vs. Logging Rotating disks Striping LBAs striped across flash packages Constant map from LBA to on-disk location Single request can span multiple chips Natural load balancing What s the right stripe size? SSDs Writes always to new locations Superseded blocks cleaned later Controller 08 16 24 32 40 Failure Modes Media imperfections, loose particles, vibration Latent sector errors [Bairavasundaram 07] E.g., with uncorrectable ECC Frequency of affected disks increases linearly with time Most affected disks (80%) have < 50 errors Temporal and spatial locality Correlation with recovered errors Disk scrubbing helps 19 17 25 33 41 2 10 18 26 34 42 3 11 19 27 35 43 4 12 20 28 36 44 5 13 21 29 37 45 6 14 22 30 38 46 7 15 23 31 39 47 Failure Modes Types of NAND flash errors (mostly when erases > wear limit) Write errors: Probability varies with # of erasures Read disturb: Increases with # of reads Data retention errors: Charge leaks over time Little spatial or temporal locality (within equally worn blocks) Better ECC can help Errors increase with wear: Need wear-leveling 7