Question 1: Page Tables
Consider a memory management system with demand paging. You're given
three processes P1, P2, P3 which have one page of private
memory each. Moreover, P1 and P2 are sharing an array
A which fits entirely into one memory page. Similarly,
P2 and P3 are sharing an array B which fits into
a memory page.
- Let all the data for the processes be located into physical
memory. Draw a possible memory allocation diagram, and give the page
tables for the three processes.
- Assume that process P1 gets swapped out of memory
entirely. How are the page tables changing?
- Next, assume that process P1 gets swapped back into
memory. Give the page tables in this situation!
- Describe an algorithm for maintaining consistent entries for shared
pages in the page table. What data structures do you need to make this
operations very efficient?
Question 2: Effective Access Time
Consider a memory management systme with demand paging. You know the following
characteristics of the system:
Also, 80% of all memory accesses are served from the
TLB. 10% of the remaining accesses cause a page fault.
- TLB (Translation Lookaside Buffer) time: T_TLB = 0.1 micro
- Memory access Time: T_mem_access = 1 micro second
- Time for reading from disk and updating memory:
T_access_transfer = 20 milli seconds
What's the effective access time? (In other words, what's the average
time it takes to serve a memory access from the above distribution?)