0% found this document useful (0 votes)
22 views9 pages

Lesson 2.4 Disk Arm Scheduling

Disk arm scheduling is a function of the operating system that manages input/output requests for disk access, ensuring efficient processing of multiple requests. Various algorithms, such as FCFS, SSTF, SCAN, CSCAN, LOOK, and CLOOK, are employed to optimize seek time, rotational latency, and overall disk access time. Effective disk scheduling reduces waiting time and improves system throughput while addressing issues like starvation and response time variance.

Uploaded by

MusaManganda
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)
22 views9 pages

Lesson 2.4 Disk Arm Scheduling

Disk arm scheduling is a function of the operating system that manages input/output requests for disk access, ensuring efficient processing of multiple requests. Various algorithms, such as FCFS, SSTF, SCAN, CSCAN, LOOK, and CLOOK, are employed to optimize seek time, rotational latency, and overall disk access time. Effective disk scheduling reduces waiting time and improves system throughput while addressing issues like starvation and response time variance.

Uploaded by

MusaManganda
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/ 9

DISK ARM SCHEDULING

One of the functions of the OS is to schedule requests for disk. The request could be a read
request to read data from disk or a write request to write to disk. These requests are called
input/output requests for disk. Multiple I/O requests for the disk can arrive, but only one
request can be served at a time. Hence, the question would be “Which request will be served
first?”. It is the responsibility of the OS to make decisions of which I/O request for the disk is
serviced first. The OS makes use of a disk scheduling algorithm to make such a decision.
These algorithms help the OS to maintain an efficient manner in which input-output requests
can be managed to execute a process. It manages a proper order to deal with sequential
requests to the disk and provide the required data. Since multiple requests are approaching
the disk, the algorithm also manages the upcoming requests of the future and does a lining up
of requests.

Importance of Disk Scheduling


In the computer system, multiple requests are coming to the disk simultaneously which will
make a queue of requests. This queue of requests will result in an increased waiting time of
requests. The requests wait until the underprocessing request executes. To overcome this
queuing and manage the timing of these requests, 'Disk Scheduling' is important in our
Operating System. Also, it may be possible that the two different requests are far from each
other. Like one request is at a spot from where the disk arm is near and the other request is on
a different spot of drive from where the disk arm is farther, here Disk scheduling algorithms
help and reduce the disk arm moment. The requests that are close to the disk arm will be
serviced quickly and for the farther request, the disk arm needs to move from its location.
"Disk Arm '' is the part of the hard disk which moves through a different part of the hard disk,
approaches requests, and serves them. Using 'Disk Scheduling', data can be accessed easily
without wasting much time.

1
Disk Scheduling Terms

❖ Seek Time: Seek time is the time taken to locate the disk arm to a specified track
where the data is to be read or written. So the disk scheduling algorithm that gives
minimum average seek time is better.
❖ Rotational Latency: Rotational Latency is the time taken by the desired sector of
disk to rotate into a position so that it can access the read/write heads. So the disk
scheduling algorithm that gives minimum rotational latency is better.
❖ Transfer Time: Transfer time is the time to transfer the data. It depends on the
rotating speed of the disk and number of bytes to be transferred
❖ Disk Access Time: It is defined as the total time taken by all the above processes.
Disk access time = (seek time + rotational latency time + transfer time)
❖ Disk Response Time: The disk processes one request at a single time. So, the other
requests wait in a queue to finish the ongoing process of request. The average of this
waiting time is called "Disk Response Time".
❖ Starvation: Starvation is defined as the situation in which a low-priority job keeps
waiting for a long time to be executed. The system keeps sending high-priority jobs to
the disk scheduler to execute first.

There are several disk scheduling algorithms. Below is a list of some of them:
❖ First Come First Serve (FCFS)
❖ Shortest Seek Time First (SSTF)
❖ SCAN
❖ CSCAN
❖ LOOK
❖ CLOOK

FCFS
The requests are addressed in the order they arrive in the disk queue. the request which comes
first will be processed first and so on. The requests coming to the disk are arranged in a

2
proper sequence as they arrive. Since every request is processed in this algorithm, there is no
chance of 'starvation'.
Example
Disk request arrive in the following order:
82,170,43,140,24,16,190 and the current position of Read/Write head is: 50. The disk has 200
tracks. Using FCFS algorithm, these requests will be serviced as shown on the diagram
below:

In the above diagram, we can see the head starts at position 50 and moves to request 82. After
serving request 82, the disk arm moves towards the second request that is 170 and then to the
request 43 and so on. In this algorithm, the disk arm will serve the requests in arriving order.
In this way, all the requests are served in arriving order until the process executes. Seek time"
is calculated by adding the head movement differences of all the requests:

Seek time= "(82-50) + (170-82) + (170-43) + (140-43) + (140-24) + (24-16) + (190-16) = 642

Advantages:

❖ Every request gets a fair chance


❖ No indefinite postponement

Disadvantages:

❖ Does not try to optimise seek time

3
❖ May not provide the best possible service

SSTF

Requests having the shortest seek time are executed first. So, the seek time of every request is
calculated in advance in the queue and then they are scheduled according to their calculated
seek time. As a result, the request near the disk arm will get executed first. SSTF is certainly
an improvement over FCFS as it decreases the average response time and increases the
throughput of the system.

Example
Order of requests:82,170,43,140,24,16,190, current read/write head position is 50, and disk
has 200 tracks.

The disk arm searches for the request which will have the least difference in head movement.
So, the least difference is (50-43). Here the difference is not about the shortest value but it is
about the shortest time the head will take to reach the nearest next request. So, after 43, the
head will be nearest to 24, and from here the head will be nearest to the request 16, After 16,
the nearest request is 82, so the disk arm will move to serve request 82 and so on.
Seek Time = (50-43) + (43-24) + (24-16) + (82-16) + (140-82) + (170-140) + (190-170) = 208

Advantages:

❖ Average Response Time decreases


❖ Throughput increases
❖ Disadvantages:

4
❖ Overhead to calculate seek time in advance
❖ Can cause Starvation for a request if it has a higher seek time as compared to
incoming requests
❖ High variance of response time as SSTF favours only some requests

SCAN

In the SCAN algorithm the disk arm moves in a particular direction and services the requests
coming in its path and after reaching the end of the disk, it reverses its direction and again
services the request arriving in its path. So, this algorithm works as an elevator and is hence
also known as an elevator algorithm. As a result, the requests at the midrange are serviced
more and those arriving behind the disk arm will have to wait.

Example:

Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the Read/Write arm


is at 50, and it is also given that the disk arm should move “towards the larger value”.

In the diagram above, we can see that the disk arm starts from position 50 and goes in a
single direction until it reaches the end of the disk, i.e, request position 199. After that, it
reverses and starts servicing in the opposite direction until it reaches the other end of the disk.

Seek time=(199-50)+(199-16) =332

Advantages:

5
● High throughput
● Low variance of response time
● Average response time

Disadvantages:

● Long waiting time for requests for locations just visited by disk arm

CSCAN

In the SCAN algorithm, the disk arm again scans the path that has been scanned, after
reversing its direction. So, it may be possible that too many requests are waiting at the other
end or there may be zero or few requests pending at the scanned area. These situations are
avoided in the CSCAN algorithm in which the disk arm instead of reversing its direction goes
to the other end of the disk and starts servicing the requests from there. So, the disk arm
moves in a circular fashion and this algorithm is also similar to the SCAN algorithm and
hence it is known as C-SCAN (Circular SCAN).

Example:
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the Read/Write arm
is at 50, and it is also given that the disk arm should move “towards the larger value”.

6
The disk arm starts from position 50 and reaches the end(199), and serves all the requests in
the path. Then it reverses the direction and moves to the other end of the disk i.e.- 0 without
serving any task in the path. After reaching 0, it will again move towards the largest
remaining value which is 43. So, the head will start from 0 and moves to request 43 serving
all the requests coming in the path. And this process keeps going.

Seek Time will be =(199-50) + (199-0) + (43-0) =391

Advantages:

❖ Provides more uniform wait time compared to SCAN


❖ Response time is good.

Disadvantages:
❖ The time taken by the disk arm to locate a spot is increased here.
❖ The head keeps going to the end of the disk.

LOOK

It is similar to the SCAN disk scheduling algorithm except for the difference that the disk
arm in spite of going to the end of the disk goes only to the last request to be serviced in front
of the head and then reverses its direction from there only. Thus it prevents the extra delay
which occurred due to unnecessary traversal to the end of the disk.

Example:
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the Read/Write arm
is at 50, and it is also given that the disk arm should move “towards the larger value”.

7
The disk arm is starting from 50 and starts to serve requests in one direction only but instead
of going to the end of the disk, it goes to the end of requests i.e.-190. Then comes back to the
last request of other ends of the disk and serves them. And again starts from here and serves
till the last request of the first.
Seek time = (190-50) + (190-16) =314

Advantages:
❖ Starvation does not occur.
❖ Since the head does not go to the end of the disk, the time is not wasted here.
Disadvantage:
❖ The arm has to be conscious to find the last request.

CLOOK

As LOOK is similar to SCAN algorithm, CLOOK is similar to CSCAN disk scheduling


algorithm. In CLOOK, the disk arm in spite of going to the end goes only to the last request
to be serviced in front of the head and then from there goes to the other end’s last request.
Thus, it also prevents the extra delay which occurred due to unnecessary traversal to the end
of the disk.

Example:
1. Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the
Read/Write arm is at 50, and it is also given that the disk arm should move
“towards the larger value”

8
The disk arm is starting from 50 and starts to serve requests in one direction only but in spite
of going to the end of the disk, it goes to the end of requests i.e.-190. Then comes back to the
last request of other ends of a disk without serving them. And again starts from the other end
of the disk and serves requests of its path.
Seek Time = (190-50) + (190-16) + (43-16) =341
Advantages:
The waiting time is decreased.
If there are no requests till the end, it reverses the head direction immediately.
Starvation does not occur.
The time taken by the disk arm to find the desired spot is less.
Disadvantage:
The arm has to be conscious about finding the last request.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy