视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
西南大学操作系统原理作业Assignment-11
2025-09-29 17:03:55 责编:小OO
文档
Assigment-11

1. 

Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request at cylinder 2,150, and the previous request was at cylinder 1,805. The queue of pending requests, in FIFO order, is:

2,069,  1,212,  2,296,  2,800,  544,  1,618,  356,  1,523,  4,965,  3681

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. C-SCAN

First-come-first-served (FCFS)

2150, 2,069, 1,212, 2,296, 2,800, 544, 1,618, 356, 1,523, 4,965, 3,681   

81+857+1084+504+2256+1074+1262+1167+3442+1284=13011 cylinder

Shortest-seek-time first (STSF)

2150,2069,2296,1618,1523,1212,544,356,2800,3681,4965

81+227+678+95+311+668+188+2444+881+1284=6857 cylinder.

Selects the request with the least seek time from the current head position. 

In other words, SSTF chooses the pending request closest to the current head position.

C-SCAN 

Moves the head from one end of the disk to the other, servicing requests along the way. When the head reaches the other end, however, it immediately returns to the beginning of the disk without servicing any requests on the return trip.

146+504+881+1284+34+4999+356+188+688+311+95+451=9937cylinder.

Both SCAN and C-SCAN move the disk arm across the full width of the disk.

2.

Elementary physics states that when an object is subjected to a constant acceleration a, the relationship between distance d and time t is given by 

Suppose that, during a seek, the disk accelerates the disk arm at a constant rate for the first half of the seek, then decelerates the disk arm at the same rate for the second half of the seek. Assume that the disk can perform a seek to an adjacent cylinder in 1 millisecond and a full-stroke seek over all 5,000 cylinders in 18 milliseconds.

a. The distance of a seek is the number of cylinders over which the head moves. Explain why the seek time is related to the square root of the seek distance

b. Write an equation for the seek time as a function of the seek distance. This equation should be of the form:

where t is the time in milliseconds and L is the seek distance in cylinders

c. Suppose that the disk rotates at 7200RPM. What is the average rotational latency of this disk drive? What seek distance can be covered during the time of average rotational latency?

From elementary physics, we know that when an object is subjected to a constant acceleration a, the relationship between distance d and time t is given by d = 1 2at2. Suppose that, during a seek, the disk in Exercise 12.17 accelerates the disk arm at a constant rate for the first half of the seek, then decelerates the disk arm at the same rate for the second half of the seek. Assume that the disk can perform a seek to an adjacent cylinder in 1 millisecond and a full-stroke seek over all 5000 cylinders in 18 milliseconds.

a. The distance of a seek is the number of cylinders that the head moves. Explain why the seek time is proportional to the square root of the seek distance. b. Write an equation for the seek time as a function of the seek distance. This equation should be of the form t = x + y √L, where t is the time in milli seconds and L is the seek distance in cylinders. c. Calculate the total seek time for each of the schedules in Exercise 12.17. Determine which schedule is the fastest (has the smallest total seek time). d. The percentage speedup is the time saved divided by the original time. What is the percentage speedup of the fastest schedule over FCFS?

Answer: a. Solving d = 1 2at2 for t gives t = p(2d/a). b. Solve the simultaneous equations t = x + y √L that result from(t = 1, L = 1) and (t = 18, L = 4999) to obtain t = 0.7561+0.2439√L. c. The total seek times are: FCFS 65.20; SSTF 31.52; SCAN 62.02; LOOK 40.29; C-SCAN 62.10 (and C-LOOK 40.42). Thus, SSTF is fastest here. d. (65.20 − 31.52)/65.20 = 0.52. The percentage speedup of SSTF over FCFS is 52%, with respect to the seek time. If we include the overhead of rotational latency and data transfer, the percentage speedup will be less.下载本文

显示全文
专题