External Devices and Disks

Class Activity Slides

In the videos, we examined a "typical" sequence of requests that gave us better performance for our most common scheduling algorithms.

FIFO Scheduling

Suppose that the read head starts on track 65 and the following requests are in the read/write queue:

150 16
147 14 72 83

To fulfill these requests in FIFO order requires seeking a distance of 550 tracks. Not good at all.

But a general truism of schedulers is that you can always generate some sequence of requests that makes them perform worse than another scheduler!

For most real-world schedulers, these requests are incredibly unlikely to occur in practice--but they can still happen!

Your Mission

For each of the following disk head schedulers, create a sequence of requests which causes the scheduler to perform worse (more track seeks) than another target scheduler. You may assume a disk with 30 tracks (# 0-30 inclusive)

HINT: For SSTF, you can have all the requests in the queue at the start. For SCAN/C-SCAN, you may need to have new requests come in while the disk is already performing other reads.

Make SSTF perform worse than FIFO

Make SCAN perform worse than SSTF

Make C-SCAN perform worse than SCAN

Optional:

HINT: All of these can be solved by making just 4 requests.

Possible Solutions

SSTF

Head starts at 50, sequence is 12, 44, 55, 67

FIFO does 50, 12, 44, 55, 67 for a total of 93 tracks of movement

SSTF does 50, 55, 44, 67, 100, 12, 0 for 173 tracks of movement

SCAN

Head starts at 0, initial sequence is 10, 20, 30. A request for 5 comes in when the head reaches 10.

 

SCAN does 0, 10, 20, 30, 5 for 55 tracks of movement

SSTF does 0, 10, 5, 20, 30 for 40 tracks of movement

C-SCAN

Head starts at 30, initial sequence is 10, 20, 30. A request for 11 comes in when the head reaches 10. Disk size is 30.

 

C-SCAN does 30, 20, 10, RESET-30, 11 for 39 tracks of movement

SCAN does 30, 20, 10, 11, for 21 tracks of movement

Who's Good At What?

Think back to when we were doing CPU scheduling. We rated schedulers on the following criteria:

We can rate disk head scheduling on many of the same principles!

  • Utilization - How busy are we keeping the CPU?
  • Throughput - How many jobs get completed per unit time?
  • Turnaround Time - How long does it take for a process to run, from initialization to termination?
  • Response Time - How long does it take from when a user issues a command to when they see a result?
  • Waiting Time - How long do processes sit in the ready queue?
  • Fairness/Starvation - Is it possible for some processes to monopolize the CPU?

Who's Good At What?

We can rate disk head scheduling on many of the same principles!

  • Utilization - How busy are we keeping the CPU?
  • Throughput - How many jobs get completed per unit time?
  • Turnaround Time - How long does it take for a process to run, from initialization to termination?
  • Response Time - How long does it take from when a user issues a command to when they see a result?
  • Waiting Time - How long do processes sit in the ready queue?
  • Fairness/Starvation - Is it possible for some processes to monopolize the CPU?
  • Utilization - How busy are we keeping the CPU?
  • Throughput - How many I/Os get completed per unit time?
  • Turnaround Time - How long does it take for a process to run, from initialization to termination?
  • Response Time - How long does it take from when a user requests I/O to when they see a result?
  • Waiting Time - How long do I/O requests sit in the disk queue?
  • Fairness/Starvation - Is it possible for I/O requests to monopolize the disk?

Your Mission

For each of the following characteristics, rank the four disk head schedulers we talked about from "best" to "worst". You may issue ties if you feel it is justified.
 

  • Throughput - # I/O operations completed per second
  • Fairness - Whether a particular operation can be prevented from completing by other jobs
  • Response time - Time from when I/O is submitted to when it is completed

In-Class: I/O and Stable Storage

By Kevin Song

In-Class: I/O and Stable Storage

  • 248