Lecture 3 Page 1 CS 111 Online Disk Drives An especially important and complex form of I/O device Still the primary method of providing stable storage.

Slides:



Advertisements
Similar presentations
IT253: Computer Organization
Advertisements

Disk Storage SystemsCSCE430/830 Disk Storage Systems CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu (U. Maine) Fall,
Disk Scheduling Based on the slides supporting the text 1.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
CSE506: Operating Systems Disk Scheduling. CSE506: Operating Systems Key to Disk Performance Don’t access the disk – Whenever possible Cache contents.
OPERATING SYSTEMS CS3530 Summer 2014 OPERATING SYSTEMS CS3530 Summer 2014 Input/Output System Chapter 9.
Storage. The Memory Hierarchy fastest, but small under a microsecond, random access, perhaps 2Gb Typically magnetic disks, magneto­ optical (erasable),
Input/Output Management and Disk Scheduling
University of Pennsylvania 10/24/00CSE 3801 Disk Scheduling CSE 380 Lecture Note 11a Insup Lee.
Lecture 17 I/O Optimization. Disk Organization Tracks: concentric rings around disk surface Sectors: arc of track, minimum unit of transfer Cylinder:
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
Based on the slides supporting the text
SECTIONS 13.1 – 13.3 Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT.
Disks.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
12.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 12: Mass-Storage Systems.
Disk and I/O Management
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Physical Storage and File Organization COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
Lecture 10 Page 1 CS 111 Summer 2013 File Systems: Introduction CS 111 Operating Systems Peter Reiher.
Lecture 2 Page 1 CS 111 Summer 2015 I/O, Modularity and Virtualization CS 111 Operating System Principles Peter Reiher.
Disks and Storage Systems
CE Operating Systems Lecture 20 Disk I/O. Overview of lecture In this lecture we will look at: Disk Structure Disk Scheduling Disk Management Swap-Space.
Database Management Systems,Shri Prasad Sawant. 1 Storing Data: Disks and Files Unit 1 Mr.Prasad Sawant.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1.  Disk Structure Disk Structure  Disk Scheduling Disk Scheduling  FCFS FCFS  SSTF SSTF  SCAN SCAN  C-SCAN C-SCAN  C-LOOK C-LOOK  Selecting a.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
Chapter 14: Mass-Storage Systems Disk Structure. Disk Scheduling. RAID.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
Device Management Mark Stanovich Operating Systems COP 4610.
Disk Average Seek Time. Multi-platter Disk platter Disk read/write arm read/write head.
Chapter 9 I/O System. 2 Input/Output System I/O Major objectives are: Take an application I/O request and send it to the physical device. Then, take whatever.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
1 Lecture 16: Data Storage Wednesday, November 6, 2006.
Data Storage and Querying in Various Storage Devices.
Chapter 10: Mass-Storage Systems
Operating System (013022) Dr. H. Iwidat
Sarah Diesburg Operating Systems CS 3430
Disks and RAID.
Database Management Systems (CS 564)
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
OPERATING SYSTEMS CS 3502 Fall 2017
Secondary Storage Secondary storage typically: Characteristics:
Disk Scheduling Algorithms
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Lecture 45 Syed Mansoor Sarwar
Chapter 14 Based on the slides supporting the text
Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin
Operating Systems (CS 340 D)
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
CSE 451: Operating Systems Autumn 2003 Lecture 12 Secondary Storage
Disks and scheduling algorithms
Secondary Storage Management Brian Bershad
CSE 451: Operating Systems Winter 2003 Lecture 12 Secondary Storage
Disks and Storage Systems
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Andy Wang Operating Systems COP 4610 / CGS 5765
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

Lecture 3 Page 1 CS 111 Online Disk Drives An especially important and complex form of I/O device Still the primary method of providing stable storage – Storage meant to last beyond a single power cycle of the computer A place where physics meets computer science – Somewhat uncomfortably

Lecture 3 Page 2 CS 111 Online Some Important Disk Characteristics Disks are random access devices (mostly...) – With complex usage, performance, and scheduling Key OS services depend on disk I/O – Program loading, file I/O, paging – Disk performance drives overall performance Disk I/O operations are subject to overhead – Higher overhead means fewer operations/second – Careful scheduling can reduce overhead – Clever scheduling can improve throughput, delay

Lecture 3 Page 3 CS 111 Online Disk Drives – A Physical View

Lecture 3 Page 4 CS 111 Online Disk Drives – A Logical View cylinder (10 corresponding tracks) platter surface track sectors

Lecture 3 Page 5 CS 111 Online Disk Drive Terms Spindle – A mounted assembly of circular platters Head assembly – Read/write head per surface, all moving in unison Track – Ring of data readable by one head in one position Cylinder – Corresponding tracks on all platters Sector – Logical records written within tracks Disk address =

Lecture 3 Page 6 CS 111 Online Seek Time At any moment, the heads are over some track – All heads move together, so all over the same track on different surfaces If you want to read another track, you must move the heads The time required to do that is seek time Seek time is not constant – Amount of time to move from one track to another depends on start and destination – Usually reported as an average What if each head could move independently? What would the benefits be? What complexities are added?

Lecture 3 Page 7 CS 111 Online Rotational Delay Once you have the heads over the right track, you need to get them to the right sector The head is over only one sector at a time If it isn’t the right sector, you have to wait for the disk to rotate over that one Like seek time, not a constant – Depends on which sector you’re over – And which sector you’re looking for – Also usually reported as an average Also called latency

Lecture 3 Page 8 CS 111 Online Transfer Time Once you’re on the correct track and the head’s over the right sector, you need to transfer data You don’t read/write an entire sector at a time There is some delay associated with reading every byte in the sector All sectors are usually the same size So transfer time is usually constant

Lecture 3 Page 9 CS 111 Online Disk Drives and Controllers The disk drive is not directly connected to the bus It is connected to a disk drive controller – Special hardware designed for this task There may be several disk drives attached to the same controller – Which then multiplexes its attention between them Many disks have their controller bundled with them (e.g., SCSI disks)

Lecture 3 Page 10 CS 111 Online Typical Disk Drive Performance heads10platters5 cylinders17,000tracks/inch18,000 sectors/track400bytes/sector512 RPM7200speed196Mb/sec seek time0-15 mslatency0-8ms Time to read one 8192 byte block seekrotatetransfertotal best case0ms 333us worst case15ms8ms333us23.3ms (70X) average9ms4ms333us13.3ms (40X)

Lecture 3 Page 11 CS 111 Online Why Is This Problematic For the OS? When you go to disk, it could be fast or slow – If you go to disk a lot, that matters The OS can make choices that make it faster or slower – Deciding where to put a piece of data on disk – Deciding when to perform an I/O – Reordering multiple I/Os to minimize seek time and latency – Perhaps optimistically performing I/Os that haven’t been requested

Lecture 3 Page 12 CS 111 Online Optimizing Disk I/O Don't start I/O until disk is on-cylinder or near sector – I/O ties up the controller, locking out other operations – Other drives seek while one drive is doing I/O Minimize head motion – Do all possible reads in current cylinder before moving – Make minimum number of trips in small increments Encourage efficient data requests – Have lots of requests to choose from – Encourage cylinder locality – Encourage largest possible block sizes – All by OS design choices, not influencing programs/users Instead of optimizing a particular disk I/O, the OS can switch to another task and run that while waiting for the I/O. How much disk optimization should the OS do vs. how much alternate task scheduling? The OS can also decide where a piece of data goes on the disk to begin with, and can even move data around on disk. What possibilities does that allow us?

Lecture 3 Page 13 CS 111 Online Algorithms to Control Head Movement First come, first served – Just do them in the order they happen Shortest seek time first – Always go with the request that’s closest to the current head position – Since requests keep arriving, can cause starvation Scan/Look (AKA the Elevator Algorithm) – Service all requests in one direction, then go in the other direction – No starvation, but may take longer

Lecture 3 Page 14 CS 111 Online Head Travel With Various Algorithms Scan/Look (elevator algorithm) total head motion: 450 cylinders First Come First Served total head motion: 880 cylinders Shortest Seek First total head motion: 321 cylinders

Lecture 3 Page 15 CS 111 Online Disks as an Example of the Memory Abstraction They support the read and write operations But, unlike RAM, they are not word- addressable – You read and write sectors Also unlike RAM, they have variable delays in their operations – Not just because of queued operations, either Either the OS must expose these differences – Or work to hide them Flash memory can also provide persistent storage, with very different, but also limiting, characteristics. Writes are slower than reads, you can’t re-write without first performing a very slow erase, and you can only erase a certain number of times total. How do those characteristics change how the OS should work with flash memory vs. disks?