A New Heuristic Disk Scheduling Algorithm
A New Heuristic Disk Scheduling Algorithm
ISSN 2277-8616
1. Introduction
Scheduling is a fundamental operating system function,
since almost all computer resources are scheduled before
use. The disk is of course, one of the computer resources.
For the disk drivers, meeting this responsibility entails
having fast access time and large disk bandwidth.
Processor speed and disk and memory capacity are
increasing by over 40% 40%per year. In contrast, disk
speed is increasing more gradually, growing by only 7%per
year [13]. Since this rate is unlikely to change substantially
in the near future, I/O performance may become the system
bottleneck. However, despite the difficulty of improving
mechanical components, we can still aim to use the disks
more efficiently. The access time has two major
components. For example, disks generally operate at a
small fraction of their maximum bandwidth. Researchers
have demonstrated experimentally that sophisticated disk
head scheduling algorithms can deliver higher throughput
[20, 12, 23]. This past research has focused almost
exclusively on two types of work loads : synthetic work
loads , where disk requests are randomly and uniformly
distributed across the disk, and more recently, traces,
where the requests to an actual disk are recorded and used
as a testing ground for algorithms. However, for these or for
general work loads, researchers have made little attempt to
develop algorithms with provable performance guarantees.
In addition, no one has determined the computational
complexity of the disk scheduling problem. There is a risk
that synthetic workloads and traces from a few
environments may not represent all possible situations. And
the seek time is the time for the disk arm to move the
heads to the cylinder containing the desired sector. The
disk bandwidth is the total number of bytes transferred ,
divided by the total time between the first request for
service and the completion of the last transfer.
______________________________
Sandipon Saha, Md. Nasim Akhter, Mohammod Abul
Kashem
Department of CSE, Dhaka University of Engineering
& Technology.
Department of CSE, Dhaka University of Engineering
& Technology.
Department of CSE, Dhaka University of Engineering
& Technology.
49
IJSTR2013
www.ijstr.org
INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 2, ISSUE 1, JANUARY 2013
200
ISSN 2277-8616
180
160
140
120
100
80
60
200
180
160
140
120
100
80
60
40
20
0
40
20
0
Figure:1.1
Head movement: (130-36)+ (80-36)+(120-80) +(120-10)
+(15-10) +(40-15) +(188-40)+ (188-150) +(150-120) +(168120)=582
In FCFS total head movement: 582
2. SSTF: Shortest Seek Time First-Selects the request with
the minimum seek time from the current head osition.Since
seek time increases with the number of cylinders traversed
by the head, SSTF chooses the pending request closest to
the current head position.SSTF scheduling is a form of SJF
scheduling:may cause starvation of some requests.
Concider , for example a disk queue with requests for I/O to
blocks on cylinders:
Queue(10-199): 36,180,120,10,15,40,188,150 , 168. And
head current position is :130. This schedule is diagrammed
in figur 1.2
200
180
160
140
120
100
80
60
40
20
0
Figure:1.3
Head movement:(130-120) +(120-80) +(80-40) +(40-36)
+(36-15) +(15-10) +(10-0) +(150-0) +(168-150) +(188168)=318
In SCAN total head movement: 318.
4. C-SCAN: 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. However, when it reaches of
the other end, it immediately will return to the beginning of
the disk, without servicing any requests on the return trip.
Treats the cylinders as a wraparound circular list from the
first cylinder to the last one. Concider , for example a disk
queue
with
requests
for
I/O
to
blocks
on
cylinders:Queue(10-199):36,180,120,10,15,40,188,150,
168. And head current position is :130. This schedule is
diagrammed in figur 1.4
Figure :1.2
Head Movement:(130-120) +(150-120) +(168-150) +(188168) +(188-80) +(80-40) +(40-36) +(36-15) +(15-10)=256
In SSTF total head movement: 256.
50
IJSTR2013
www.ijstr.org
INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 2, ISSUE 1, JANUARY 2013
ISSN 2277-8616
250
200
150
200
180
160
140
120
100
80
60
40
20
0
100
50
Figure:1.4
Head movement: (150-130) +(168-150) +(188-168)+(199188) +(199-0) +(10-0) +(15-10) +(36-15) +(40-36) +(80-40)
+(120-80)=388.
In C-SCAN total head movement: 388
Figure:1.6
5. C-LOOK: A version of C-SCAN. Arm goes only as far as
the last request in each direction, the reverses direction
immediately, without first going all the way to the end of the
disk. Concider , for example a disk queue with requests for
I/O
to
blocks
on
cylinders:
Queue(10-199):
36,180,120,10,15, 40,188,150 ,168. And head current
position is :130. This schedule is diagrammed in figur 1.5
200
180
160
140
120
100
80
60
40
20
0
Figure 1.5
Head movement: (150-130)+(168-150) +(188-168) +(18810) +(15-10) +(36-15) +(40-36) +(80-40) +(120-80)=346
In C-LOOK total head movement: 346
6. Look: LOOK is similar to SCAN in that the heads sweep
across the disk surface in both directions performing reads
and writes. However, unlike SCAN, which visits the
IJSTR2013
www.ijstr.org
INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 2, ISSUE 1, JANUARY 2013
ISSN 2277-8616
Rd=a[n]-Hp
Rd a[n] a[1]; Ld
Ld a[n] a[1]; Ld
Hm =
Rd
Rd
Calculation: Let ,
Queue(10-199) :36,180,120,10,15,40,188,150 , 168.
Head starts at: 130.
Ld=130-10=120
Rd=188-130=58
Here, Ld>Rd so,
Hm=58+188-10=236
Total head movement=236(For new algorithm)
}
Else
{
For i:=position to n do
{count:=count+a[i]-head;
head:=a[i];}
Count:=count+a[n]-a[position-1];
For i:=position-1 to 2 do
Count:=count+a[i]-a[i-1];
}
10. Return count; // total head movement
Graphical representation of proposed algorithm:
Concider , for example a disk queue with requests for I/O to
blocks on cylinders : Queue(10-199) :36,180,120,10,15,
40,188,150 ,168. And head current position is :130. This
schedule is diagrammed in figur 2
200
180
160
140
120
100
80
60
40
20
0
SL.NO
Name of
Algorithm
Number of head
movement
1.
FCFS
582
2.
C-SCAN
388
3.
SSTF
256
4.
C-LOOK
346
5.
LOOK
298
6.
SCAN
318
7.
NEW
Heuristic
236
600
500
Figure: 2
400
Head movement: (150-130)+(168-150) +(188-168) +(188120) +(120-80) +(80-40) +(40-36) +(36-15) +(15-10)=236
300
100
200
General Equeation :
Let ,
Left distance=Ld
Right distance =Rd
Head position=Hp
Request queue=a[]
Max queue position=n
Total Head Movement=Hm
Ld=Hp-a[1]
Figure:3
52
IJSTR2013
www.ijstr.org
INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 2, ISSUE 1, JANUARY 2013
ISSN 2277-8616
Limitations:
1. Sometime number of head movement is equal to
SSTF or LOOK scheduling.
2. When input blocks are stay in ascending order
without sorting then FCFS is best. But in dynamic
allocation of cylinder it is almost impossible.
Conclusion:
In conclusion, we have presented a new real-time disk
scheduler that imposes almost no performance penalty over
non-real-time optimal schedulers when given sufficient
slack time. We showed how to characterize a devices
performance. From the above experiment and comparison
of proposed algorithm with existing algorithm it is clear to us
that the existing algorithm reduces head movement. Who
wants to work with disk scheduling this algorithm will open
new era for them. This would help the new generation to be
go ahead.
References
[1]
[2]
[3]
Operating
Systems:
A
Approach(2E) D.M. Dhamdhere
Concept-based
[4]
[5]
[6]
[7]
[8]
[9]
53
IJSTR2013
www.ijstr.org