##### total head movement (Disk Scheduling)

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 .

Sourav Mishra
12 Jun 2016 07:27 pm

Consider the arrangement of cylinders in the given manner :

0              ...             10     11      38      47     63      87       92      121      191              ...              199

The header is initially at cylinder 63 and moving towards higher cylinder numbers hence it is pretty much clear that the head movement is towards right.

1. 63 to 87                                                (87-63) = 24

2. 87 to 92                                                (92-87) = 5

3. 92 to 121                                              (121-92) = 29

4. 121 to 191                                            (191-121) = 70

5. 191 to 10                                              (191-10) = 181

6. 10 to 11                                                 (11-10) = 1

7. 11 to 38                                                 (38-11) = 27

8. 38 to 47                                                 (47- 38) = 9

Now, adding all the moves we get (24+5+29+70+181+1+27+9) = 346

shivanisrivarshini
12 Jun 2016 02:22 pm

C-Look means we move to the nearest end na i.e we need to moe from 63 to 47 na why u choose right side

Sourav Mishra
12 Jun 2016 02:24 pm

it is specifically mentioned in the question that the header is moving from 63 towards higher no. cylinders which is towards right.

shivanisrivarshini
12 Jun 2016 02:44 pm

should me consider the long jump time in C-Look ??

Sourav Mishra
12 Jun 2016 02:57 pm

I dont know what long jump means but if you mean that should we consider the head movement from two extreme servicing ends then definitely we must take that into account.

shivanisrivarshini
12 Jun 2016 03:09 pm

http://www.cs.iit.edu/~cs561/cs450/disksched/disksched.html

Here it doesn't consider the head movement between 2 extrems

Sourav Mishra
12 Jun 2016 03:18 pm

check the answer key provided by IISc.

Look for Q.48 here.

http://www.gate.iisc.ernet.in/GATE2016_ans_keys_final/CS-1_AnsKey.pdf

shivanisrivarshini
12 Jun 2016 03:38 pm

So it is necessary to consider the head movement between 2 extrems

Sourav Mishra
12 Jun 2016 03:42 pm

yes, IISc. has made it clear :)

Mohit Lalwani
22 Jun 2016 02:24 pm