=========================preview======================
(COMP252)final00F_tr.pdf
Back to COMP252 Login to download
======================================================
Department of Computer Science The Hong Kong University of Science and Technology
COMP 252 Principles of Systems Software
FALL 2000, FINAL EXAM TRAINING PROBLEMS
1.
Suppose 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? Answer: 200ns = (1-P) x 100ns + 0.3 x P x 8ms + 0.7 x P x 20ms P = 0.000006
2.
What is the cause of thrashing? How does the system detect the thrashing? Once it detects
thrashing, what can the system do to eliminate this problem? Answer: Trashing is caused by underallocation of the minimum number of pages required by a process, forcing it to continuously page fault. Trashing can be detected by evaluating the level of CPU utilization compared to the level of multiprogramming. It can be eliminated by reducing the level of multiprogramming.
3.
Consider a demand-paged computer where the degree of multiprogramming is currently fixed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives (i.e. a, b, c). For each case what is happening? Can the degree of multiprogramming be increased to increase the CPU utilization?
CPU utilization 10%, disk utilization 95% CPU utilization 90%, disk utilization 3%, CPU utilization 10%, disk utilization 3%
Answer:
a) The system is spending most of the time serving page faults, i.e. trashing. We should decrease degree of multiprogramming in this case.
b) CPU utilization is sufficiently high to leave the system in the current state. However, still some increase in the degree of multiprogramming is possible.
c) System is underutilized. We should increase the degree of multiprogramming.
4.
Explain the difference between internal and external fragmentation. Which one occurs in paging systems? Which one occurs in systems using pure segmentation?
5.
What are the advantages of using a linked allocation of disk blocks, versus a contiguous allocation, for a large file? What are the disadvantages?
6.
Consider two disks, one with 500 cylinders and 10 surfaces and the other with 1000 cylin-ders and 5 surfaces, both having the same number of sectors per track and the same read/ write heads seek characteristics (the same seek time for the same number of traversed tracks). Which one will give better performance to the file system with contiguous block allocation.
COMP 252 (Fall 1999) Training Problems
Dept. of CS/HKUST
Answer: The first one, since the cylinder capacity is larger, and less seeks are needed in accessing the files.
7. Consider a file curr