Reiser4 Performances on Ubuntu 9.10
Since its debut in 2004, there is a lots of controversy on Reiser4, the game-changing file-system developed by Namesys. It has been available for Linux for quite a while and there are great reviews on the Internet, but most distribution do not include it as an option by default, including Ubuntu Karmic 9.10.
Since the performances of my loyal Dell x300 are disk bounded, and I had success improving them using SquashFS last year (unfortunately it’s read-only), I decided to do my own review of Reiser4: I downloaded the source of my kernel (apt-get source linux-image-2.6.31-20-generic), its build dependencies (apt-get build-dep linux-image-2.6.31-20-generic), applied the right Reiser4 patch, copied over my current .config file (disable the DEBUG symbols from the kernel or your image will be huge) from the /boot directory and a couple of minutes later I was already running make-kpkg.
The goal of my first test was to compare Reiser4 with other well-known choices. I created a partition of about 5Gb and copied over my /usr directory (3549986832 bytes) using rsync (-aHAX) for each file-system.
| FS | Time | KB/s | CPU % | Disk (Gb) |
| ext4 | - | 2983 | - | - |
| jfs | - | 2817 | - | - |
| reiser3 | 16:57 | 3412 | 20 | 3.4 |
| reiser4 | 12:40 | 4570 | 25 | 3.4 |
Using Reiser4 the CPU utilization was definitively higher, but the disk throughput increased significantly (+53% versus ext4). If the ccreg40 plugin is used for file creation instead of the default reg40, Reiser4 offers many additional options on how the files are laid out, if and how are compressed, and which compression/encryption algorithm is used. I tested the impact of some of its compression schemes (conv, ultim and force) and the two compression algorithms (gzip1 and lzo1).
I was expecting the best compression performances from LZO1, but instead got the highest throughput (+70% respect to ext4) at the expense of an higher CPU utilization (+70% respect to Reiser3):
| Compression | Time | KB/s | CPU % | Disk (Gb) |
| conv | 11:41 | 4954 | 30 | 3.8 |
| force | 11:33 | 5004 | 27 | 3.4 |
| ultim | 11:23 | 5085 | 28 | 3.6 |
Using GZIP1 lead to the highest compression ratio (-48% vs. ext4) but a lower CPU utilization (-19% respect to LZO1) and a lower disk throughput (+42% over ext4):
| Compression | Time | KB/s |
CPU % | Disk (Gb) |
| conv | 14:32 | 3972 | 27 | 2.7 |
| force | 13:56 | 4155 | 22 | 2.4 |
| ultim | 13:39 | 4241 | 23 | 1.8 |
The results can be difficult to interpret: LZO1 seems to give the maximum disk throughput but there is less CPU available for applications and the files on disk are bigger (thus there is more to read), on the other hand, GZIP1 offers lower disk performances but there is half of the data to read from the disk.
To help me decide, I devised a comprehensive score (lower is better) which takes in account CPU, disk utilization and throughput, assuming that they all have the same importance:
score = (max_throughput / throughput) * (cpu / min_cpu) * (size / min_size)
Using this formula the winning configuration is GZIP1 with “ultim” (1.38). With default options enabled Reiser3 and Reiser4 obtain a score of 2.82 and 2.63 respectively. Slightly better GZIP1 with “force” (1.79) and “conv” (2.59). LZO1 is best using “force” (2.59) instead of “ultim” (2.80) or “conv” (3.25).
Using Reiser4 with GZIP1 and “ultim” should provide a 42% increase in disk throughput and reduce by 48% the amount of data to read, making my disk about 2.95 times faster. Let’s hope its true.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Hi Alessio, I did the same a few days ago also for the 2.6.31 kernel. Everything works fine except the compression. I created the Reiser4 partition with sudo mkfs.reiser4 -o create=ccreg40,compress=gzip1,compressMode=ultim,cluster=8K /dev/sda4. When I copy a folder to this partition (/mnt), its size does not shrink,e.g. du -sm Documents/ /mnt/Documents/
104 Documents/
106 /mnt/Documents/
It is normal, since you selected the compressMode “ultimately”, things
are not compressed right away. They are copied uncompressed somewhere to
increase speed and efficiency and then moved/compressed later when there
are some spare CPU cycles and if it has been established that the
content is compressible. It’s a pretty amazing feature, don’t you think?
If you really want it to be compress everything right away use
compressMode=force, but based on my tests I would not recommend it
To check the real dimension of your files use “du -s <directory>“. If you want to see what is the actual space occupied/free on the drive/partition use “df“.
Where did you get the steps to building a Reiser4 kernel. Is there anywhere where it is clearly laidout? I tried using the wiki before but it doesnt really tell you how to apply the patch. Thanks!
Applying a patch is very simple once you downloaded it. You can follow these instructions for example. Generally, from the /usr/src directory you will launch something like “gzip -d -c patch.gz | patch -p0” or “patch -p0 < patch“.
thanks
I must be total noob at this, I kinda get how to build the kernel but how does ur partition change? im assuming u just make a second one and transfer your whole /?