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 direct access) Controller (host adapter) I/O instructions control devices Devices have addresses, used by Direct I/O instructions Memory-mapped I/O
Computer Structure
Life Cycle of an I/O Request
I/O System Architecture Devices controllers connect to the bus and represent the devices Device drivers talk to device controllers and through them to the devices Device drivers present a common interface to the rest of the OS
Device Driver Interface Open(int deviceNumber): controllers can control more than one device Close(int deviceNumber) Read(int deviceNumber, int deviceAddress, void * memoryAddress, int length) Write(int deviceNumber, int deviceAddress, void * memoryAddress, int length)
Disk Structure
Disk performance Parameters Seek time is the reason for differences in performance Minimize seek time Seek time seek distance
Disk Scheduling
First Come First Serve (FCFS)
Shortest-Seek-Time-First (SSTF)
SCAN Scheduling Directional bit Indicates if arm moving toward/away from disk center Algorithm moves arm methodically From outer to inner track, services every request in its path If reaches innermost track, reverses direction and moves toward outer tracks Services every request in its path Sometimes called the elevator algorithm.
SCAN Scheduling
C-SCAN Scheduling 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. Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.
C-SCAN Scheduling
C-Look Scheduling Version of C-SCAN Arm 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.
C-Look Scheduling
Selecting a Disk Scheduling Algorithm Best strategy FCFS best with light loads Service 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
Summary of Disk Scheduling Algorithms