Commit 0b57381

mo khan <mo@mokhan.ca>
2021-05-03 03:34:08
answer question in assignment 3
1 parent 66b928a
Changed files (1)
doc/assignment3.md
@@ -207,6 +207,46 @@ Your answer for each question should be about 150 words. (100 marks total)
   the desired inode.
 
 1. What are the factors influencing the selection of a disk-scheduling algorithm? (8 marks)
+
+  > Given so many disk-scheduling algorithms, how do we choose the best one?
+  > SSTF is common and has a natural appeal because it increases performance over FCFS.
+  > SCAN and C-Scan perform better for systems that place a heavy load on the disk,
+  > because they are less likely to cause a starvation problem.
+  > For any particular list of requests, we can define an optimal order of retrieval, but
+  > the computation needed to find an optimal schedule may not justify the savings over SSTF or SCAN.
+  > With any scheduling algorithm, hovever, performance depends heavily on the number and types of requests.
+  > Then, all scheduling algorithms behave the same, because they have only one choice of where to move the disk head:
+  > they all behave like FCFS scheduling.
+  > Requests for disk service can be greatly influenced by the file-allocation method.
+  > A program reading a contiguously allocated file will generate several requests that are close together
+  > on the disk, resulting in greater head movement.
+  > The location of directories and index blocks is also important. Since every file must be opened to be used,
+  > and opening a file requires searching the directory structure, the directories will be access frequently.
+  > Suppose that a directory entry is on the first cylinder and a file's data re on the final cylinder.
+  > In this case, the disk head has to move the entire width of the disk. If the directory entry where on the middle
+  > cylinder, the head would have to move only one-half the width. Caching the directories and index blocks in main
+  > memory can also help to reduce disk-arm movement, particularly for read requests.
+  > Because of these complexities, the disk-scheduling algorithm should be written as a separate module of the operating
+  > system, so that it can be replaced with a different algorithm if necessary. Either SSTF or LOOK is a reasonable
+  > choice for the default algorithm.
+  > The scheduling algorithms described here consider only the seek distances.
+  > For modern disks, the rotational latency can be nearly as large as the average seek time.
+  > It is difficult for the operating system to schedule for improved rotational latency, though, because modern
+  > disks do not disclose the physical location of logical blocks. Disk manufacturers have been
+  > alleviating this problem by implementing disk-scheduling algorithms in the controller hardware built
+  > into the disk drive. If the operating system sends a batch of requests to the controller, the controller
+  > can queue them and then schedule them to improve both the seek time and the rotational latency.
+  > If I/O performance were the only consideration, the operating system would gladly turn over the responsibility
+  > of disk scheduling to the disk hard-ware. In practice, however, the operating system may have other constraints
+  > on the service order for requests. For instance, demand paging may take priority over application I/O,
+  > and writes are more urgent than reads if the cache is running out of free pages.
+  > Also, it may be desirable to guarantee the oder of a set of disk writes to make the file system robust
+  > in the face of system crashes. Consider what could happen if the operating system allocated a disk page
+  > to a file and the application wrote data into that page before the operating system had a chance to flush
+  > the file system metadata back to disk. To accommodate such requirements, an operating system may choose
+  > to do its own disk scheduling and to spoon-feed the requests to the disk controller, one by one, for some
+  > types of I/O.
+
 1. Explain the disadvantage(s) of the SSTF scheduling algorithm. (8 marks)
   The Shortest Seek Time First algorithm will choose the next cylinder to read
   from that is closest to the current head position. This ensures that the