|
|
Compressed caching is the introduction of a new level into the virtual memory hierarchy. Specifically, RAM is used to store both an uncompressed cache of pages in their 'natural' encoding, and a compressed cache of pages in some compressed format. By using RAM to store some number of compressed pages, the effective size of RAM is increased, and so the number of page faults that must be serviced by very slow hard disks is decreased. Our aim is to improve system performance. When that is not possible, our goal is to introduce none (or a minimum overhead) when compressed caching is enabled in the system.
Born as an undergraduate research project, it is now being developed mainly by Rodrigo S. de Castro (rcastro at ime.usp.br). It was part of his master's thesis (soon avaliable) at Universidade de São Paulo (University of Sao Paulo, or USP), under the supervision of Alair Pereira do Lago, PhD, Professor at USP, Dilma Menezes da Silva, PhD, Researcher at IBM TJ Watson Research Center and Fábio Kon, PhD, also Professor at USP. Until March 2003, this research was supported by FAPESP (under contract 01/01432-4) and CNPq (under contract 465901, headed by Prof. Imre Simon, PhD). Currently, it is done mostly in Rodrigo's spare time.
The main goal was, based on prelimary studies by Scott F. Kaplan (see our references section), to implement this compressed caching in Linux 2.4. This step has been successfully accomplished and now we aim to improve its performance and implement it into Linux 2.5/2.6.
Compressed cache patch has already been included into: kernel patchset by Con Kolivas and WOLK project by Marc-Christian Petersen. It has been tested on preempted kernels. Although the infrastructure for SMP systems is implemented, it was never tested and we assume it is not safe. Moreover, our development architecture is i386, so we are unable to tell whether it works on other architectures or not (in spite of that it does not have much arch-dependent code).
Thanks for your interest in compressed caching implementation. In case you want more information, have any troubles or suggestion, or even want to join us in this effort, get in touch.
(Jun 10th 2003) New statistics
New performance statistics are available, namely:
Soon I will add some info about problems with Sort, PostMark and Contest that made us implement some features like clean page suspension, or even made us realize that there were some scheduling effect when using compressed caching.
(Jun 08th 2003) Dissertation defense
The defense of the master's dissertation on compressed caching took place on Jun 06th at Jacy Monteiro Amphitheater of University of Sao Paulo, at 2PM BRT. The audience wasn't very large, but it was composed of high quality people :-). I guess the presentation was pretty fine, but it took a little longer than I expected. The questions about the project were clever, but no surprise. All the committee members liked the dissertation and my master was approved. After the defense, some close friends and I celebrated it going to a pizzeria, where we ate a lot. Now I have to fix some mistakes and check some suggestions in order to deliver the final version of my text.
(May 05th 2003) Project is alive and moves on.
Much water has passed under the bridge since our laste news about the project. I couldn't work on the project for a long time due to my dissertation and two papers that I wrote about this project. Nevertheless, the project is still alive and I want to keep working on it, since I do have some ideas that may be implemented, now that I finally finished writing my master's dissertation. I also think porting it to 2.5/2.6 will be really cool. However, the only difference is that, from now on, I will not be working on it full-time, since my scholarship is over and I got a job. Anyway, if you want to help out in some way, feel free to drop me a note.
(Nov 22th 2002) Patch 2.4.1{8,9}-0.24pre5 (news)
Finally a new patch is out for both 2.4.18 and 2.4.19 kernels. This patch features the clean page adaptability, which disables clean page compression when necessary. It also has some bug fixes and cleanups, as always.
(Sep 14th 2002) Home Page Updated (news)
Finally the home page was updated. Now the directions to install the compressed cache patch matches the options available in the last version. Cache design section has been marked as outdated (and the excerpt on the home page removed). There are links to the patchset that include compressed cache.
All the patches released may not be suitable for use on a production box. Use at your own risk.
Compressed Cache Patches are done for the newest versions of Linux Kernel development tree. Currently, we have patches for 2.4.X and for 2.4.X-acY versions of Linux Kernel.
cd /path/to/kernel/
bzcat /path/to/patch-comp-cache-2.4.X-0.YZ | patch -p1
For instance, if your kernel source tree is located in /usr/src/linux and you Compressed Cache patch is in /usr/local/, the commands to apply the patch would be:
cd /usr/src/linux
bzcat /usr/local/patch-comp-cache-2.4.X-0.YZ | patch -p1
Once you applied the patch, you have to configure your kernel for compilation. Run make menuconfig (or make config, make xconfig) to have the configuration options displayed. You have to enable the following options if you want to run compressed cache.
The latter option will not be displayed if you have SMP support enabled in your configuration. Given that our current implementation does not support SMP systems, you cannot use compressed cache on a system like that. That way, if you don't have a SMP system, make sure the next configuration option isn't selected:
Select the next option in case you want compressed cache to store also pages from page cache, ie file mapped pages, and to take into account these pages when adapting compressed cache to recent behaviour. If you don't select this option, compressed cache will store only anonymous pages, ie pages not mapped to files.
You may select the next option in case you want compressed cache to use two contiguos memory pages as its compressed page. That will improve compressed cache efficiency given that we will have a better space usage even if the compression ratio isn't very good. We encourage you to select it.
Compressed cache swaps out its fragments (i.e, compressed memory pages) in compressed format. If you also want it to swap out them clustered to the disk, in order to reduce the writeout traffic, select the following option. Note that this option adds some data structures that will cost some memory, so if you don't have much, you'd better say N.
From now on, it's same you might be used to do. If you don't know, you may want to have a look at Kernel-HOWTO.
You may select the maximum number of compressed cache via a kernel parameter (compsize=). It accepts the same input as mem= kernel parameter. That can be done automatically by adding the line "append="compsize=24M"" (24M is an example) to your /etc/lilo.conf if you use LILO bootloader (check how to do this configuration with your bootloader if other than LILO).
In case you don't select the initial number of compressed pages via kernel parameter, the compressed cache may use up to 50% of all your memory pages. That's rare, in your tests, yet in some specific scenarios, it uses up to 20/30% of the system memory.
You selected the maximum compressed cache size, but that does not mean it will start with that size. It starts with a minimum set of memory pages and it grows when needed. There is an adaptivity police that will let the cache grow or force it to shrink if it isn't worth it.
Good Luck! Any problems, comments, suggestions, send us an email at linuxcompressed-devel@lists.sourceforge.net
Cache Design (outdated)
IRC: Join #linux-mm-cc channel on irc.oftc.net to discuss about the project.
Linux 2.4 Virtual Memory Overview
The Case for Compressed Caching in Virtual Memory Systems
Paul R. Wilson, Scott F. Kaplan, and Yannis Smaragdakis, USENIX '99. (postscript)
Compressed Caching and Modern Virtual Memory Simulation
Scott F. Kaplan, Ph.D. Dissertation. (postscript)
Improving Application Performance through Swap Compression
R. Cervera, T. Cortes, and Y. Becerra, , USENIX '99.
(postscript)
Their Compressed Swap Cache for Linux page (html)
The Compression Cache: Using On-Line Compression to Extend Physical Memory
Fred Douglis, paper. (postscript)
Operating System Support for Fast Hardware Compression of Main Memory Contents
Bulent Abali and Hubertus Franke, IBM T.J. Watson Research Center, paper. (pdf)
Unix Internals
Uresh Vahalia, Prentice Hall, 1995, book.
Understanding the Linux Kernel
Daniel P. Bovet and Marco Cesati, O'Reilly, 2001, book.
The Linux Kernel
David A Rusling, book. (postscript)
Too little, too slow; memory management
Rik van Riel, lecture. (html)
Page replacement in Linux 2.4 memory management
Rik van Riel, paper FREENIX 2001. (pdf)
The Memory Management Glossary (html)
UVM, the new Virtual Memory system (html)
The Design and Implementation of the UVM Virtual Memory System
Charles Cranor (postscript)
The Slab Allocator: An Object-Caching Kernel Memory Allocator
Jeff Bonwick, presented at the USENIX '94. (postscript)
User-Mode-Linux
Jeff Dike (html)
Linux Kernel Debugging
Andrea Arcangeli, talk in San José. (tar.gz)
Open Source Development with CVS
Karl Fogel, online book. (web site)
Monografia do Trabalho de Formatura
Rodrigo S. de Castro, technical activities report (summary), in Portuguese. (postscript)
|
|
|
|
Page last updated on "Thu Jul 10 17:12:49 2003"
Send feedback to
Rodrigo S. de Castro <rcastro@users.sourceforge.net>