Operating System-Disk Scheduling Problem

[Question source-2010 408 real question]
Assume that the computer system adopts the CSCAN (cyclic scanning) disk scheduling strategy. Use 2KB of memory space to record the idle state of 16,384 disks.

(1) Please explain how to manage the disk idle state under the above conditions.
(2) Suppose the rotation speed of a single-sided disk is 6000 revolutions per minute, each track has 100 sectors, and the average movement time between adjacent tracks is 1ms. If at a certain moment, the head is located at track 100 and moves in the increasing direction of the track number (as shown in the figure below), the track number request queue is 50, 90, 30, 120, for each track in the request queue Need to read 1 randomly distributed sector, how long does it take to read this sector point? The calculation process is required.
(3) If the disk is replaced with random-access Flash semiconductor memory (such as U disk, SSD, etc.), is there a more efficient disk scheduling strategy than CSCAN? If yes, give the name of the disk scheduling strategy and explain the reason; if not, explain the reason.

Insert picture description here
[Answer]
(1) If there is a question, only a total of 16384 disk blocks need to be managed. Because of the large number of disk blocks, it is not suitable to use the free list and free linked list methods for management, so the bitmap is used for management.

Each disk block is recorded with one bit , which requires 16384 b, that is, 16384/8 = 2048B = 2KB, which can just be recorded with the 2KB memory space given in the title.

(2)
First introduce three formulas for disk scheduling time
Insert picture description here
Insert picture description here
Insert picture description here

The time to calculate the whole process is actually to calculate the seek time, rotation delay time and data reading time separately.


Seek time The problem is that the cyclic scanning algorithm is used, so the seek order is 100->120->30->50->90, which spans 20+90+20+40 tracks in total.

So seek time = 170*1ms=170ms
(If the arm start time is not given here, it will not be calculated)

Rotation delay time
directly into the formula = 1 2 ∗ 6000 revolutions/min = 5 ms \frac{1}{2*6000 revolutions/min}=5ms2 6 0 0 0 revolutions / m i n1=5 m s
This is the calculated average rotation time for positioning to a sector, now we need to locate 4 sectors respectively,
so the total rotation delay = 4*5=20ms

Time to read data
The calculation here is not a direct substitute for the formula.

We know that the time required for a track to read one revolution is 1 6000 revolutions/min = 0.01 s = 10 ms \frac{1}{6000 revolutions/min}=0.01s=10ms6 0 0 0 revolutions / m i n1=0.01s=. 1 0 m S
are now required for each track is read randomly in a sector in one track title 100 is known sectors, the reading time of one sector of one track =10 100 MS 0.1 MS = \ {FRAC 10ms}{100}=0.1ms10010ms=0.1ms

There are a total of 4 tracks so it is 0.4 ms

So the total time added up is: 170+20+0.4=190.4

Guess you like

Origin blog.csdn.net/qq_34902437/article/details/102685717