printable version
Review V2: Principles of virtual memory
[1]
[2]
[3]
Problem V2.1.
Explain what a translation lookaside buffer (TLB) is, and explain
why it is important for reducing the amount of time for accessing
memory.
A straightforward implementation of virtual memory places the
page table in memory. Unfortunately, this means that each attempt
to access a memory location actually requires two memory accesses
— one to look up the page table entry in virtual memory, and
one to access the requested memory within the page frame given by
that entry. This effectively halves the time to access each page,
when compared to a system that does not use virtual memory.
Designers reduce this problem dramatically by caching a small
number of frequently-used page table entries on the CPU chip, in a
portion of the chip called the translation lookaside buffer,
or TLB. Since accessing data stored on the CPU chip is much faster
than accessing data in memory, the TLB can dramatically reduce the
time for looking up page table entries, restoring a access speed more
comparable to a system without virtual memory.
Problem V2.2.
Explain the concept and purpose of page
directories.
A page directory is a table of pointers to page tables for regions of
virtual memory. A CPU uses the page directory instead of a single page
table, because a single page table can become very large and it must be
in memory in order to allow for address translation. With a page
directory, the partial page tables can be paged in virtual memory. (The
page directory must occupy RAM for address translation, but the page
directory would be much smaller than a single exhaustive page table.)
Moreover, page tables for unused regions of memory need not occupy even
virtual memory.
Problem V2.3.
Describe at least two advantages of a virtual memory system
over using the actual DRAM addresses.
- It provides a larger range of memory address beyond what actual
memory the computer holds.
- It allows each process to have its own address space.
- It enables two processes to share the same memory easily.
- It enables memory to be moved between addresses rapidly, since
altering the paging table moves the page without any actual memory
copying going on.