An old Homework problem
Consider a virtual memory system with 32 bit addresses and 8 KB pages. Each page table entry is 2 bytes long, and there is one level of page table. The entire 32 bit address space is available to processes. Consider a process that has allocated the top and bottom 128 MB of its address space. How much memory does its page table use. (Note that 1MB = 1048576 bytes)
Now consider the same process in a two level paging system with the same size pages, but two page identifiers of 10 and 9 bits for the first and second level of the page table. How much memory does this page table consume for the same process?
Answer: The first page table takes the same
amount of space for all processes. 8K page tables imply that the offset
takes up 13 bits, leaving 19 bits for the page identifier. There are
two byte entries which
is
bytes (or 1MB).
The second page table requires one main page table of
2 byte entries, which
takes up 2048 bytes (or 2KB). Each secondary page table addresses
pages. Because each
page is 8K, each secondary page addresses 4194304 (4MB) of data. Each 128
MB of data requires 32 secondary pages for a total of 64 secondary pages
each of
2 byte
entries (1024 bytes). The whole page table takes
or 68KB.
-2-
Another old homework problem: Consider a virtual memory system. This system also has virtual memory hardware cache on the processor. The hit rates and service times for the layers of the memory system are:
| |||||||||||||||
Which improves memory performance more, improving the processor cache service time by 10% (a 0.9 ns lookup time) or increasing the main memory hit rate by 5% (to 80%) by choosing a better page replacement algorithm? Calculate the average memory access time for both changes.
Answer: Absloute rates are:
| |||||||||||||||








