# Andrew S. Tanenbaum (OS) Edition 4 Exercise 3 Question 42 (Page No. 259)

1 vote
46 views
It has been observed that the number of instructions executed between page faults is directly proportional to the number of page frames allocated to a program. If the available memory is doubled, the mean interval between page faults is also doubled. Suppose that a normal instruction takes $1\: microsec,$ but if a page fault occurs, it takes $2001\: \mu sec (i.e., 2\: msec)$ to handle the fault. If a program takes $60\: sec$ to run, during which time it gets $15,000$ page faults, how long would it take to run if twice as much memory were available?

Time spent in executing program = 60 – 15000*2*10^(-3) = 30 seconds

For 15000 page faults, the overhead at 2 msec per fault is 30 sec.

So, out of the 60 sec, 30 went in paging overhead and 30 for process running.

If the process had twice the memory, we have half, i.e., 7500 page faults and 15 sec paging overhead.

The total time for the process is 30+15=45sec.

edited

## Related questions

1
187 views
We consider a program which has the two segments shown below consisting of instructions in segment $0,$ and read/write data in segment $1.$ Segment $0$ has read/execute protection, and segment $1$ has just read/write protection. The memory system is a demand- paged virtual memory system ... $16$ Fetch from segment $1,$ page $4,$ offset $28$ Jump to location in segment $1,$ page $3,$ offset $32$
A machine-language instruction to load a $32-bit$ word into a register contains the $32-bit$ address of the word to be loaded. What is the maximum number of page faults this instruction can cause?
Write a program that simulates a toy paging system that uses the $\text{WSClock}$ algorithm. The system is a toy in that we will assume there are no write references (not very realistic), and process termination and creation are ignored (eternal life). The ... per $1000$ memory references. Explain what is needed to extend the program to handle a page reference stream that also includes writes.