i/o management and disk scheduling. i/o hardware incredible variety of i/o devices common concepts...

20
I/O Management and Disk Scheduling

Upload: rosamund-palmer

Post on 17-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

I/O Management and Disk Scheduling

Page 2: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

I/O HardwareIncredible variety of I/O devicesCommon concepts

Port (a connection point)Bus (daisy chain or shared direct access)Controller (host adapter)

I/O instructions control devicesDevices have addresses, used by

Direct I/O instructionsMemory-mapped I/O

Page 3: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Computer Structure

Page 4: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Life Cycle of an I/O Request

Page 5: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

I/O System ArchitectureDevices controllers connect to the bus

and represent the devices

Device drivers talk to device controllersand through them to the devices

Device drivers present a common interface to the rest of the OS

Page 6: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared
Page 7: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Device Driver InterfaceOpen(int deviceNumber): controllers can

control more than one deviceClose(int deviceNumber)Read(int deviceNumber, int deviceAddress,

void * memoryAddress, int length)Write(int deviceNumber, int deviceAddress,

void * memoryAddress, int length)

Page 8: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Disk Structure

Page 9: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Disk performance Parameters

Seek time is the reason for differences in performanceMinimize seek timeSeek time seek distance

Page 10: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Disk Scheduling

Page 11: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

First Come First Serve (FCFS)

Page 12: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Shortest-Seek-Time-First (SSTF)

Page 13: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

SCAN SchedulingDirectional bit

Indicates if arm moving toward/away from disk center

Algorithm moves arm methodicallyFrom outer to inner track, services every

request in its pathIf reaches innermost track, reverses direction

and moves toward outer tracksServices every request in its path

Sometimes called the elevator algorithm.

Page 14: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

SCAN Scheduling

Page 15: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

C-SCAN SchedulingProvides 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.

Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.

Page 16: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

C-SCAN Scheduling

Page 17: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

C-Look SchedulingVersion of C-SCANArm only goes 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.

Page 18: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

C-Look Scheduling

Page 19: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Selecting a Disk Scheduling AlgorithmBest strategy

FCFS best with light loadsService time unacceptably long under high

loads SSTF best with moderate loads

Localization problem under heavy loads SCAN best with light to moderate loads

Eliminates indefinite postponement Throughput and mean service times SSTF similarities

C-SCAN best with moderate to heavy loads Very small service time variances

Page 20: I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared

Summary of Disk Scheduling Algorithms