Operating Systems Peter Pietzuch

Similar documents
OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

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

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

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

Secondary Storage Management Rab Nawaz Jadoon

CSE506: Operating Systems CSE 506: Operating Systems

Mass-Storage Structure

Disks March 15, 2010

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

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

Disks October 22 nd, 2010

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

CSE 153 Design of Operating Systems Fall 2018

Lecture 9. I/O Management and Disk Scheduling Algorithms

Disks March 26 th, 2007

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

Bus Architecture Example

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

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

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

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

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

CSL373: Lecture 6 CPU Scheduling

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

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

Disk Scheduling COMPSCI 386

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

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

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

Disk Scheduling. Based on the slides supporting the text

CS420: Operating Systems. Mass Storage Structure

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

Disc Allocation and Disc Arm Scheduling?

Input Output (IO) Management

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

CS 537 Fall 2017 Review Session

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

Silberschatz, et al. Topics based on Chapter 13

Performance Analysis of Disk Scheduling Algorithms

CSE 153 Design of Operating Systems

Overview of Mass Storage Structure

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

Free Space Management

Module 13: Secondary-Storage Structure

Mass-Storage Systems

Today: Secondary Storage! Typical Disk Parameters!

Lecture 16: Storage Devices

19 File Structure, Disk Scheduling

Department of Computer Engineering University of California at Santa Cruz. File Systems. Hai Tao

A Disk Head Scheduling Simulator

Disk Scheduling. Chapter 14 Based on the slides supporting the text and B.Ramamurthy s slides from Spring 2001

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

I/O and file systems. Dealing with device heterogeneity

Chapter 11. I/O Management and Disk Scheduling

CS3600 SYSTEMS AND NETWORKS

EIDE, ATA, SATA, USB,

Discussion Week 10. TA: Kyle Dewey. Tuesday, November 29, 11

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

Part IV I/O System Chapter 1 2: 12: Mass S torage Storage Structur Structur Fall 2010

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

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

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

Hard Disk Drives (HDDs)

CSE 451: Operating Systems Spring Module 12 Secondary Storage

Module 13: Secondary-Storage

Principles of Operating Systems CS 446/646

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

Part IV I/O System. Chapter 12: Mass Storage Structure

Chapter 10: Mass-Storage Systems

Introduction to I/O and Disk Management

Chapter 14: Mass-Storage Systems

Introduction to I/O and Disk Management

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

Chapter 10: Mass-Storage Systems

Chapter 12: Mass-Storage

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

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?

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

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

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

Chapter 14: Mass-Storage Systems. Disk Structure

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

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

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

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

I/O Systems and Storage Devices

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

Chapter 13: Mass-Storage Systems. Disk Structure

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

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

Mass Storage. 2. What are the difference between Primary storage and secondary storage devices? Primary Storage is Devices. Secondary Storage devices

Chapter 10: Mass-Storage Systems

Tape pictures. CSE 30341: Operating Systems Principles

EECS 482 Introduction to Operating Systems

Disk scheduling Disk reliability Tertiary storage Swap space management Linux swap space management

V. Mass Storage Systems

Operating Systems. Operating Systems Professor Sina Meraji U of T

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

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

MC7204 OPERATING SYSTEMS

Transcription:

Tutorial Disk Management Operating Systems 211 - Peter Pietzuch <prp@doc.ic.ac.uk> 1. A disk controller with enough memory can perform read-ahead, reading blocks on the current track into its memory before the CPU asks for them. Should it also do write-behind, i.e. report back to the CPU that a block has been written once it is stored in the disk controller s memory? Not in general. When the disk controller signals operation complete after a write to disk, the OS must be able to rely on that page staying written even in the event of an immediate crash (due e.g. to power failure). Reporting operation complete before the write to disk is finished violates this rule. A controller can do write-behind if its local memory is battery-backed for long enough and if at restart, it performs the writes that were reported completed before the crash. 2. Suppose that the current position of the disk arm is over cylinder 200. The disk request queue contains requests for sectors on the following cylinders: 400, 20, 19, 74, 899 In which order will the requests be handled under: a. the FCFS disk head scheduling policy? b. the SSTF policy? c. the SCAN policy? d. the C-SCAN policy? Briefly describe the policies and their respective trade-offs. FCFS: 400, 20, 19, 74, 899 SSTF: 74,20,19,400,899 SCAN: 400,899,74,20,19 (assuming the initial direction is up) CSCAN: 400,899,19,20,74 (assuming the initial direction is up) FCFS (first come first served) services disk requests in the order they arrive. It is simple, but it performs well only if the average queue length is close to one. SSTF (shortest seek time first) services whichever requests in the queue are closest to the current position of the disk head (it doesn t matter how ties are broken). It is only a bit more complex than FCFS, has good throughput, but tends to starve requests near the edge of the disk if the system is loaded. SCAN (the elevator algorithm) maintains a current seek direction and two queues: one for requests ahead of the disk head and those behind. It services the nearest request in the

current direction; when no such remain, it switches direction. It has almost as good throughput as SSTF and doesn t starve any process. CSCAN also maintains two queues, but when the current one becomes empty it seeks to the request closest to the farthest edge of the disk and resumes seeking in the same direction from there. It is slightly slower than SCAN but does not discriminate in favour of blocks at the middle of the disk. 2. Disk requests come in to the disk drive for tracks 10, 22, 20, 2, 40, 6, and 38, in that order. A seek takes 5 ms per track moved. In all cases, the arm is initially at track 20. How much seek time is needed for a) First-come, first served b) Shortest seek time first c) Scan scheduling (initially moving upwards) (10 + 12 + 2 + 18 + 38 + 34 + 32) = 146 tracks * 5 ms/track = 730 ms (0 + 2 + 12 + 4 + 4 + 36 + 2) * 5 ms/track = 60 tracks * 5 ms/track = 300 ms (0 + 2 + 16 + 2 + 30 + 4 + 4) * 5 ms/track = 58 tracks * 5 ms/track = 290 ms 3. Consider the following parameters describing a disk: Parameter C T S ω B Description Number of cylinders Number of tracks per cylinder (number of platters) Number of sectors per track Rotational velocity (rotations per second) Number of bytes per sector In terms of these parameters, how many bytes of data are on each disk cylinder? Suppose that you are designing a disk drive, and that you hope to reduce the expected rotational latency for requests from the disk. Which of the parameters above would you attempt to change, and in what way would you change them? Suppose you wanted to reduce the disk's data transfer time - which parameters would you attempt to change? bytes/cylinder = T * S * B to reduce rotational latency, increase the rotational velocity to reduce transfer time, increase the rotational velocity, or increase the quantity SB, which represents the number of bytes per track 4. A disk drive has C cylinders, T tracks per cylinder, S sectors per track, and B bytes per sector. The rotational velocity of the platters is ω rotations per second.

Consider s 1 and s 2, consecutive sectors on the same track of the disk. (Sector s 2 will pass under a read/write head immediately after s 1.) A read request for s 1 arrives at the disk and is serviced. Exactly d seconds (0 < d < 1/ω) after the disk completes that request, a read request for sector s 2 arrives at the disk. (There are no intervening requests.) How long will it take the disk to service the request for sector s 2? seek time = 0 transfer time = (1 / ω) (1 / s) rotational latency = 1 / ω - d Suppose that s 1 and s 2 are not laid out consecutively on the disk. Instead, there are k sectors between s 1 and s 2. Does this change your answer from part (a)? If so, for which value(s) of k will the time to service the read request for s 2 be minimized? (Only consider 0 k S - 2.) The smallest integer k such that (k / S) (1 / ω) d, i.e. k = dsω 5. A disk drive has S sectors per track and C cylinders. For simplicity, we will assume that the disk has only one, single-sided platter, i.e., the number of tracks per cylinder is one. The platter spins at ω rotations per millisecond. The following function gives the relationship between seek distance d, in cylinders, and seek time, t seek, in milliseconds: t seek = 0 d = 0 t seek = 5 + 0.05d 0 < d C The sectors are laid out and numbered sequentially, starting with the outer cylinder, as shown in the diagram below. S -2 S -1 2S-1 S 2S 1 S+1 S+2 2 3 4 Direction of rotation a) Suppose the disk read/write head is located over cylinder 10. The disk receives a request to read sector S.

seek time = 5 + 0.05 * 10 = 5.5 ms rotational latency = (1 / 2) (1 / ω) transfer time = (1 / S) (1 / ω) service time = seek time + rotational latency + transfer time b) Exactly d milliseconds after completing the request for S, the disk receives a request for sector S + 1. seek time = 5 + 0.05 * 1 = 5.05 ms rotational latency = (1 / ω) (d + t seek ) (This assumes that d + t seek 1 / ω.) transfer time = (1 / S) (1 / ω) service time = seek time + rotational latency + transfer time 6. A disk drive has T = 1000 tracks per surface and S = 10 sectors per track. The platters spin at a rate of ω = 100 rotations per second. The following function relates seek distance, d, in cylinders, to the seek time (in milliseconds): t seek = 0.1d + 5 Sectors s 1 and s 2 are consecutive sectors on the same track of cylinder 100 (s 2 will pass under the read/write head immediately after s 1 does). a) The read/write heads are initially located over cylinder zero. The disk receives a request for sector s 1. After servicing that request, it is idle for a time, and then receives a request for sector s 2. What is the sum of the expected service times for these two requests? For the first request: t seek = 0.1 * 100 + 5 = 15 ms t rot = (1/2) * 10 = 5 ms t trans = (1/10) * 10 = 1 ms t service = 21 ms For the second request: t seek = 0 t rot and t trans are the same as for the first request. This assumes that the delay between requests is unknown so that the disk is equally likely to be at any rotational position when the second request arrives.

t service = 27 ms b) The read/write heads are initially located over cylinder zero. The disk receives a single request to read sectors s 1 and s 2. t seek = 0.1 * 100 + 5 = 15 ms t rot = (1/2) * 10 = 5 ms t trans = (2/10) * 10 = 2 ms t service = 22 ms