CSE 451: Operating Systems Spring Module 12 Secondary Storage

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

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

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

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

CSE 153 Design of Operating Systems

Operating Systems. Operating Systems Professor Sina Meraji U of T

CSE 153 Design of Operating Systems Fall 2018

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

Hard Disk Drives (HDDs)

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

Mass-Storage Structure

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

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

Mass-Storage. ICS332 Operating Systems

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

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

Disk Scheduling COMPSCI 386

Storage. CS 3410 Computer System Organization & Programming

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

Even coarse architectural trends impact tremendously the design of systems

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

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

Disks: Structure and Scheduling

EECS 482 Introduction to Operating Systems

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

Introduction to I/O and Disk Management

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

Introduction to I/O and Disk Management

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

STORING DATA: DISK AND FILES

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

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

Chapter 10: Mass-Storage Systems

CSE 120 Principles of Operating Systems

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

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

Chapter 12: Mass-Storage

Storing Data: Disks and Files

EECS 482 Introduction to Operating Systems

FFS: The Fast File System -and- The Magical World of SSDs

I/O CANNOT BE IGNORED

Mass-Storage Systems

Today: Secondary Storage! Typical Disk Parameters!

CS420: Operating Systems. Mass Storage Structure

CS370 Operating Systems

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

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

Even coarse architectural trends impact tremendously the design of systems. Even coarse architectural trends impact tremendously the design of systems

Disc Allocation and Disc Arm Scheduling?

File System Management

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

Lecture 16: Storage Devices

Even coarse architectural trends impact tremendously the design of systems

COMP283-Lecture 3 Applied Database Management

L7: Performance. Frans Kaashoek Spring 2013

Solving the I/O bottleneck with Flash

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

Disks October 22 nd, 2010

CSE 451: Operating Systems Winter Module 2 Architectural Support for Operating Systems

CSE 120 Principles of Operating Systems

Professor: Pete Keleher! Closures, candidate keys, canonical covers etc! Armstrong axioms!

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

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

Main Points. File systems. Storage hardware characteristics. File system usage patterns. Useful abstractions on top of physical devices

Monday, May 4, Discs RAID: Introduction Error detection and correction Error detection: Simple parity Error correction: Hamming Codes

CS3600 SYSTEMS AND NETWORKS

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

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

Tape pictures. CSE 30341: Operating Systems Principles

Mass-Storage Structure

Database Systems II. Secondary Storage

CSE 333 Lecture 9 - storage

Disks and Files. Storage Structures Introduction Chapter 8 (3 rd edition) Why Not Store Everything in Main Memory?

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

Chapter 10: Mass-Storage Systems

Computer Systems CSE 410 Autumn Disks and File Systems

Where Have We Been? Ch. 6 Memory Technology

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

CSCI-UA.0201 Computer Systems Organization Memory Hierarchy

SCSI vs. ATA More than an interface. Dave Anderson, Jim Dykes, Erik Riedel Seagate Research April 2003

Database Architecture 2 & Storage. Instructor: Matei Zaharia cs245.stanford.edu

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

Chapter 13: Mass-Storage Systems. Disk Structure

CSE506: Operating Systems CSE 506: Operating Systems

Chapter 14: Mass-Storage Systems

V. Mass Storage Systems

CS 405G: Introduction to Database Systems. Storage

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

The personal computer system uses the following hardware device types -

Lecture S3: File system data layout, naming

CSC369 Lecture 9. Larry Zhang, November 16, 2015

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

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

Chapter 11. I/O Management and Disk Scheduling

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

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

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

Transcription:

CSE 451: Operating Systems Spring 2017 Module 12 Secondary Storage John Zahorjan 1

Secondary storage 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: 500-8000GB it s cheap: $0.05-$0.10/GB for hard drives it s persistent: data survives power loss it s slow: milliseconds to access why is this slow?? it does fail, if rarely big failures (drive dies; MTBF ~3 years) if you have 100K drives and MTBF is 3 years, that s 1 big failure every 15 minutes! little failures (read/write errors, one byte in 10 13 ) 2

Another trip down memory lane IBM 2314 About the size of 6 refrigerators 8 x 29MB (M!) Required similarsized air condx!.01% (not 1%.01%!) the capacity of this $100 4 x6 x1 item 3

Disk capacity, 1975-1989 doubled every 3+ years 25% improvement each year factor of 10 every decade Still exponential, but far less rapid than CPU performance Disk capacity, 1990-2002 Disk trends doubling every 12 months 100% improvement each year factor of 1000 every decade Capacity growth 10x as fast as processor performance! Disk capacity, 2003-recently back to 25% improvement rate 4

HDD Areal Density and Average Sales Price https://www.forbes.com/sites/tomcoughlin/2014/12/22/hdd-areal-density-and-tbtrends/#46f03ae27f3c 5

Only a few years ago, we purchased disks by the megabyte Today, 1 GB (a billion bytes) costs $1 $0.50 $0.10- $0.05 from Dell (except you have to buy in increments of 40 80 250 2000 GB) => 1 TB costs $1K $500 $100, 1 PB costs $1M $500K $100K Technology is amazing Flying a 747 6 above the ground Reading/writing a strip of postage stamps But Jets do crash 6

Memory hierarchy 100 bytes 256KB 32KB CPU registers L1 cache L2 cache < 1 ns 1 ns 4 ns 1GB Primary Memory 60 ns 1TB Secondary Storage 10 ms 1PB Tertiary Storage 1s-1hr Each level acts as a cache of lower levels 7

Memory hierarchy: distance analogy 1 minute 10 minutes seconds CPU registers L1 cache L2 cache My head This room This building 1.5 hours Primary Memory Olympia 2 years Secondary Storage Pluto 2,000 years Tertiary Storage Andromeda 8

2017 2004 Gribble, Jim Gray, Lazowska, Microsoft Levy, Corporation Zahorjan, 9

HDDs 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 (disk hardware increasingly helps with this) low-level device drivers (initiate a disk read, etc.) higher-level abstractions (files, databases, etc.) (note that modern disk drives do some of this masking for the OS) 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 #) 10

Physical disk structure Disk components platters surfaces tracks sectors cylinders arm heads cylinder track sector surface platter arm head 11

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, relatively quickly When the OS uses the disk, it tries to minimize the cost of all of these steps particularly seeks and rotation 12

Performance via disk layout OS may increase file block size in order to reduce seeking Upside of larger blocks? Downside? OS may seek to co-locate related items in order to reduce seeking blocks of the same file data and metadata for a file 13

Performance via caching, pre-fetching Keep data or metadata in memory to reduce physical disk access problem? Fetch blocks into memory before requested, if you can make a good guess On-disk buffer may store adjacent data not explicitly requested 14

Performance via disk scheduling Seeks are very expensive, so the OS attempts to schedule disk requests that are queued waiting for the disk FCFS (do nothing) reasonable when load is low long waiting time for long request queues SSTF (shortest seek time first) minimize arm movement (seek time), maximize request rate unfairly favors middle blocks SCAN (elevator algorithm) service requests in one direction until done, then reverse skews wait times non-uniformly (why?) C-SCAN like scan, but only go in one direction uniform wait times 15

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 16

Interacting with disks Modern disks are more convenient, making them even more complicated not all sectors are the same speed 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 17

Seagate Barracuda 3.5 disk drive 1Terabyte of storage (1000 GB) $100 4 platters, 8 disk heads 63 sectors (512 bytes) per track 16,383 cylinders (tracks) 164 Gbits / inch-squared (!) 7200 RPM 300 MB/second transfer 9 ms avg. seek, 4.5 ms avg. rotational latency 1 ms track-to-track seek 32 MB cache 18

It s about capacity 19

HDD Capacity Projections 20

Solid state drives: disruption HDDs are based on spinning magnetic platters mechanics of drives determine performance characteristics sector addressable, not byte addressable capacity improving exponentially sequential bandwidth improving reasonably random access latency improving very slowly cost dictated by massive economies of scale, and many decades of commercial development and optimization 21

Solid state drives are based on NAND flash memory no moving parts; performance characteristics driven by electronics and physics more like RAM than spinning disk relative technological newcomer, so costs are still quite high in comparison to hard drives, but dropping fast 22

SSD performance: reads Reads unit of read is a page, typically 4KB large today s SSD can typically handle 10,000 100,000 reads/s 0.01 0.1 ms read latency (50-1000x better than disk seeks) 40-400 MB/s read throughput (1-3x better than disk seq. thpt) 23

SSD performance: writes Writes flash media must be erased before it can be written to unit of erase is a block, typically 64-256 pages long usually takes 1-2ms to erase a block blocks can only be erased a certain number of times before they become unusable typically 10,000 1,000,000 times unit of write is a page writing a page can be 2-10x slower than reading a page Writing to an SSD is complicated random write to existing block: read block, erase block, write back modified block leads to hard-drive like performance (300 random writes / s) sequential writes to erased blocks: fast! SSD-read like performance (100-200 MB/s) 24

SSDs: dealing with erases, writes Lots of higher-level strategies can help hide the warts of an SSD many of these work by virtualizing pages and blocks on the drive (i.e., exposing logical pages, not physical pages, to the rest of the computer) wear-leveling: when writing, try to spread erases out evenly across physical blocks of of the SSD Intel promises 100GB/day x 5 years for its SSD drives log-structured filesystems: convert random writes within a filesystem to log appends on the SSD (more later) build drives out of arrays of SSDs, add lots of cache 25

SSD cost Capacity today, flash SSD costs ~$.40/GB (down from $250 three years ago) 1TB drive costs around $400 1TB hard drive costs around $100 Data on cost trends is a little sketchy and preliminary Energy SSD is typically more energy efficient than a hard drive 1-2 watts to power an SSD ~10 watts to power a high performance hard drive (can also buy a 1 watt lower-performance drive) 26

27

HDD vs SSD: IOPS 16MB: one file; 4K: random blocks, 4K-64Thrd: 4K random reads issued 64 at a time to device; From http://www.thessdreview.com/featured/ssd-throughput-latency-iopsexplained/2/ 28

HDD vs SSD: Throughput and latency From http://www.thessdreview.com/featured/ssd-throughput-latency-iopsexplained/2/ 29