This preview shows page 1. Sign up to view the full content.
Unformatted text preview: r approaches, such as trying to predict misses and swap pages in before they are actually referenced, are possible. However, all modern systems use demand paging. 10.3.5 Allocating Pages
Figure 10.8 shows the effect on our example page table when the operating system allocates a new page of virtual memory, for example, as a result of calling malloc. In the example, VP 5 is allocated by creating room on disk and updating PTE 5 to point to the newly created page on disk. 10.4. VM AS A TOOL FOR MEMORY MANAGEMENT
Physical Memory (DRAM) VP 1 PP 0
VP 2 VP 7 VP 3 493 Physical page number or Valid disk address null PTE 0 0
1 1 0 0 0 0 PTE 7 1 PP 3 Virtual Memory (disk)
VP 1 Memory resident page table (DRAM) VP 2 VP 3 VP 4 VP 5 VP 6 VP 7 Figure 10.8: Allocating a new virtual page. The kernel allocates VP 5 on disk and points PTE 5 to this new location. 10.3.6 Locality to the Rescue Again
When many of us learn about the idea of virtual memory, our ﬁrst impression is often that it must be terribly inefﬁcient. Given the large miss penalties, we worry that pa...
View Full Document
- Spring '10
- The American