IJRIT International Journal of Research in Information Technology, Volume 1, Issue 7, July 2014, Pg. 414-420
International Journal of Research in Information Technology (IJRIT)
www.ijrit.com
ISSN 2001-5569
A New Approach to to Disk Scheduling Kritika Acharya M.Tech (Computer Science And Engineering) DIT University Dehradun, India
[email protected]
Abstract One of the responsibilities of the operating system is to use the hardware efficiently. For the disk drives, meeting this responsibility entails having fast access time and large disk bandwidth. Operating system improves the access time and the bandwidth by scheduling the servicing of disk I/O requests in a good order. All major Disk scheduling algorithms incorporate seek time as the only factor for disk scheduling. The second factor rotational delay is ignored by the existing algorithms. But both the factors, Seek Time and Rotational Delay to schedule the disk are considered in this paper.
Keywords: Disk Scheduling, Seek Time, Rotational Latency, Head Movement, Access Time
1. INTRODUCTION 1.1 Disk Scheduling: It is the problem of deciding which particular request for data by your computer from your hard drive(or other storage medium) should be serviced first. In other words, when several programs are trying to pull data from your hard drive at once, which one gets the data first? For the disk drive, having a fast access time and disk bandwidth is one of the major responsibility. Access time has two components: • •
Seek Time- Time for the disk arm to move the heads to the cylinder containing the desired sector. Rotational Latency- Additional time waiting for the disk to rotate the desired sector to the disk head[2].
Thus, access time is the sum of seek time and the rotational latency which is the time it takes to get into position to read or write. Once the head is in position, the read or write operation is then performed as the sector moves under the head; this is the data transfer portion of the operation; the time required for the transfer is the transfer time[1].
Fig. 1-Timing of a disk I/O transfer
Kritika Acharya ,IJRIT
414
IJRIT International Journal of Research in Information Technology, Volume 1, Issue 7, July 2014, Pg. 414-420
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. Access time and bandwidth can be improved by scheduling the servicing of disk I/O requests in a good order. Whenever a process needs I/O to or from the disk, it issues a system call to the operating system[8]. The request specifies several pieces of information: • • • •
Whether this operation is input or output. What the disk address for the transfer is. What the memory address for the transfer is. What the number of bytes to be transferred is[3].
If the desired disk drive and controller are available, the request can be serviced immediately. If the drive or controller is busy, any new requests for service will be placed on the queue of pending request for that drive. For a multiprogramming system with many processes, the disk queue may often have several pending requests. Thus when one request is completed, the operating system chooses which pending request to service next[10].
2. METHODOLOGY 2.1 Traditional Algorithms Used For Disk Scheduling: We assume that the disk head is initially located at track 100. We assume a disk with 200 tracks and that the disk request queue has random requests in it. The requested tracks, in the order received by the disk scheduler, are 55, 58, 39, 18, 90, 160, 150,38, 184. • FIFO: The simplest form of scheduling is first-in-first-out(FIFO) scheduling, which processes items from the queue in sequential order. This strategy has the advantage of being fair, because every request is honored and the requests are honored in the order received.
Fig. 2-Head movement in FIFO • SSTF: The shortest-service-time-first(SSTF) policy is to select the disk I/O request that requires the least movement of the disk arm from its current position. Thus, we always choose to incur the minimum seek time.
Fig. 3-Head movement in SSTF Kritika Acharya ,IJRIT
415
IJRIT International Journal of Research in Information Technology, Volume 1, Issue 7, July 2014, Pg. 414-420
•
SCAN:
This approach works like an elevator does, thus also known as elevator algorithm. It scans down towards the nearest end and then when it hits the bottom it scans up servicing the requests that it didn't get going down. If a request comes in after it has been scanned it will not be serviced until the process comes back down or moves back up[1].
Fig. 4-Head movement in SCAN •
LOOK:
In LOOK disk scheduling, head moves back and forth servicing requests just like SCAN algorithm. But unlike SCAN, the head doesn’t reaches to last cylinder at the end of the disk; the head will change its direction after servicing the last request in the current direction[6]. •
C-SCAN:
The C-SCAN(circular SCAN) policy restricts scanning to one direction only. Thus, when the last track has been visited in one direction, the arm is returned to the opposite end of the disk and the scan begins again. This reduces the maximum delay experienced by new requests[1].
Fig. 5-Head movement in C-SCAN • C-LOOK: This is just an enhanced version of C-SCAN. In this the scanning doesn't go past the last request in the direction that it is moving. It too jumps to the other end but not all the way to the end. Just to the furthest request[4].
Kritika Acharya ,IJRIT
416
IJRIT International Journal of Research in Information Technology, Volume 1, Issue 7, July 2014, Pg. 414-420
2.2 Comparison Table: Table1-Comparison Table
2.3 Proposed Disk Scheduling Algorithm Input•
•
Current head position. Requested cylinder position and sector position.
Output• Optimum head movement. Algorithm: (P,Q) is current head position; where P is cylinder position and Q is sector position. n is the total number of requested tracks towards the upper end from the current head position. m is the total number of requested tracks towards the lower end from the current head position. ( , ), ( , ), ( , ),…. ( , ) are requested tracks on the upper side of current head position; where , ,… are requested cylinder positions and , , … are requested sector positions. ( , ), ( , ), ( , ),…. ( , ) are requested tracks on the upper side of current head position; where
, ,… are requested cylinder positions and , , … are requested sector positions. Step 1Calculate a, b, c, d; where a=P- , b= -P, c= - and d= - Step 2Initializing variables for seek length as SL=0 and for rotational length as RL=0. Now, Kritika Acharya ,IJRIT
417
IJRIT International Journal of Research in Information Technology, Volume 1, Issue 7, July 2014, Pg. 414-420
if(a+d) <=(b+c) then { i) move head towards upper end and follow the following procedure: for(int i=1; i<=n; i++) { if(i==1) { x=P- ; y=| -Q|; SL= SL + x; RL=RL + y; } else { x= − ; y=| − |; SL=SL+x; RL=RL+y; } } ii) after serving the ( , ) request, move the head towards other end and follow the following procedure: for(int i=1; i<=m; i++) { if(i==1) { x=
− ; y=| − |; SL=SL+x; RL=RL+y; } else { x=
−
; y=| − |; SL=SL+x; RL=RL+y; } } } else { i) move head towards lower end and follow the following procedure: for(int i=1; i<=m; i++) { if(i==1) { x=
−P; y=| −Q|; SL=SL+x; RL=RL+y; } else { x=
−
; y=| − |; Kritika Acharya ,IJRIT
418
IJRIT International Journal of Research in Information Technology, Volume 1, Issue 7, July 2014, Pg. 414-420
SL=SL+x; RL=RL+y; } } ii) after serving the ( , ) request, move the head towards other end and follow the following procedure: for(int i=1;i<=n;i++) { if(i==1) { x= − ; y=| − |; SL=SL+x; RL=RL+y; } else { x= − ; y=| − |; SL=SL+x; RL=RL+y;
} } Average seek length=SL/(m+n); Average rotational length=RL/(m+n);
}
3. RESULT The designed algorithm generates the optimum head movement as compared to the conventional disk scheduling algorithms. This algorithm looks at the uncertainty associated with scheduling incorporating the two factors. Simple If-Then rules is designed to optimize the overall performance of disk drives. The main advantage of this algorithm is that it services all the requests fairly by taking in consideration both the factors and services all the requests without causing starvation.
4. CONCLUSION The algorithm uses an imprecise but very descriptive language to deal with input data more like a human operator. It is very robust and forgiving of operator and data input and often works when first implemented with little or no tuning. This algorithm provides much better results than the conventional disk scheduling algorithms. The pattern of the requests after applying the algorithm shows that the read/write head doesn’t stick to one area of disk. All the disk requests are serviced with the same perspective.
V. REFERENCES [1] W. Stallings, “Operating Systems: Internal and Design Principles,” 6 Edition, Prentice Hall, 2009. [2] Modern operating system (2nd edition) Andrew S. Tanenbaum . [3] Operating System Principles (6th edition) Abraham Silberschatz, Peter Bare Galvin, Greg Gagne. [4] M. Seltzer, P. Chen and J. Ousterhout, “Disk Scheduling Revisited,” Proceedings of the 1990 Winter Usenix, Wa- shington DC, 1990. [5] D. M. Jacobson and J. Wilkes, “Disk Scheduling Algo- rithms Based on Rotational Position,” Technical Report, 1991. Kritika Acharya ,IJRIT
419
IJRIT International Journal of Research in Information Technology, Volume 1, Issue 7, July 2014, Pg. 414-420
[6] A. Thomasian and C. Liu, “Disk Scheduling Policies with Lookahead,” ACM Sigmetrics Performance Evaluation Review, Vol. 30, No. 2, 2002, p. 33. [7] P. K. Suri and S. Mittal, “Sim_Dsc: Simulator for Opti- mizing the Performance of Disk Scheduling Algorithms,” Global Journal of Computer Science and Technology, Vol. 11, No. 18, 2011, pp. 1-6. [8] M. Hu, “Improved Disk Scheduling Algorithms Based on Rotational Position,” Journal of Shanghai University, Vol. 9, No. 5, 2005, pp. 411-414. [9] S. Saha, N. Akhter and M. A. Kashem, “A New Heuristic Disk Scheduling Algorithm,” International Journal of Scientific & Technology and Research, Vol. 2, 2013, pp. 49-53. [10]C. Ruemmler and J. Wilkes. An introduction to disk drive modeling. IEEE Computer, 27(3):17–29, March 1994.
Kritika Acharya ,IJRIT
420