• No results found

File Allocation Methods Performance over Disk scheduling algorithms

N/A
N/A
Protected

Academic year: 2020

Share "File Allocation Methods Performance over Disk scheduling algorithms"

Copied!
12
0
0

Loading.... (view fulltext now)

Full text

(1)

Volume 1, Issue 4, December 2012

Page 109

ABSTRACT

Files are the most obvious objects in the operating systems manipulate. Everything is typically stored in files: programs, data, output, and so on. One problem in the file management is how to allocate space for files so that disk space is utilized effectively and files can be accessed quickly. Three major methods of allocating disk space are contiguous, linked and indexed. Each method has its advantages and disadvantages.

Disk subsystem performance can be dramatically im-proved by dynamically ordering, or scheduling, pending re-quests. Via strongly validated simulation, we examine the impact of complex logical-to-physical mappings and large prefetching caches on scheduling electiveness. Hard disks are being used to store huge information/data in all modem computers. Disk drives must provide faster access time in order to optimize speed of I/O operations. This paper describes development of a simulator which uses four disk scheduling algorithms (FCFS, SSTF, LOOK for both upward and downward direction, and C-LOOK) to measure their performance in terms of total head movement.

As well as a new algorithm SPFF. SPFF keeps the advantage of SCAN and, at the same time, absorbs the strength of SSTF. The algorithm SPFF not only shows the more superiority than other scheduling polices, but also has higher adjustability to meet the computer system’s different demands. [3]

In multitasking system with many processes, disk performance can be improved by incorporating a scheduling algorithm. There are two objectives for any disk scheduling algorithm:

1. Minimize the throughput - the average number of requests satisfied per time unit.

2. Maximize the response time - the average time that a request must wait before it is satisfied. Keywords: SPFF, Disk scheduling, File Allocation Methods

1.

INTRODUCTION

A hard drive is a collection of plates called platters. Both sides of each platter are covered with some kind of a magnetization medium that allows ones and zeros to be stored. Each surface is divided into circles called tracks. Furthermore, each track is divided into smaller pieces called sectors. Disk I/O is done sector by sector. A group of tracks that are positioned on top of each other is called a cylinder. There is a head connected to an arm for each surface, which handles all I/O operations. Usually, all arms are attached to each other so the heads are always in the same cylinder. For each I/O request, first, a head must be selected. This is done electronically, and the time it takes is not significant. Then the head is moved over the destination track. After that, the disk is rotated to position the desired sector under the head. Finally, the I/O operation is performed. Arm movements and disk rotations are where the delay occurs. There are two objectives for any disk scheduling algorithm: 1. Minimize the throughput - the average number of requests satisfied per time unit. 2. Maximize the response time - the average time that a request must wait before it is satisfied.

Whenever a process needs I/O to or from the disk, it issues a system call to the operating system. This request specifies several pieces of information:

(1) Type of I/O operation,

(2) Address of disk (drive, cylinder, surface, block), (3) Address of memory, and

(4) Amount of information is to be transferred

The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk bandwidth.

1.Access time has two major components

Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector. 2.Rotational latency is the additional time waitin for the disk to rotate the desired sector to the disk head. Minimize seek time Seek time  seek distance

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

File Allocation Methods Performance over

Disk scheduling algorithms

Miss.Archana Wamanrao Bhade1, Miss.Seema R.Wankhade2 (Corresponding author)

1, 2

Assistant Professor Department of Information Technology,

Government College of Engineering, Amravati, India

(2)

Volume 1, Issue 4, December 2012

Page 110

Different algorithms such as FCFS, SSTF, LOOK and CLOOK are used for selecting request for servicing from the queue of requests. We illustrate them with a request queue (0-199).

98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53.

FCFS

First-Come, First-Served (FCFS)is the simplest form of disk scheduling. This algorithm is easy to implement using FIFO queue.

Figure 1:-FCFS Illustration shows total head movement of 640 cylinders.

SSTF

Selects the request with the minimum seek time from the current head position. SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests.

Figure 2:- SSTF Illustration shows total head movement of 236 cylinders.

SCAN

The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues. Sometimes called the elevator algorithm. .

Figure 3:-SCAN Illustration shows total head movement of 208 cylinders

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. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip.

(3)

Volume 1, Issue 4, December 2012

Page 111

Figure 4:- C-SCAN

C-LOOK

Version of C-SCAN-Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk.

Figure 5:- C-LOOK

SPFF (Shortest path first -fit first)

This algorithm is based on the shortest path of disk head motion constructed by all the pendent requests. From view of the head-moving distance, it has the stronger globosity than SSTF. From view of the head-moving direction, it has the better flexibility than SCAN. Therefore, SPFF keeps the advantage of SCAN and, at the same time, absorbs the strength of SSTF. The algorithm SPFF not only shows the more superiority than other scheduling polices, but also has higher adjustability to meet the computer system’s different demands. [3]

2.

SOFTWARE DEVELOPMENT

A simulator has been developed in JAVA language for disk scheduling algorithms which contains six major modules (i.e. FCFS, SSTF, SCAN,C-SCAN,LOOK and C-LOOK) and one new algorithm SPFF. This simulator runs each and presents results based upon service requests and number of tracks involved in the given test sample. Tracks requests are read by the program from the relevant file. Algorithm automatically offers reordered list of the read requests and a queue is displayed to service the requests. When all requests are serviced, then the result in the form of total head movement is displayed. After this the graph is shown on screen to check performance of each disk scheduling algorithm. Each module can be run to get new data of requests from the keyboard. The problem of disk scheduling on a single disk is studied from the viewpoint of the characteristics peculiar to the program functions that need guaranteed service. It is shown that a conventional disk scheduler possesses an upper bound to disk utilization which may be as low as 70 percent for large task sets. It is also shown that full disk utilization can be achieved by dynamically assigning processes on the basis of seek time.

3.

IMPLEMENTATION AND TESTING

(4)

Volume 1, Issue 4, December 2012

Page 112

Figure 2.1 shows the flowchart of the system. It will help to how to use the system. Initially start the system then select the process.

3.1 Input Parameters:

No. of request 5

No. of request 5

Tracks:-12, 85, 40, 100, 75

File Allocation Method used:-Linked / Indexed

Table 3.1 Sample request and the input parameters.

3.2 Output parameters

3.2.1Total tracks traversed (Non contiguous-static request)

Service d request

Pending request

Selecte d request

See k tim e

Head positio n 1 1,2,3,4,

5

1 5

3

65

2 2,3,4,5 2 7

3

12

3 3,4,5 3 4

5

85

4 4,5 4 6

0

40

5 5 5 2

5

(5)

Volume 1, Issue 4, December 2012

Page 113

3.2.2 Total seek time (Non contiguous-static request)

S N

Tota l track s

Algorith m

Initial Head Positio n

Head Movem ent Directio n

Total tracks traver sed

Ave. Seek length

Seek Time (Linked )

Seek Time Indexed

1 5 FCFS 65 NA 256 51 1290 1290

2 5 SSTF 65 NA 123 24 625 625

3 5 SCAN 65 Toward s 0

165 33 835 835

4 5 C-SCAN 65 Upward 165 33 835 835

5 5 LOOK 65 NA 123 24 625 625

6 5 C-LOOK 65 NA 151 30 765 765

3.3 Input Parameter No.of request 8 Tracks:- 8,9,10,11,12,13,14,15

File Allocation Method used:-Contiguous

TABLE 3.2Sample request and the input parameters.

3.3.1 Total tracks traversed (Contiguous Allocation)

Algorit hm/ Track

reques t

FCFS SSTF SCAN

C-SCAN

LOOK

C-LOOK

P1 53 10 50 50 10 53

P2 73 10 15 15 10 28

P3 45 15 25 25 15 35

P4 60 60 35 35 60 10

P5 25 28 28 28 28 15

Total 256 123 165 165 123 151

S. N.

Pending request

Selected request

Seek time Head position

1 1,2,3,4,5,6,7

,8

1 45 53

2 2,3,4,5,6,7,8 2 1 61

3 3,4,5,6,7,8 3 1 62

4 4,5,6,7,8 4 1 63

5 5,6,7,8 5 1 64

6 6,7,8 6 1 65

7 7,8 7 1 66

(6)

Volume 1, Issue 4, December 2012

Page 114

3.3.2 Total seek time (Contiguous Allocation)

S . N To tal tra ck s Al gor ith m Initial Head Positio n Head Movem ent Directio n Total tracks traverse d Av e. Se ek len Seek Time Contig uous

1 8 FC

FS

53 NA 52 6 260

2 8 SS

TF

53 NA 45 5 225

3 8 SC

A

53 Toward

s 0

53 6 265

4 8 LO

O

53 U/WAR

D

45 5 225

5 8

C-LO

53 NA 52 6 260

6 8

C-SC

53 NA 68 8 340

3.4SPFFScheduling Sample 1:--

Input Parameter-Dynamic request No. of request:-7

Tracks:- 183,37,122,14,124,65,67

File Allocation Method used:- Linked/Indexed

TABLE 3.3 Sample request and the input parameters

Alg orit hm De tai ls

Serviced Request Tot

al See k Tim e 1st requ est 2nd requ est 3rd requ est 4th reque st 5th reques t 6th reque st 7th requ est FCF S

PR 1,2, 3

2,3, 4

3,4, 5

4,5,6 5,6,7 6,7, 7 595

HP 98 183 37 122 14 124 65

SR 1 2 3 4 5 6 7

ST 85 146 85 108 110 59 2

SST F

PR 1,2 1,3 1,4 4,5 4,6 6,7 7 429

HP 98 37 183 124 14 65 67

SR 2 3 1 5 4 6 7

Algo/ Track reques t FCF S SST F SCA N C-SCAN

LOOK

C-LOO K

P1 45 38 38 53 38 45

P2 1 1 1 8 1 1

P3 1 1 1 1 1 1

P4 1 1 1 1 1 1

P5 1 1 1 1 1 1

P6 1 1 1 1 1 1

P7 1 1 1 1 1 1

P8 1 1 8 1 1 1

(7)

Volume 1, Issue 4, December 2012

Page 115

ST 61 61 85 110 59 51 2

SC AN

PR 1,2 1,3 1,4 4,5 4,6 6,7, 7 531

HP 98 37 183 124 14 65 67

SR 2 3 1 5 4 6 7

ST 61 159 61 59 59 51 81

C-SC AN

PR 1,2 2,3 3,4 4,5 4,6 6,7 7 583

HP 98 183 37 122 124 14 65

SR 1 2 3 5 4 6 7

ST 85 220 85 2 138 51 2

LO OK

PR 1,2 2,3, 2,4 4,5 5,6, 6,7 7 364

HP 98 183 122 37 14 65 67

SR 1 3 2 4 6 7 5

ST 85 61 85 23 51 2 57

C-LO OK

PR 1,2 2,3 3,4 4,5 4,6 6,7 7 532

HP 98 183 37 122 124 14 65

SR 1 2 3 5 4 6 7

ST 85 146 85 2 110 51 2

SPF F

PR 1,2 2,3 2,4, 5

2,4,6 ,7

2,4,6, 4,6 4 258

HP 98 183 122 124 67 65 37

SR 1 3 5 7 6 2 4

ST 85 61 2 57 2 28 23

PR:-Pending request HP:-Head position SR:-Selected Request ST:-Seek Time

3.4.1Total tracks traversed

3.4.2 Total seek time

Algorit hm / Track

FCFS SSTF SC

AN C-SCAN

LO OK

C-LOO

K SPF

F

P1 85 61 61 85 85 85 85

P2 146 61 61 220 85 146 28

P3 85 85 159 85 61 85 61

P4 108 110 59 138 23 110 23

P5 110 59 59 2 57 2 2

P6 59 51 51 51 51 51 2

P7 2 2 81 2 2 2 57

(8)

Volume 1, Issue 4, December 2012

Page 116

To tal tra ck s Algor ithm Initia l Head Posit ion Head Move ment Direct ion Total track s trave rsed Av Se ek len gth Seek Time Link ed Seek Time Index ed

1 8 FCF

S

98 NA 595 85

2989 2985

2 8 SSTF 98 NA 429 61

2159 2155

3 8 SCA

N

98 Towar

ds 0

454 75

2284 2280

4 8 LOO

K

98 U/WA

RD

583 83

2929 2925

5 8

C-LOO

98 NA 364 52

1834 1830

6 8

C-SCA

98 NA 532 76

2674 2670

7 8 SPFF 98 NA 258 36

1304 1300

3.5. Observations:

3.5.1Seek Time Contiguous:-

The fig.3.1 shows the seek time required by each scheduling algorithm on contiguous file allocation method

Seek Tim e Contiguous

260

225 265 225 260

340 0 50 100 150 200 250 300 350 400

FCFS SSTF SCAN LOOK C-LOOK

C-SCAN

Seek Time Contiguous

Figure .3.1 Comparison of seek time

3.5.2 Seek Time-Non Contiguous(static request)

3.5.3 Seek Time-FCFS Scheduling

Linked 1290 625 835 835 625 765 0 500 1000 1500

FCFS SSTF SCAN C-SCAN LOOK C-LOOK Linked Indexed 1290 625 835 835 625 765 0 500 1000 1500

FCFS SSTF SCAN C-SCAN

LOOK C-LOOK

(9)

Volume 1, Issue 4, December 2012

Page 117

FAM-Comparision

0 500 1000 1500 2000 2500 3000

Seek Time Indexed

Seek Time (Linked)

Seek Time Contiguous

Algorithm

FCFS

3.5.4 Seek Time-SSTF Scheduling

FAM-COMPARISION

1170 1176

225

0 500 1000 1500

Seek Time Indexed

Seek Time (Linked)

Seek Time Contiguous

Algorithm SSTF

3.5.5 Seek Time SCAN Scheduling

1270 1276

265

0 200 400 600 800 1000 1200 1400

Seek Time Indexed

Seek Time (Linked)

Seek Time Contiguous

Algorithm

SCAN

3.5.6 Seek Time C-SCAN Scheduling

1945 1951

225

0 500 1000 1500 2000 2500

Seek Time Indexed

Seek Time (Linked)

Seek Time Contiguous

Algorithm

C-SCAN

(10)

Volume 1, Issue 4, December 2012

Page 118

1685 1691 260 0 200 400 600 800 1000 1200 1400 1600 1800 Seek Time Indexed Seek Time (Linked) Seek Time Contiguous Algorithm LOOK

3.5.8. Seek Time C-LOOK Scheduling

1835 1841 340 0 200 400 600 800 1000 1200 1400 1600 1800 2000 Seek Time Indexed Seek Time (Linked) Seek Time Contiguous Algorithm C-LOOK

3.5.9 Seek Time-Non Contiguous (Dynamic request)

2985 21552280 2925 1830 2670 1300 0 500 1000 1500 2000 2500 3000 3500

Seek Time Indexed

FCFS SSTF SCAN LOOK C-LOOK C-SCAN SPFF 2989 21592284 2929 1834 2674 1304 0 500 1000 1500 2000 2500 3000 3500

Seek Time Linked

FCFS SSTF SCAN LOOK C-LOOK C-SCAN SPFF

Input parameters and output parameters of the tracks request are found first, then select some example tracks request for execution on the different scheduling algorithms are selected. Select some scheduling policies and execute the selected request on them then observe the output parameters such as total number of tracks traversed, total seek time and file allocation method used on the particular input pattern. The following outputs and performance has been observed using scheduling policies and file allocation methods on the basis of the input parameters supplied as in example file.

For Static request as per First Come First Serve scheduling policy it is found that the Seek Time is 260, 2585, 2591 for File allocation methods Contiguous, Indexed and Linked respectively.

As per SSTF Scheduling policy it is found that the seek time is 225,1170,1176 for File allocation methods Contiguous, Indexed and Linked respectively.

As per SCAN Scheduling policy it is found that the seek time is 265, 1270, 1276 for File allocation methods Contiguous, Indexed and Linked respectively.

(11)

Volume 1, Issue 4, December 2012

Page 119

As per LOOK Scheduling policy it is found that the seek time is 260, 1685, 1691 for File allocation methods Contiguous, Indexed and Linked respectively.

As per C-LOOK Scheduling policy it is found that the seek time is 340, 1835, 1841 for File allocation methods Contiguous, Indexed and Linked respectively.

As per SPFF Scheduling policy, it is found that the seek time is 1300, 1304 using File Allocation methods Indexed and Linked

Hence it has been observed that the Contiguous File Allocation method provides better result for each Scheduling algorithm and minimized the Seek Time.

After comparing two non contiguous file allocation method, it has been observed that indexed file allocation method provides the better result than the linked file allocation method for static as well as dynamic request.

4.

RESULTS & CONCLUSION

Various test samples of size 4, 8, 16, 20, up to 50 tracks request (static requests) were used to check the performance of each and every disk scheduling policy on different file allocation methods. Initial head position for each case was different. Head movements of each algorithm have been illustrated using the test samples and figures. After comparing the workload and the File Allocation Methods used, tabulated results indicated that FCFS provides the worst performance due to presence of wild swings. FCFS goes for a lengthy seek to service a distant waiting request even though another request may have just arrived near the track where the read/write head is currently positioned. Its total head movement is 256, 515,52 tracks for samples 1, 2 and 3 respectively. In SSTF algorithm, a substantial improvement has been observed due to elimination of large swings. It reduces the head movements and provides results of 123,232,45 tracks for three test samples. LOOK algorithm works like SSTF except that it uses either upward or downward direction to choose the requests from the rearranged queue. Performance of this algorithm was 123,335,45 tracks for three test sample. Results obtained for SCAN are 165, 252,53 tracks for three test sample. Results obtained for C-SCAN are 165, 387, 68 tracks and C-LOOK are 151,335,52 tracks for three samples. The problem with the SSTF is that it provides some process to wait for long time until its request(s) are satisfied if new requests with shorter seek time keep arriving. SCAN provides better results than the SSTF and more fair than the SSTF. C-LOOK and C-SCAN are always better than the FCFS and the SSTF for heavy loads only.These results provide the best combination of disk scheduling algorithm and File system which improve the performance of disk I/O. after testing all the scheduling algorithms on each file allocation methods it is found that Contiguous File Allocation always provides better seek time for any number of request, but this allocation method is very much hypothetical for large file. Comparing two non-contiguous file allocation methods for all scheduling algorithms, it has been observed that up to load of 4 Linked File Allocation Method is better using SSTF scheduling.For load 8, 16,20 Indexed File Allocation is better using SSTF/SCAN scheduling. For load 24-50 Indexed File Allocation is better using SCAN scheduling. It has been observed that if the requests are arriving dynamically then comparing with all scheduling algorithm on Linked and Indexed File Allocation methods, LOOK and C-LOOK provides better results than other conventional scheduling algorithm. The SPFF(shortest path first-fit first)scheduling policy provides best result on both Linked and Indexed File allocation method. After comparing the results of SPFF on Linked and Indexed File Allocation Methods, it is found that SPFF provides best result on Indexed File Allocation. These results can be used to analyze the underlying file allocation method used and depending upon the File Allocation and work load the scheduling algorithm may be choose which provides the optimal result. These results are extremely useful for designing more efficient and effective disk scheduling algorithms to reduce seek time in multiprogramming environment.

REFERENCES

[1] B. L. Worthington, G. R. Ganger, Y. N. Patt, “Scheduling Algorithms for Modern Disk Drives,” In ACM Sigmetrics Conference, pp. 241-25, May, 1994.

[2] D. L. Martens and M. J. Katchabaw, “Optimizing System Performance Through Dynamic Disk Scheduling Algorithm Selection,” WSEAS Transactions On Information Science And Applications, Issue 7, Vol 3, pp. 1361-1368, July 2006.

[3] H. Ming, “A disk scheduling algorithm: SPFF,”Wuhan University Journal of Natural Sciences, Vol 10 Number 6 / November, 2005.

[4] K. W. Ng and Kai-Hau A. Yeung, Member, IEEE, “Analysis On Disk Scheduling For Special User Functions”, IEEE Transactions On Circuits And Systems For Video Technology, Vol. 9, No. 5, pp.752-765, August 1999. [5] M. Seltzer, P.Chen, J. Ousterhout, “Disk Scheduling Revisited†,” Proceedings of Usenix, Washington, D. C.,

pp.313-324, January 1990.

(12)

Volume 1, Issue 4, December 2012

Page 120

[7] M. Y. Javed and Mr. I. U. Khan, “Simulation and Performance Comparison of Four Disk Scheduling Algorithms”, Vol 2, 888379, IEEE TRANSACTIONS, ISBN: 0-7803-6355-8,TENCON, pp.10-15, 2000.

[8]S. Robbins, “A disk head scheduling simulator” ,Technical Symposium on Computer Science Education Proceedings of the 35th SIGCSE technical symposium on Computer science education Pages: 325 - 329 , 2004.

[9] S. Ökdem, D. Karaboğa “Optimal Disk Scheduling Based on Ant Colony Optimization Algorithm,” Erciyes

Üniversitesi Fen Bilimleri Enstitüsü Dergisi , ISSN 1012-2354, pp.11-19, 2006.

[10] Dhamdhere D.M., Operating Systems-A Concept based approach, Second Edition, Tata McGraw Hill, 2002. [11] Silberschatz, A. and Galvin, P.B., Operating System Concepts, 5th Edition, Addison-Wesley Publishing

Company, 1998.

[12] Tanenbaum, A.S., Modern Operating Systems, 2nd Edition, Prentice-Hall, 1996.

[13] Tanenbaum, A.S. and Woodhull, A.S., Operating Systems, 2nd Edition, Prentice-Hall, 1998.

AUTHOR

Miss. Archana W. Bhade received the B.E. and M.E. degrees in Computer science & engineering from Government College of Engineering,Amravati and PRMIT & R, Badnera in 2001 and 2009, respectively. Currently she is working as Assistant Professor in Government College of Engineering, Amravati.

Figure

Figure 1:-FCFS Illustration shows total head movement of 640 cylinders.
Figure 5 :- C-LOOK
Figure 2.1  shows the flowchart of the system. It will help to how to use the system. Initially start the system then select the process
Figure .3.1 Comparison of seek time

References

Related documents

THIS APPLICATION IS FOR COVERAGE TYPE: CLAIMS-MADE OCCURRENCE-BASED NOTICE: THE COVERAGE OF A CLAIMS-MADE POLICY IS LIMITED GENERALLY TO LIABILITY FOR ONLY THOSE CLAIMS

The resistance of many politicians to grant this right is the subject of this image, which Nast based upon the Old Testament story of the Israelite hero, Samson.. Samson

All this suggests that due to the cash benefits reform women with lower level of schooling will be more motivated to reduce market work as compared with high level.. In order to

The objective of this study is to construct a 4-dimensional police legitimacy scale, and to assess the relationship that police legitimacy and feelings of obligation to obey the

Pomegranate ellagitannins inhibit -glucosidase activity in vitro and reduce starch digestibility under simulated gastro-intestinal conditions Publisher:

Experiments conducted on CASIA NIR database and PolyU- NIRFD database indicate that ZMs as a global feature extractor, UDWT as a local feature extractor and SRDA as a

United Kingdom; Wellcome Trust Sanger Institute, Hinxton, United Kingdom; Panos Deloukas: Wellcome Trust Centre for Human Genetics, University of Oxford, Oxford, United

The results indicate that computer self-efficacy have an indirect influence on customers' intention to use OGB through the mediation of perceived ease-of-use; while, reducing