0% found this document useful (0 votes)
101 views

Tutorial 10 (Solutions)

The document discusses disk scheduling and provides examples to calculate seek time, data transfer rate, head movement, and power consumption for different disk scheduling algorithms like SSTF, SCAN, C-LOOK, and FCFS. It includes 10 questions related to these topics with solutions and explanations. The key details provided are disk specifications like number of cylinders, sectors per track, seek time per cylinder, scheduling algorithms, initial head position, and request sequences. Calculations are shown to determine seek time, head movement distance, data transfer rate, and power consumed.

Uploaded by

Mudit Sinha
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)
101 views

Tutorial 10 (Solutions)

The document discusses disk scheduling and provides examples to calculate seek time, data transfer rate, head movement, and power consumption for different disk scheduling algorithms like SSTF, SCAN, C-LOOK, and FCFS. It includes 10 questions related to these topics with solutions and explanations. The key details provided are disk specifications like number of cylinders, sectors per track, seek time per cylinder, scheduling algorithms, initial head position, and request sequences. Calculations are shown to determine seek time, head movement distance, data transfer rate, and power consumed.

Uploaded by

Mudit Sinha
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/ 8

Disk scheduling Tutorial

Q1. Consider a storage disk with 4 platters (numbered as 0, 1, 2 and 3), 200 cylinders
(numbered as 0, 1, … , 199), and 256 sectors per track (numbered as 0, 1, … 255). The
following 6 disk requests of the form [sector number, cylinder number, platter number] are
received by the disk controller at the same time:
[120, 72, 2], [180, 134, 1], [60, 20, 0], [212, 86, 3], [56, 116, 2], [118, 16, 1]
Currently head is positioned at sector number 100 of cylinder 80, and is moving towards
higher cylinder numbers. The average power dissipation in moving the head over 100
cylinders is 20 milliwatts and for reversing the direction of the head movement once is 15
milliwatts. Power dissipation associated with rotational latency and switching of head
between different platters is negligible.
The total power consumption in milliwatts to satisfy all of the above disk requests using the
Shortest Seek Time First disk scheduling algorithm is ______ .

Explanation: Head starts at 80.

Total Head movements in SSTF = (86-80) + (86-72) + (134-72) + (134-16) = 200


Power dissipated by 200 movements : P1 = 0.2 * 200 = 40 mW
Power dissipated in reversing head direction once = 15 mW
Number of time Head changes its direction = 3
Power dissipated in reversing head direction: P2 = 3 * 15 = 45 mW
Total power consumption (in mW) is P1 + P2 = 40 mW + 45 mW = 85 mW
So, answer is 85.
Q2. A hard disk system has the following parameters :
 Number of tracks = 500
 Number of sectors/track = 100
 Number of bytes /sector = 500
 Time taken by the head to move from one track to adjacent track = 1 ms
 Rotation speed = 600 rpm.
What is the average time taken for transferring 250 bytes from the disk ?
(A) 300.5 ms
(B) 255.5 ms
(C) 255.0 ms
(D) 300.0 ms
Solution:
Answer: (D)

Explanation: Avg. time to transfer = Avg. seek time + Avg. rotational delay + Data
transfer time
 Avg Seek Time – time taken to move from 1st track to 1sr track : 0ms, 1st to
2nd : 1ms, 2ms, 3ms,….499ms
Avg Seek time =( ∑0+1+2+3+…+499)/500 = 249.5 ms
 Avg Rotational Delay – RMP : 600 , 600 rotations in 60 sec (one Rotation =
60/600 sec = 0.1 sec) So, Avg Rotational Delay = 0.1/2= 50 ms
 Data Transfer Time: In One 1 Rotation we can read data on one track = 100 *
500 = 50,000 B data is read in one rotation. 250 bytes -> 0.1 * 250 / 50,000 =
0.5 ms
Therfore ATT = 249.5+50+0.5 = 300 ms

Q3. Suppose the following disk request sequence (track numbers) for a disk with 100 tracks
is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is
on track 50. The additional distance that will be traversed by the R/W head when the Shortest
Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm
(assuming that SCAN algorithm moves towards 100 when it starts execution) is _________
tracks
(A) 8
(B) 9
(C) 10
(D) 11
Solution:
Answer: (C)

Explanation: In Shortest seek first (SSTF), closest request to the current position of the head,
and then services that request next.
In SCAN (or Elevator) algorithm, requests are serviced only in the current direction of arm
movement until the arm reaches the edge of the disk. When this happens, the direction of the
arm reverses, and the requests that were remaining in the opposite direction are serviced, and
so on.
Given a disk with 100 tracks
And Sequence 45, 20, 90, 10, 50, 60, 80, 25, 70.
Initial position of the R/W head is on track 50.
In SSTF, requests are served as following
Next Served Distance Traveled
50 0
45 5
60 15
70 10
80 10
90 10
25 65
20 5
10 10
-----------------------------------
Total Dist = 130

If Simple SCAN is used, requests are served as following


Next Served Distance Traveled
50 0
60 10
70 10
80 10
90 10
45 65 [disk arm goes to 100, then to 45]
25 20
20 5
10 10
-----------------------------------
Total Dist = 140
Less Distance traveled in SSTF = 130 - 140 = 10
Therefore, it is not additional but it is less distance traversed by SSTF than SCAN.
Q4.
Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11,
92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number
63, moving towards larger cylinder numbers on its servicing pass. The cylinders are
numbered from 0 to 199. The total head movement (in number of cylinders) incurred while
servicing these requests is:
(A) 346
(B) 165
(C) 154
(D) 173
Answer: (A)

Explanation: The head movement would be:


63 => 87 24 movements
87 => 92 5 movements
92 => 121 29 movements
121 => 191 70 movements
191 --> 10 181 movement
10 => 11 1 movement
11 => 38 27 movements
38 => 47 9 movements
Total head movements = 346
So, option (A) is correct.

Q5. Consider a disk pack with 16 surfaces, 128 tracks per surface and 256 sectors per track.
512 bytes of data are stored in a bit serial manner in a sector. The capacity of the disk pack
and the number of bits required to specify a particular sector in the disk are respectively:
(A) 256 Mbyte, 19 bits
(B) 256 Mbyte, 28 bits
(C) 512 Mbyte, 20 bits
(D) 64 Gbyte, 28 bits
Solutions:
Answer (A)
Capacity of the disk = 16 surfaces X 128 tracks X 256 sectors X 512 bytes = 256 Mbytes.
To calculate number of bits required to access a sector, we need to know total number of
sectors. Total number of sectors = 16 surfaces X 128 tracks X 256 sectors = 2^19
So the number of bits required to access a sector is 19.

Q6. Disk requests are received by a disk drive for cylinder 5, 25, 18, 3, 39, 8 and 35 in that order.
A seek takes 5 msec per cylinder moved. How much seek time is needed to serve these requests
for following Disk Scheduling algorithm? Assume that the arm is at cylinder 20 when the last of
these requests is made with none of the requests yet served.
FCFS
SSTF
SCAN
LOOK
Q7.

Solutions:

Q8.

Q9. 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. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk
access, the request for cylinder 90 is serviced after servicing ____________ number of
requests.
(A) 1
(B) 2
(C) 3
(D) 4
Solution:
Answer: (C)

Explanation: In Shortest-Seek-First algorithm, request closest to the current position of the


disk arm and head is handled first.
In this question, the arm is currently at cylinder number 100. Now the requests come in the
queue order for cylinder numbers 30, 85, 90, 100, 105, 110, 135 and 145.
The disk will service that request first whose cylinder number is closest to its arm. Hence 1st
serviced request is for cylinder no 100 ( as the arm is itself pointing to it ), then 105, then 110,
and then the arm comes to service request for cylinder 90. Hence before servicing request for
cylinder 90, the disk would had serviced 3 requests.
Hence option C.

Q10. A fast wide SCSI-II disk drive spins at 7200 RPM, has a sector size of 512 bytes, and
holds 160 sectors per track. Estimate the sustained transfer rate of this drive
(A) 576000 Kilobytes / sec
(B) 9600 Kilobytes / sec
(C) 4800 Kilobytes / sec
(D) 19200 Kilobytes / sec
Answer: (B)

Explanation:
Number of rotations in 1 minute = 7200
In 60 seconds = 7200 rotations
In 1 second = 7200 / 60 = 120 rotations
So, in 1 second, SCSI-II disk is able to read 120 tracks.
Number of sectors in each track = 160
Size of each sector = 512 Bytes
Disk Transfer rate in 1 sec = 120 *160 *512
= 98,30,400 Bytes
In KBytes = 9830400 / 1024 = 9600 KB
Option (B) is correct.

You might also like