0% found this document useful (0 votes)
15 views26 pages

Disk Scheduling

The document discusses disk structure and the importance of disk scheduling in operating systems to manage I/O requests efficiently. It outlines various disk scheduling algorithms, including First-Come, First-Served (FCFS), Shortest Seek Time First (SSTF), SCAN, C-SCAN, and Look, detailing their advantages and disadvantages. The document emphasizes the significance of reducing seek time to enhance system performance, especially in environments with multiple processes accessing disk resources.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views26 pages

Disk Scheduling

The document discusses disk structure and the importance of disk scheduling in operating systems to manage I/O requests efficiently. It outlines various disk scheduling algorithms, including First-Come, First-Served (FCFS), Shortest Seek Time First (SSTF), SCAN, C-SCAN, and Look, detailing their advantages and disadvantages. The document emphasizes the significance of reducing seek time to enhance system performance, especially in environments with multiple processes accessing disk resources.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Disk Scheduling

VKS
Disk Structure
• A disk is a platter, made of metal or plastic with a
magnet coating on it, and in circular shape.
• It is possible to store information by recording it
magnetically on the platters.
• A conducting coil, called head, which is a
relatively small device, facilitates the data
recording on and retrieval from the disk.
• In a disk system, head rotates just above both
surfaces of each platter.
• All heads, being attached to a disk arm, move
collectively as a unit. To enable a read and write
operation, the platter rotates beneath the
stationary head.
• Data are organized on the platter in tracks, which
are in the form of concentric set of rings.
• In media using constant linear velocity, the track
densities are uniform (bits per linear inch of
track).
• The outermost zone has about 40 percent more
sectors than innermost zone.
• The rotation speed increases as the head moves
from the outer to the inner tracks to keep the
same data transfer rate. This method is also used
in CD-ROM and DVD-ROM drives.
• In these types of media, the storage capacity of
the disk is maximized by zoning application. A
zone consists of adjacent cylinders having the
same track densities (sector per track).
• There are three elements of a disk known as
cylinder, track and sector/block. Tracks have
subdivisions, called sectors. Data are
transferred to and from the disk in blocks, size
of which are typically smaller than the
capacity of the track. Block-size regions on the
disk where data are recorded, are called
sectors each having 512 bytes capacity for
most disk drives. The request locations are
defined with the physical block addresses over
these sectors.
• The amount of time required to move the
read/write head from its current position to
desired track.
or
• Seek time is the time taken for a hard disk
controller to locate a specific piece of stored data.
Other delays include transfer time (data rate) and
rotational delay (latency).
• In operating systems, seek time is very important.
Since all device requests are linked in queues, the
seek time is increased causing the system to slow
down. Disk Scheduling Algorithms are used to
reduce the total seek time of any request
• When anything is read or written to a disc drive,
the read/write head of the disc needs to move to
the right position.
• The actual physical positioning of the read/write
head of the disc is called seeking.
• The amount of time that it takes the read/write
head of the disc to to move from on part fo the
disk to another is called the seek time.
• The seek time can differ for a given disc due to
the varying distance from the start point to
where the read/write head has been instructed
to go. Because of these variables, seek time is
generally measured as an average seek time.
• Disk scheduling is done by operating systems to
schedule I/O requests arriving for disk. Disk scheduling
is also known as I/O scheduling.
• Benefits
• Disk scheduling is required to use hardware efficiently.
• Disk Scheduling is required to use File systems must be
accessed in an efficient manner, especially with hard
drives, which are the slowest part of a computer.
• As a computer deals with multiple processes over a
period of time, a list of requests to access the disk
builds up. For efficiency purposes, all requests (from all
processes) are aggregated together.
• The technique that the operating system uses to
determine which requests to satisfy first is called disk
scheduling.
• Procedure of Desk Scheduling
• IO Request issues a system call to the OS.
• If desired disk drive or controller is available,
request is served immediately.
• If it is busy then new request for service will
be placed in the queue in the pending request
Queue
• When One Request is completed the OS has to
choose which pending request to service next
1. First-Come, First-Served Disk Scheduling
• In FCFS, we process the requests in the order
as they arrive and no reordering of work
queue and no starvation where every request
is serviced.
• Doesn’t provide fastest service and horrible
performance
• Example: a disk queue with request for I/O to
block on cylinders 23, 89, 132, 42, 187
• With Disk head initially at 100.
If the request for cylinders 23 and 42 could be serviced together total head
movement could be decreased substantially.
Advantages:
• Every request gets a fair chance
• No indefinite postponement
Disadvantages:
• Does not try to optimize seek time
• May not provide the best possible service
2. Shortest Seek Time first (SSTF) Disk-Scheduling
• The shortest-seek-time-first (SSTF) disk-
scheduling algorithm moves the heads the
minimum amount it can to satisfy any pending
request. In this algorithm a disk I/O Request that
requires the least movement of the disk arm from
its current position, regardless of direction.
• Reduces Seek time compared to FCFS.
• Suffers from starvation, stay in one area of disk if
very busy.
• Switching direction is slow
• Not the most optimal
Close to 100
100- 89 =11
132-89 = 43
187-132=55
Advantages:
• Average Response Time decreases
• Throughput increases
Disadvantages:
• Overhead to calculate seek time in advance
• Can cause Starvation for a request if it has
higher seek time as compared to incoming
requests
• High variance of response time as SSTF
favours only some requests
3. SCAN Disk Scheduling
elevator algorithm
• An elevator is designed to visit floors that have
people waiting. In general, an elevator moves
from one extreme to the other (say, the top of
the building to the bottom), servicing requests
as appropriate. Sometime called elevator
algorithm.
• Reduces variance as compared to SSTF.
• If Request arrives in the queue
– Just In front of head
– Just Behind
Advantages:
• High throughput
• Low variance of response time
• Average response time

Disadvantages:
• Long waiting time for requests for locations
just visited by disk arm
4. C-SCAN Disk Scheduling
• The SCAN disk-scheduling algorithm works in
circular direction it moves inwards servicing
request until it reaches the innermost cylinder
then jump to outside cylinder of the disk
without servicing to any request.
Head Movement can be reduced if the request for cylinder 187 is
received directly after request at 23 without going to disk 0.
Advantages:
• Provides more uniform wait time compared to
SCAN
4. Look Disk Scheduling
• It is like scan algorithm but it stop moving
inwards (or outwards) when no more requests
in that direction exist.
It is Scan, Look saves going from 23 to 0 and then back.
It’s more efficient for sequence of requests.

You might also like