


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A series of questions related to virtual memory concepts, page replacement algorithms, and their impact on system performance. Topics include page faults, actions taken by the operating system, lower and upper bounds on page faults, address processing, good and bad programming techniques, and system optimization.
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



1. (3 pts.) Under what circumstances do page faults occur? 1. (3 pts.) Describe the actions taken by the operating system when a page fault occurs. 1. (3 pts.) Assume you have a page-reference string of length l for a process with m frames (all initially empty) and that the string has n distinct page references. a) What is the lower bound on the number of page faults? b) What is the upper bound on the number of page faults? 1. (3 pts.) A certain computer uses 32-bit logical addresses and has 256 MB of physical memory. The virtual memory system is implemented by using 4 KB pages. How would the address 0x1112346 be processed by this system? 1. (3 pts.) Which of the following programming techniques and structures are “good” for a demand-paged environment and which are “bad?” a) Stack b) Hash Table c)Sequential Search d)Binary Search e) Pure Code (Instructions) 1. (3 pts.) What are the factors of a programming technique or structures makes it “good” or “bad” for a demand-paged environment? 1. (3 pts.) Assume that we have a demand-paged memory system where the page table is held in registers. Direct memory accesses take 100 ns. It takes 8 ms to service a page fault if an empty frame is available or if the replaced page is not modified. It takes 20 ms if the replaced page is modified. If a page to be replaced is modified 70 percent of the time, what would be the maximum acceptable page-fault rate to give an average access time of no more than 200 ns? 1. (3 pts.) What are the disadvantages and advantages of using implementing a virtual memory system? 1. (3 pts.) An operating system supports a paged virtual memory using a central processor with a cycle of time of 1 s. It costs an additional 1 s to access a page other than the current one. Pages have 1000 words and the paging device can transfer a million words per second. One percent of all instructions executed access a page other than the current page, and 80 percent of those access a page already in memory. When a new page is require, the replaced page is modified 50 percent of the time. Calculate the average instruction time on this system, assuming that the system is running one process only, and that the processor is idle during I/O to the paging device. 1. (3 pts.) Consider a demand-paging system with the following time-measured utiltizations: CPU Utilization – 20%, Paging Disk – 97.7%, Other I/O Devices – 5%.
For each of the following, say whether it will (or is likely to) improve CPU Utilization and explain why or why not. a) Install a faster CPU. b) Install a bigger paging disk. c) Increase the degree of multiprogramming. d) Decrease the degree of multiprogramming. e) Install more main memory. f) Install a faster hard disk, or multiple controllers with multiple hard disks. g) Add pre-paging to the page-fetch algorithms. h) Increase page size.
1. (3 pts.) Consider the two-dimensional array A: int A[][] = new int[100][100]; where starts at address 200 in a page memory system of 200-B pages. A small process resides in page 0 (0 to 199) for manipulating A. (Thus, every fetch will be from page 0.) Compare the number of page faults for the following two programs using LRU replacement: a) for(int j=0; j<100; j++) for(int i=0; i<100; i++) A[i][j] = 1; b) for(int i=0; i<100; i++) for(int j=0; j<100; j++) A[i][j] = 1; 1. (3 pts.) Consider the following page-reference string: 1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3, How many page faults will occur for the following algorithms assuming one, two, three, four, five, six, or seven frames? Page Faults Frames LRU FIFO Optimal 1 2 3 4 5 6 7
Paging Disk 97.7% Other I/O devices 5% For each of the following, explain what effect they would have on the overall system performance (CPU utilization.) Install a faster CPU Install a bigger paging disk Install a faster paging disk. Increase the degree of multi-programming. Decrease the degree of multi-programming. Install more main memory. Increase the page size.