Virtual Memory

References:

  1. Abraham Silberschatz, Greg Gagne, and Peter Baer Galvin, "Operating System Concepts, Eighth Edition ", Chapter 9

9.1 Background

9.2 Demand Paging

9.2.1 Basic Concepts

9.2.2 Performance of Demand Paging

( 1 - p ) * ( 200 ) + p * 8000000

= 200 + 7,999,800 * p

which clearly depends heavily on p! Even if only one access in 1000 causes a page fault, the effective access time drops from 200 nanoseconds to 8.2 microseconds, a slowdown of a factor of 40 times. In order to keep the slowdown less than 10%, the page fault rate must be less than 0.0000025, or one in 399,990 accesses.

9.3 Copy-on-Write

9.4 Page Replacement

9.4.1 Basic Page Replacement

9.4.2 FIFO Page Replacement

9.4.3 Optimal Page Replacement

9.4.4 LRU Page Replacement

9.4.5 LRU-Approximation Page Replacement

9.4.5.1 Additional-Reference-Bits Algorithm

9.4.5.2 Second-Chance Algorithm

9.4.5.3 Enhanced Second-Chance Algorithm

9.4.6 Counting-Based Page Replacement

9.4.7 Page-Buffering Algorithms

There are a number of page-buffering algorithms that can be used in conjunction with the afore-mentioned algorithms, to improve overall performance and sometimes make up for inherent weaknesses in the hardware and/or the underlying page-replacement algorithms:

9.4.8 Applications and Page Replacement

9.5 Allocation of Frames

We said earlier that there were two important tasks in virtual memory management: a page-replacement strategy and a frame-allocation strategy. This section covers the second part of that pair.

9.5.1 Minimum Number of Frames

9.5.2 Allocation Algorithms

9.5.3 Global versus Local Allocation

9.5.4 Non-Uniform Memory Access ( New )

9.6 Thrashing

9.6.1 Cause of Thrashing

9.6.2 Working-Set Model

9.6.3 Page-Fault Frequency

9.7 Memory-Mapped Files

9.7.1 Basic Mechanism

9.7.2 Shared Memory in the Win32 API

9.7.3 Memory-Mapped I/O

9.8 Allocating Kernel Memory

9.8.1 Buddy System

9.8.2 Slab Allocation

9.9 Other Considerations

9.9.1 Prepaging

9.9.2 Page Size

9.9.3 TLB Reach

9.9.4 Inverted Page Tables

9.9.5 Program Structure

9.9.6 I/O Interlock

There are several occasions when it may be desirable to lock pages in memory, and not let them get paged out:

9.10 Operating-System Examples

9.10.1 Windows XP

9.10.2 Solaris

9.11 Summary