OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

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

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

Disk Scheduling. Based on the slides supporting the text

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

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

Chapter 14: Mass-Storage Systems. Disk Structure

Overview of Mass Storage Structure

Module 13: Secondary-Storage Structure

CS420: Operating Systems. Mass Storage Structure

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

Free Space Management

Disc Allocation and Disc Arm Scheduling?

EIDE, ATA, SATA, USB,

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

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

Mass-Storage Structure

CS3600 SYSTEMS AND NETWORKS

Chapter 10: Mass-Storage 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

UNIT 4 Device Management

Chapter 10: Mass-Storage Systems

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

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

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

Lecture 9. I/O Management and Disk Scheduling Algorithms

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

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

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

I/O Systems and Storage Devices

V. Mass Storage Systems

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

Principles of Operating Systems CS 446/646

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

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

Module 13: Secondary-Storage

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

Chapter 14: Mass-Storage Systems

Disk Scheduling COMPSCI 386

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

Chapter 11 I/O Management and Disk Scheduling

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 Peter Pietzuch

Operating Systems 2010/2011

Silberschatz, et al. Topics based on Chapter 13

Chapter 10: Mass-Storage Systems

Chapter 12: Mass-Storage

Chapter 12: Mass-Storage

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

Mass-Storage Structure

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

CSE506: Operating Systems CSE 506: Operating Systems

Access time based on initial head position in disk scheduling

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

CSE 153 Design of Operating Systems Fall 2018

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

Mass-Storage Systems

Chapter 11. I/O Management and Disk Scheduling

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

Chapter 12: Mass-Storage

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

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

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

Bus Architecture Example

STORING DATA: DISK AND FILES

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

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

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

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

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Secondary Storage Management Rab Nawaz Jadoon

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

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

Hard Disk Drives (HDDs)

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

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

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

CSE 451: Operating Systems Spring Module 12 Secondary Storage

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

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

CS370 Operating Systems

Chapter 5: Input Output Management. Slides by: Ms. Shree Jaswal

UNIT 2 Data Center Environment

MODULE 4. FILE SYSTEM AND SECONDARY STORAGE

Tape pictures. CSE 30341: Operating Systems Principles

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

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

CSE 153 Design of Operating Systems

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

I/O Management and Disk Scheduling. Chapter 11

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

CSL373: Lecture 6 CPU Scheduling

A Disk Head Scheduling Simulator

Chapter 14: Mass-Storage Systems

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

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?

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

MASS-STORAGE STRUCTURE

CS370 Operating Systems

Outline. Operating Systems: Devices and I/O p. 1/18

Transcription:

OPERATING SYSTEMS CS3502 Spring 2018 Input/Output System Chapter 9

Input/Output System Major objectives: An application s I/O requests are sent to the I/O device. Take whatever response comes back from the device and send it to the application. Optimize the performance of processing the various I/O requests.

General I/O Issues The operating system is able to improve overall system performance if it can keep the various devices as busy as possible. It is important for the operating system to handle device interrupts as quickly as possible.

Disk Drive Mechanism

Disk Structure Disk drives are addressed as large 1- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer. The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially. Sector 0 is the first sector of the first track on the outermost cylinder. Mapping proceeds in order through that track, then the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost.

Direct Access Storage Devices Otherwise known as DASDs Devices that can directly read or write to a specific place on a disk or drum Also known as random access storage devices Grouped into two major categories fixed read/write heads movable read/write heads

Fixed-Head Drums Developed in the early 1950s access times of 5 to 25 ms were considered fast used a drum with a capacity of 2000 bytes later increased to 4000 bytes speed was 200 rpm much faster than other drums of the time which were only 50-60 rpm By 1970 drums increased to 1 megabyte and speed of 3000 rpm

Fixed-Head Drums The device is formatted so tracks run around it Data recorded serially on each track by the read/write head positioned over it These drums were quite fast, yet expensive and did store as much as other DASDs.

Fixed-Head Disks Disks resemble phonograph record albums covered with magnetic film that has been formatted into concentric circles called tracks Data is recorded in the same manner as fixed-head drum These were very expensive and had less storage space as compared to movablehead disks but were faster.

Movable-Head Drums Consist of a few read/write heads that move from track to track to cover the entire surface of the drum Device that is least expensive has only one read/write head for the whole drum Drums with several read/write heads work faster but also cost more

Movable-Head Disks The read/write head floats over the surface of the disk Exist as individual units, as in a PC Can also be in a disk pack, which is a stack of disks

Disk Pack A typical disk pack consists of several platters that are stacked on a common central spindle, with a slight space between them so the read/write heads can move between the pairs of disks.

Architecture of M-Head Disks Each platter has two surfaces for recording, except the top and bottom Each surface is formatted with specific numbers of tracks for the data to be recorded on number of tracks varies depending on the manufacturer usually range from 200 to 800 tracks

Disk Structure and Organization Moving-head disk - one head per surface Fixed-head disk - one head per track Data on a disk is addressed by: Cylinder Surface Sector

Timings in a Disk Request The disk request timing is the sum of: Seek time - arm positioning delay Latency time - rotational delay Data transfer time

Read/Write To read or write data, disk device must move the arm to the appropriate track. The time to carry this out this is called Seek Time. Then, the disk device must wait for the desired sector/data to rotate into position under the head (rotational latency). Each track is recorded in units called sectors. A sector is the smallest amount of data that can be physically read or written.

Disk Track Format

Disk Access Time The disk access time can be calculated as follows: Disk Access time = Seek time + Rotational Latency

I/O Requests In general, there may be many I/O requests sent to an I/O device at the same time. These requests may come from multiple processes or the same process.

Stages of an I/O Request

I/O Device Handling A Queue of Pending Requests A Resource Scheduler that determines the next request to execute A Mechanism to initiate the next request whenever a request completes.

I/O Request Queueing

I/O Performance Optimization I/O processing is much slower than CPU processing. Every physical disk I/O has a dramatic impact on system performance To improve I/O performance: Reduce the number of I/O requests Carry out buffering and/or caching I/O Scheduling

Buffering and Caching The I/O system should make the physical I/O requests as big as possible. This will reduce the number of physical I/O requests by the buffering factor used. The application's logical I/O requests should copy data to/from a large memory buffer. The physical I/O requests then transfer the entire buffer.

I/O Scheduling For most devices, a FCFS (First-Come-First- Serve) scheduling algorithm is appropriate. For example, one wants the segments of a music file to be played in sequential order. For some devices (disks especially), the order in which requests are processed is not inherently constrained by the device characteristics.

I/O Scheduling (Cont.) On a typical system, there will be pending disk I/O requests from many different Processes. The correct functioning of these processes usually does not depend on the order in which the disk I/O operations actually occur. Thus, the Resource Scheduler attempts to optimize performance for devices such as disks.

Context Switching in I/O In CPU scheduling, the context-switch time is relatively small with respect to the service time In I/O scheduling the context-switch time is relatively large with respect to the service time The time to move the R/W head between cylinders is much greater than the time it takes to read or write to a cylinder

Goal of Disk Scheduling In any disk system with a moving read/write head, the seek time between cylinders takes a significant amount of time This traveling head time should be minimized

An Analogy Traveling service person --- a technician who has to service requests from several clients in a geographical area Normally the service person spends more time driving than actually carrying out the service tasks

Purpose of Disk Scheduling Select a disk request from the queue of I/O requests Decide when to process this I/O request

Issues in Disk Scheduling Throughput - the number of disk requests that are completed in some period Fairness - some disk requests may have to wait a relatively long time before being served A totally fair system would ensure that the mean response time of the disk requests is the same for all processes

Goal of Disk Scheduling? High Throughput Fairness There is a trade-off between total system throughput and fairness

State-Dependent Behavior The current position of the read/write head (i.e., the state of the disk) affects the response time of the next request

Disk Scheduling Algorithms For moving-head disk, disk scheduling algorithms are needed to minimize seek time FCFS scheduling: first-come-first-served SSTF scheduling: shortest-seek-time-first SCAN scheduling C-SCAN scheduling: circular SCAN LOOK scheduling C-LOOK scheduling

Disk Scheduling Algorithms Several algorithms exist to schedule the servicing of disk I/O requests. Given the following disk request sequence for a disk with 100 tracks: 44, 20, 95, 4, 50, 52, 47, 61, 87, 25 Head pointer 50 (current position of R/W heads)

FCFS Scheduling FCFS scheduling service I/O requests in the order in which they arrive. It is, of course, the simplest scheduling algorithm and actually does no scheduling. It serves as a useful baseline to compare other scheduling algorithms.

FCFS Scheduling Example 44, 20, 95, 4, 50, 52, 47, 61, 87, 25

Another Example with FCFS Illustration shows total head movement of 640 cylinders.

SSTF Selects the request with the minimum seek time from the current head position. SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests. Illustration shows total head movement of 152 cylinders (or tracks).

SSTF Scheduling Example 44, 20, 95, 4, 50, 52, 47, 61, 87, 25

Another Example with SSTF

SCAN The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues. Sometimes called the elevator algorithm. Illustration shows total head movement of 136 cylinders.

Example with SCAN Scheduling

Another Example with SCAN

C-SCAN A variant of SCAN Provides a more uniform wait time than SCAN. The head moves from one end of the disk to the other. servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip.

Example with C-SCAN

C-LOOK Variant of C-SCAN Disk arm only travels as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk.