e. Install more main memory—Likely to improve CPU utilization as more pages can
remain resident and not require paging to or from the disks.
f. Install a faster hard disk, or multiple controllers with multiple hard disks—Also an
improvement, for as the disk bottleneck is removed by faster response and more
throughput to the disks, the CPU will get more data more quickly. g. Add prepaging to the page fetch algorithms—Again, the CPU will get more data
faster, so it will be more in use. This is only the case if the paging action is amenable
to prefetching (i.e., some of the access is sequential).
h. Increase the page size—Increasing the page size will result in fewer page faults if
data is being accessed sequentially. If data access is more or less random, more
paging action could ensue because fewer pages can be kept in memory and more
data is transferred per page fault. So this change is as likely to decrease utilization
as it is to increase it.
10.1、Is disk scheduling, other than FCFS scheduling, useful in a single-user
environment? Explain your answer.
Answer: In a single-user environment, the I/O queue usually is empty. Requests generally arrive from a single process for one block or for a sequence of consecutive blocks. In these cases, FCFS is an economical method of disk scheduling. But LOOK is nearly as easy to program and will give much better performance when multiple processes are performing concurrent I/O, such as when aWeb browser retrieves data in the background while the operating system is paging and another application is active in the foreground.
10.2.Explain why SSTF scheduling tends to favor middle cylinders over the
innermost and outermost cylinders.
The center of the disk is the location having the smallest average distance to all other tracks.Thus the disk head tends to move away from the edges of the disk.Here is another way to think of it.The current location of the head divides the cylinders into two groups.If the head is not in the center of the disk and a new request arrives,the new request is more likely to be in the group that includes the center of the disk;thus,the head is more likely to move in that direction.
10.11、Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is
86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130
Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following disk-scheduling algorithms? a. FCFS b. SSTF c. SCAN d. LOOK e. C-SCAN Answer:
a. The FCFS schedule is 143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130. The total seek distance is 7081.
b. The SSTF schedule is 143, 130, 86, 913, 948, 1022, 1470, 1509, 1750, 1774. The total seek distance is 1745.
c. The SCAN schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 4999, 130, 86. The total seek distance is 9769.
d. The LOOK schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 130, 86. The total seek distance is 3319.
e. The C-SCAN schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 4999, 86, 130. The total seek distance is 9813.
f. (Bonus.) The C-LOOK schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 86, 130. The total seek distance is 3363. 12CHAPTER File-System Implementation Practice Exercises
12.1 Consider a ?le currently consisting of 100 blocks. Assume that the ?lecontrol block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguous-allocation case, assume that there is no room to grow at the beginning but there is room to grow at the end. Also assume that the block information to be added is stored in memory. a. The block is added at the beginning. b. The block is added in the middle. c. The block is added at the end.
d. The block is removed from the beginning. e. The block is removed from the middle. f. The block is removed from the end.
Answer: The results are:
Contiguous Linked Indexed a. 201 1 1 b. 101 52 1 c. 1 3 1 d. 198 1 0 e. 98 52 0 f. 0 100 0
12.2 What problems could occur if a system allowed a ?le system to be mounted simultaneously at more than one location? Answer:
4344 Chapter 12 File-System Implementation
There would be multiple paths to the same ?le, which could confuse users or encourage mistakes (deleting a ?le with one path deletes the ?le in all the other paths).
12.3 Why must the bit map for ?le allocation be kept on mass storage, rather
than in main memory? Answer:
In case of system crash (memory failure) the free-space list would not be lost as it would be if the bit map had been stored in main memory.