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-rc5 with ext4-patch-queue-c0b6ba2e0caf921b1f935c59d0f35538a30a2307 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.51
42.68
56.47

-I 256
data=writeback 35.07
37.46
55.88
xfs "defaults" 65.01
37.27
1.97
ext4
-I 256 "defaults" 30.44
44.57
58.26 (1)

-I 256
-O uninit_groups
"defaults" 30.68
41.64
1.82
-I 256
-O uninit_groups
data=writeback 30.29
35.77
1.71
-I 256
-O uninit_groups
data=writeback,
nomballoc
35.10
64.88 (2)
1.88
-I 256
-O uninit_groups
data=writeback,
nomballoc,
nodelalloc
34.41
43.35
5.16 (3)
-I 256
-O uninit_groups
data=writeback,
 i_version
31.41
35.92
1.71
-I 256
-O uninit_groups
data=writeback,
i_version,
journal_checksum
31.02
36.28
1.71
-I 256
-O uninit_groups
data=writeback,
i_version,
journal_async_
commit
30.27
35.73
(option
journal_async_
commit
not recognized)


(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-rc5 + ext4-patch-queue-c0b6ba2e0caf921b1f935c59d0f35538a30a2307 + "Flex_BG ialloc awareness V2" patch:

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

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
ext4
-I 256
-O uninit_groups,flex_bg
-G 64
data=writeback 29.37 31.52 1.63
-I 256
-O uninit_groups,flex_bg,lazy_bg
-G 64
data=writeback 30.83
31.64
1.57
-I 256
-O uninit_groups
,flex_bg,lazy_bg
-G 64
data=writeback,
nomballoc
29.65
32.16
2.16
-I 256
-O uninit_groups
,flex_bg,lazy_bg
-G 64
data=writeback,
nomballoc,
nodelalloc
32.24
37.13
4.80
-I 256
-O uninit_groups
,flex_bg,lazy_bg
-G 64
data=writeback,
i_version,
journal_checksum
30.07
31.42
1.55
-I 256
-O uninit_groups
,flex_bg,lazy_bg
-G 64
data=writeback,
i_version,
journal_async_
commit
29.57
31.92
-