CS 502 Operating Systems                                                                               WPI, Fall 2007
Hugh C. Lauer                                                                                          Project 3 (20 points)
Assigned: Monday, October 29, 2007                                Due: Monday, November 12, 2007

Page Replacement in Linux

In this project, you will study the Linux kernel with respect to its page replacement strategy and algorithm. Using your virtual machine, the source code of your kernel, Robert Love’s book on Linux Kernel Development, your textbook by Silbershatz, Galvin, and Gagne, and any other resources, investigate and report on how page replacement works in your version of the Linux kernel.[1]

To carry out this project, you may use a combination of reading and analyzing kernel code, experimenting with it by embedding printk statements, reading information in the /proc directory, setting breakpoints with kdb, or anything else you can imagine.

You must find out and report how Linux decides what pages to throw out in order to make room for new pages that are to be swapped in. In particular, you must understand the page cache and the pdflush daemon described by Love in Chapter 15, and you must follow how they work in the code of your Linux kernel.

It would be best if you can watch the page replacement strategy in action, for example, by seeing what happens when you run a big program (such a kernel compilation).

Identify the source code modules, functions, and data structures that affect page replacement and how they are invoked. Also note how pdflush and/or any other daemons are started and how they work. Be sure to note any differences between what Love wrote and how it works now.

Compare the Linux strategy with the various page replacement methods discussed in class. See the class notes (.ppt, html), §9.4 of Silbershatz, et. al., and slides for this project assignment (.ppt, html).

Project Submission

Write a short report on your findings, about 3-5 pages plus any outputs from your experiments and investigations. A patch file for the kernel is not necessary for this project.

Please submit your project using the web-based turnin facility at


For purposes of turnin, this assignment is project3.


Students may collaborate on the investigative portion of this project, but each student must write an individual report discussing the findings of this investigation.

[1]       Note that the strategy and mechanism has changed since Silbershatz, et. al., wrote about it in §21.6 of their textbook.