Beruflich Dokumente
Kultur Dokumente
Disk-scheduling Disciplines
Overview
Disk-scheduling Disciplines(1)
Disk-scheduling Disciplines(2)
SCAN
Adopts an elevator algorithm. It takes the closest request in the direction of travel. Worst case: if a disk is heavily loaded with requests, a new request at a location that has been just recently scanned can wait for almost two full scans of the disk
Disk-scheduling Disciplines(3)
Disk-scheduling Disciplines(4)
LOOK
Similar to SCAN The difference is that LOOK uses information about the requests to change the direction of the head when it knows that there are no requests beyond the current point improves both the throughput and the response time
Disk-scheduling Disciplines(5)
None of the disk-scheduling disciplines, except FCFS, is truly fair (starvation may occur).
a. Explain why this assertion is true.
Exercise 12.1
New requests for the track over which the head is currently resides can arrive as quickly as these requests are being serviced. For example,
In SSTF, some process may have to wait a long time until it's request(s) are satisfied if new requests with shorter seek time keep arriving. In SCAN, new arrived requests may be closer to the current head (in the right direction), hence an old request may be kept waiting.
Answer 12.1.a
Exercise 12.1.b
All requests older than some predetermined age could be forced to the top of the queue An associated bit for each could be set to indicate that no new request could be moved ahead of these requests
Answer 12.1.b
Exercise 12.1.c
Answer 12.1.c
Give three or more examples of circumstances in which it is important that the operating system be unfair in serving I/O requests.
Exercise 12.1.d
Kernel-initiated I/O take precedence over user requests. If the kernel supports real-time process priorities, the I/O requests for those processes should be favored. Paging and swapping should take priority over user requests.
Answer 12.1.d
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 cylinder 125. The queue 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
Exercise 12.2
0
125 143 86 1470 913 1774 948 1509 1022 1750 130
1800
To cylinder 86
Seek Time 57
86
1470 913 1774
1470
913 1774 948
1384
557 861 826
948
1509 1022 1750 Total Seek Time
1509
1022 1750 130
561
487 728 1620 7081
0
125 143
1800
86
130 913
948
1022 1470 1509 1750 1774
0
125 143
1800
c. SCAN
0
125 143
1800
130 86
d. LOOK
0
125 143
1800
e. Circular SCAN
0
125 143
1800
86 130
f. Circular LOOK