- 9.16 a. When a process first starts execution, the page fault rate would be 100% because there are no pages in memory to begin with so the process must fault each time until every page that it needs is in memory.
- b. As long as the working set it not too large to be stored in available free memory, once the working set for a process is loaded into memory, the page fault rate would be 0%. This is because every page that it needs is in memory.
- c. If a process changes its locality and the size of the new working set is too large to be stored in available free memory designers would have to choose the best page replacement algorithm to handle this situation. Some options would be the first-in, first-out; optimal; or least-recently-used.
- 9.19 The copy-on-write feature is a technique that allows the parent and child processes initially to share the same pages. These shared pages are marked as copy-on-write pages, meaning that if either process writes to a shared page, a copy of the shared page is created. This feature is beneficial to use when two programs are sharing data. The hardware support that is required to implement this feature would be that for each memory access you would have to check the page table to see if the page is set to copy-on-write.
- 9.20 Since the size of the logical address space is 2^32 and the page size is 4096 bytes (2^12), the page table is 2^20. So the logical address 11123456 would be translated to binary and the lower 12 bits would be the page offset and the upper 20 bits would be the page number.
- 200ns = (1-p)100ns + (0.7p)20ms + (0.3p)8ms
- 200ns = (1-p)100ns + (0.7p)20,000,000ns + (0.3p)8,000,000ns
- 200ns = 100ns – 100p + 14,000,000p + 2,400,000p
- 100ns = 16,399,900p
- 0.000006098 = p
- 9.22 If one user thread incurs a page fault while accessing its stack, the other user threads belonging to the same process would also have to wait for the faulting page to be brought into memory. This is because the mapping of user threads to kernel thread is many to one so if one thread blocks and relinquishes the kernel thread they will all have to block and wait.
- 9.24 a. If the pointer is moving fast, the system is accessing many pages.
- b. If the pointer is moving slow, the system is accessing fewer pages.
a guest May 17th, 2011 862 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data