Project 4: Recoverable Virtual Memory

Due Wednesday, December 3rd, 11:59pm

Introduction

In this project you will implement a recoverable virtual memory system like LRVM as described in Lightweight Recoverable Virtual Memory There are other papers available which you may consider reading, including Rio Vista. Users of your library can create persistent segments of memory and then access them in a sequence of transactions.

Making the memory persistent is simple: simply mirror each segment of memory to a backing file on disk. The difficult part is implementing transactions. If the client crashes, or if the client explicitly requests an abort, then the memory should be returned to the state it was in before the transaction started.

To implement a recoverable virtual memory system you should use one or more log files. Before writing changes directly to the backing file, you can first write the intended changes to a log file. Then, if the program crashes, it is possible to read the log and see what changes were in progress.

More information is available in the above-mentioned papers. It is up to you how many log files to use and what specific information to write to them.

You may again work in pairs for this project. Your submission must provide a Makefile, and it must run on the factors.

The API

Your library must implement the following functions:

Initialization & Mapping Operations

Transactional Operations

Log Control Operations

Library Output

You'll notice that there is a file named "rvm.h" that is referenced in each one of test cases below. You must place all of the previously described function declarations in an rvm.h file. You must also generate a library file named librvm.a for your RVM library.

Test Cases/Demo

In order to get a feel for how the above API is used, you should write some test cases that use the above functions and check whether they worked correctly. To implement your test cases, you will probably want to use multiple processes, started either with fork() or by starting programs from a shell script. You must also simulate crashes and demonstrate recovery; exit() and abort() functions are useful for simulating the crashes.

Your RVM library must minimally pass the tests that are given below. You must also demonstrate at least three other tests that you believe are relevant. The TA may run other test cases not listed here against your library.

Here are some tests the TA will use:

Write Up

You must deliver some documentation, in the form of a document or README file in your source code, which includes directions on how to compile and run your code. You must also include a short description of your design that includes information on how your library uses logfiles and how it manages transactions. The write up should also include information on things that do not work well.

Deliverables

You must deliver your project to the TA, Scott McManus, via email by Wednesday, December 3rd, 11:59pm. Your deliverable should include the following: