Kernel Build Tests: comparison of ext3, ext4 and xfs


Test bed:

 Tests are done on a bi-Xeon machine with 2G of RAM and with hyper-threading enabled (4 CPUs).
processor      : 4
vendor_id      : GenuineIntel
cpu family     : 15
model          : 4
model name     : Intel(R) Xeon(TM) CPU 2.80GHz
cpu MHz        : 2793.078
cache size     : 1024 KB
bogomips       : 5586.59

Partition size: 68 GB (sdc1) SCSI ultra320 10 000rpm
# hdparm -t /dev/sdc1
/dev/sdc1:
 Timing buffered disk reads:  202 MB in  3.01 seconds =  67.10 MB/sec

Synopsis:

The partition used is formated with mkfs and mounted with appropriate options before each run.
The script used is a kernel build sequence:
cp /home/linux.tar.bz2  .
/usr/bin/time -f "%e" sh -c "tar xjf linux.tar.bz2 && sync"
/usr/bin/time -f "%e" sh -c "make defconfig && make -j8"

After the kernel build,  read all files
umount, mount the filesystem # to flush the caches #
/usr/bin/time -f "%e" tar cf /dev/zero linux

Then run e2fsck on the filesystem (xfs_check for xfs filesystem)
umount the filesystem
/usr/bin/time -f "%e" e2fsck -fy /dev/sdc1


Results

The following table summarizes the results for each filesystem. All numbers represent the average of three tests.
Kernel compilation time is not reported here as it is constant whatever the filesystems and options. For the other commands, the elapsed real time is in seconds.


Kernel: 2.6.24-rc7 with ext4-patch-queue-1c8a83f26e0cc09c42414558f5f6a26c582ce8b2 applied:

Elapsed real time in seconds of "tar xf", "tar cf" and fsck commands

mkfs options
mount options   tar xjf
linux.tar.bz2 
  tar cf linux    
 fsck
ext3
-I 256
32.68
41.56
56.78

-I 256
data=writeback 35.27
39.47
56.42
xfs "defaults" 64.50
37.66
2.04
ext4
-I 256 "defaults" 30.65
34.30
58.41 (1)

-I 256
-O uninit_groups
"defaults" 31.01
37.41
1.84
-I 256
-O uninit_groups
data=writeback 30.96
37.62
1.81
-I 256
-O uninit_groups
data=writeback,
nomballoc
33.92
53.99 (2)
2.00
-I 256
-O uninit_groups
data=writeback,
nomballoc,
nodelalloc
34.25
46.67
5.47 (3)
-I 256
-O uninit_groups
data=writeback,
 i_version
31.44
39.01
1.80
-I 256
-O uninit_groups
data=writeback,
i_version,
journal_checksum
31.28
36.58
1.80
-I 256
-O uninit_groups
data=writeback,
i_version,
journal_async_
commit
31.55
36.83
(option
journal_async_
commit
not recognized)
-I 256
-O uninit_groups
nodelalloc 31.37 53.47 2.24


(1) This value compared to the others below shows the speedup gained by using the uninitialized block groups feature.

(2) See http://marc.info/?l=linux-ext4&m=119365211419498&w=2

(3) When mount options are "data=writeback, nodelalloc, nomballoc", e2fsck reports:
/dev/sdc1: 27939/8936928 files (3.9% non-contiguous), 725683/17871210 blocks
    When mount options are "data=writeback", e2fsck reports:
/dev/sdc1: 27939/8936928 files (0.1% non-contiguous), 725605/17871210 blocks


Kernel: 2.6.24-rc7 + ext4-patch-queue-1c8a83f26e0cc09c42414558f5f6a26c582ce8b2 + "Flex_BG ialloc awareness V2" patch:

Random kernel crashes in investigation (occur mainly in the slab allocator code, no call to ext4 functions in the stack trace).