东南大学《操作系统》课程作业 第九章

1. Assume we have a demand-paged memory. The page table is held in registers. It takes 8 milliseconds to service a page fault if an empty page is available or the replaced page is not modified, and 20 milliseconds if the replaced page is modified. Memory access time is 100 nanoseconds. Assume that the page to be replaced is modified 70 percent of the time. What is the maximum acceptable page-fault rate for an effective access time of no more than 200 nanoseconds?
设缺页率为x,则x满足:

\[(1-x)*100ns + 0.3x*(100ns + 8ms + 100ns) + 0.7x * (100ns + 20ms + 100ns) = 200ns \\解之得x=0.00061% \]

2. Consider the following page reference string:
7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0 , 1.
Assuming demand paging with three frames, how many page faults would occur for the following replacement algorithms?

• LRU replacement
• FIFO replacement
• Optimal replacement
image
image

3. Consider a demand-paging system with a paging disk that has an average access and transfer time of 20 milliseconds. Addresses are translated through a page table in main memory, with an access time of 1 microsecond per memory access. Thus, each memory reference through the page table takes two accesses. To improve this time, we have added an associative memory that reduces access time to one memory reference if the page-table entry is in the associative memory. Assume that 80 percent of the accesses are in the associative memory and that, of those remaining, 10 percent (or 2 percent of the total) cause page faults. What is the effective memory access time?

\[EAT = 0.8*1us + 0.18*(1us+1us) + 0.02*(1us+1us+20ms+1us) = 0.40122ms \]

4. What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem?
抖动是因为高度频繁的页面调度活动造成的。例如进程没有获得需要支持活动使用页面的足够帧数,导致频繁产生缺页错误。如果CPU利用率不高,但是盘利用率很高,就说明可能产生了抖动。系统可以通过降低进程数来消除抖动问题。

5. In a 1,024-KB segment, memory is allocated using the buddy system. Using Figure 9.26 as a guide, draw a tree illustrating how the following memory requests are allocated:
• Request 6-KB • Request 250 bytes • Request 900 bytes
• Request 1,500 bytes • Request 7-KB
Next, modify the tree for the following releases of memory. Perform coalescing whenever possible:
• Release 250 bytes • Release 900 bytes • Release 1,500 bytes

image
image

原文地址:https://www.cnblogs.com/zxuuu/p/15631293.html