Computer ORGANIZATION and ARCHITECTURE designing for performance ninth EDITION
The basic mechanism for reading a word from memory
Involves the translation of a virtual, or logical, address, consisting of page number
and offset, into a physical address, consisting of frame number and offset, using a
Page table. Because the page table is of variable length, depending on the size of the
Process, we cannot expect to the it in registers. Instead, it must is in main memory
To is accessed. Figure 8.16 suggests a hardware implementation of this scheme.
When a particular process is running, a register holds the starting address of the
Page table for that process. The page number of a virtual address is used to index
That table and look up the corresponding frame number. This was combined with the
Offset portion of the virtual address to produce the desired real address.
In the most systems, the There is one page table per process. But each process can
Occupy huge amounts of virtual memory. For example, in the VAX architecture,
Each process can has up to 2
31
= 2 GBytes of virtual memory. Using 2
9
= [email protected]
Pages, that means as many as 2
22
Page table entries is required per process.
Clearly, the amount of memory devoted to page tables alone could is unacceptably
High. To overcome the problem, most of the virtual Memory Schemes store page tables in
Virtual memory rather than real memory. This means, that page tables is subject to
Paging just as other pages is. When a process was running, at least a part of the its page
Table must bes in main memory, including the page table entry of the currently execut-
ing page. Some processors make use of a two-level scheme to organize large page
Tables. In this scheme, there are a page directory, in which each entry points to a page
Table. Thus, if the length of the page directory is X, and if the maximum length of a
Page table is Y, then a process can consist of up to X
*
Y pages. Typically, the maxi-
Mum length of a page table is restricted to being equal to one page. We'll see a exam-
Ple of this two-level approach if we consider the Pentium II later in this chapter.
An alternative approach to the use of One-or two-level page tables are the use
of an inverted page table structure (Figure 8.17). Variations on this approach is
Used on the Power PC, Ultra SPARC, and the IA-64 architecture. An implementa-
tion of the Mach OS on the RT-PC also uses this technique.
In this approach, the page number portion of a virtual address was mapped into
A hash value using a simple hashing function.
2
The hash value is a pointer to the
Inverted page table, which contains the page table entries. There is one entry in the
2
A hash function maps numbers in the range 0 through M to numbers in the range 0 through N, where
M > N. The output of the hash function is used as a index into the hash table. Since more than one input
Maps into the same output, it's possible for an input item to map to a hash table entry that's already
Occupied. In this case, the new item must overflow to another hash table location. Typically, the new
Item is placed in the first succeeding empty space, and a pointer from the original location are provided to
Chain the entries together. See Appendix C for more information on hash functions.
Inverted page table for each real memory page frame rather than one per virtual
Page. Thus a fixed proportion of real memory is required for the tables regardless of
The number of processes or virtual pages supported. Because more than one virtual
Address may map to the same hash table entry, a chaining technique is used for
Managing the overflow. The hashing technique results in chains that is typically
Short-between One and entries. The page table ' s structure is called inverted
Because it indexes page table entries by frame number rather than by virtual page
Number.
Virtual Memory PAGE TABLE STRUCTURE