UNIVERSITY OF WISCONSIN-MADISON
Computer Sciences Department
CS 537
Spring 2000
A. Arpaci-Dusseau
Quiz #8: Wednesday, April 12

Name: Student ID #:

Memory Management and Virtual Memory

Problem 1: Page Sizes (20 points)

What is the primary performance benefit of larger pages? (Assume that the size of an address space and the amount of memory remains the same.)









Problem 2: Dirty Bit (30 points)

In some memory systems, each page has a dirty bit associated with it.

a) When is the dirty bit set on a page (i.e., when is the page considered dirty)?




b) When is the dirty bit cleared on a page (i.e., when is the page considered clean)?



c) Why is it useful to know that a page is dirty?









Problem 3: Emulating a Dirty Bit (50 points)

In some systems, there is hardware support for setting and clearing dirty bits. However, in other systems, there is not; in this case, software (i.e., the Operating System) can emulate the role of hardware. In this question, you are to describe the steps involved in emulating dirty bits in software.

To make your answer clear, specify any changes in how the page tables are used and any new data structures that you need. Explain what happens on a read and write to a given page; if some read or write operations act differently than others, explain each case. Make sure in your explanation that you show when the emulated dirty bit gets set and cleared.

You should assume that hardware understands the format of the page tables and performs the page translations. You should make any reasonable assumptions about the format of an address and the page tables that you find useful. Finally, make sure that your emulation performs efficiently.