CS 3733 Operating Systems, Fall 2004 Recitation Session 11


Week of November 15.
In this session you will do an experiment using the disk head scheduling simulator. Make sure you have completed Recitation 10 before starting this.

  1. Create a Rec11 directory and copy the files from your Rec10 directory into this one. Edit diskheadconfig and change myrun1 to myrun2 and myexp1 to myexp2.
  2. Copy myrun.run to myrun2.run and myexp.exp to myexp2.exp. Edit the lines of these files so that they refer to myrun2 and myexp2. Be sure to change all of the run line of myexp2.exp.
  3. Run the simulator by executing rundisk and make sure it is working correctly.
  4. Modify myrun2.run so that it refers to a run using one set of 200 requests with a first arrival time of 0, an interarrival time that is constant at 15.0, and a nextBlock that is uniform between 0 and 239.
    To do this:
    1. Delete the last four lines of myrun2.run.
    2. Change the interArrival line form constant 2 to constant 15.0
    3. Change the nextBlock line from 30 40 to 0 239.
    4. Change the firstArrival from 2.23 to 0.
    5. Change numBlocks from 20 to 200.
    6. Change the layout line from uniform 2 to uniform 1.
    7. Change the movement line from linear 0.5, 0.10 to linear 0.0 1.0.
  5. Remove all of the run lines from myexp2.exp except the last one. This line uses the CLOOK algorithm.
  6. Run the simulator and make sure it does one run with 200 requests.
  7. You will now experiment with the effect of bad blocks on disk performance.

    Most modern disk drives transparently map bad disk blocks to blocks on the disk reserved for that purpose. This way the disk looks as if it never has any bad blocks. Let us assume that the reserved blocks are all on cylinder 239. If the operating system requests a bad block on cylinder 20, the disk will seek to cylinder 239. The operating system will think the disk is on cylinder 20 and will use this information to determine the next block to seek. This might cause some extra disk head movement.

    We will examine how the fraction of bad blocks affects performance.

  8. Add the following two lines to myrun2.run:
    badfraction 0.0
    baddestination constant 239
    The first line says that there are no bad blocks and the second line says that all bad blocks are on cylinder 239.
  9. Run the simulator again. It should produce the same results since there are no bad blocks.
  10. Now add a second run line to myexp2.exp.
    Duplicate the run line and add the following to the end of it:
    badfraction 0.1
    This indicates that 10 percent of the block are bad, so every 10th seek will be to cylinder 239.
  11. Run the simulator again. You should find that the Seek Request Turnaround is a lot larger for the second run, the one with bad blocks.
  12. Now experiment with the fraction of bad blocks.
    Experiment with several values of the fraction between 0 and 0.1.
    As the fraction increases, does the turnaround time increase slowly
    or is there a value above which it increases rapidly?
  13. Now modify myexp2.exp so that it contains about 5 runs with the values of badfraction that you think are most instructive. Create a log file. White a short paragraph summarizing your results and put it at the end of the log file.
  14. Put the log file and the associated graphs on your web site with a link from your course web page.
  15. Make sure the TA has seen that you have done this.