DEV Community

kavyareddysureddy
kavyareddysureddy

Posted on • Updated on

DISK SCHEDULING IN OPERATING SYSTEM

DISK SCHEDULING IN OPERATING SYSTEM
Disk Planning Algorithms Disk planning is done by working frameworks to plan I/O demands arriving for the disk. Disk planning is additionally known as I/O scheduling. Disk planning is vital because: Multiple I/O demands may arrive by diverse forms and as it were one I/O ask can be served at a time by the disk controller. Thus other I/O demands have to be hold up within the holding up line and got to be scheduled. Two or more ask may be far from each other so can result in more noteworthy disk arm movement. Hard drives are one of the slowest parts of the computer framework and in this way ought to be gotten to in an proficient manner. There are numerous Disk Planning Calculations but some time recently talking about them let’s have a speedy see at a few of the imperative terms: Seek Time: Seek time is the time taken to find the disk arm to a indicated track where the information is to be studied or compose. So the disk planning calculation that gives least normal look for time is better. Rotational Idleness: 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. 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: Disk Access Time is: Disk Access Time = Seek Time + Rotational Latency + Transfer Time. Disk Response Time: Response Time is the average of time spent by a request waiting to perform its I/O operation. Average Response time is the response time of the all requests. Variance Response Time is measure of how individual request are serviced with respect to average response time. So the disk scheduling algorithm that gives minimum variance response time is better. Disk scheduling algorithms:
1.FCFS
2.SSTF
3.SCAN
4.CSCAN
5.LOOK

6.CLOOK

EXAMPLE:
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. what is the total seek time for the following: 1.FCFS 2.SSTF 3.SCAN 4.CSCAN 5.LOOK 6.CLOOK
solution:
FCFS: First come First serve
queue::30,85,90,100,105,110,135,145  ->Total seek time=(100-30)+(85-30)+(85-90)+(100-90)+(105-100)+(110-105)+(135-110)+(145-135)=70+55+5+10+5+5+25+10=185
SSTF: shortest seek time first
queue::30,85,90,100,105,110,135,145  ->Total seek time=(100-100)+(105-100)+(110-105)+(110-90)+(90-85)+(135-85)+(145-30)+(145-135)=0+5+5+20+5+50+10+115=210
SCAN:
queue::30,85,90,100,105,110,135,145  ->Total seek time=(200-100)+(200-30)=100+170=270
C-SCAN:
queue::30,85,90,100,105,110,135,145  ->Total seek time=(145-100)+(145-0)+(90-0)=45+140+90=280
LOOK:
queue::30,85,90,100,105,110,135,145  ->Total seek time=(145-100)+(145-30)=45+115=160
C-LOOK:
queue::30,85,90,100,105,110,135,145  ->Total seek time=(145-100)+(145-30)+(90-30)=45+115+60=220

Top comments (0)