Slower performance with ext4

Amedee Van Gasse (ub) amedee-ubuntu at amedee.be
Fri Oct 30 23:27:10 UTC 2009


On Fri, October 30, 2009 11:58, fyrbrds at netscape.net wrote:
>
>
>   >Data loss anyone?<
> What evidence do you have that there would be data loss?

Ext4 uses a filesystem performance technique called allocate-on-flush,
also known as delayed allocation. It consists of delaying block allocation
until the data is going to be written to the disk, unlike some other file
systems, which may allocate the necessary blocks before that step. This
improves performance and reduces fragmentation by improving block
allocation decisions based on the actual file size.

Delayed allocation poses some additional risk of data loss in cases where
the system crashes before all of the data has been written to the disk.

The typical scenario in which this might occur is a program replacing the
contents of a file without forcing a write to the disk with fsync.
Problems can arise if the system crashes before the actual write occurs.
In this situation, users of ext3 have come to expect that the disk will
hold either the old version or the new version of the file following the
crash. However, the ext4 code in the Linux kernel version 2.6.28 will
often clear the contents of the file before the crash, but never write the
new version, thus losing the contents of the file entirely.

Altering this behavior by using fsync more often could lead to severe
performance penalties on ext3 filesystems mounted with the data=ordered
flag (the default on most Linux distributions). Given that both
file-systems will be in use for some time, this complicates matters
enormously for end-user application developers. In response, Theodore Ts'o
has written some patches for ext4 that cause it to limit its delayed
allocation in these common cases. For a small cost in performance, this
will significantly increase the chance that either version of the file
will survive the crash.

The new patches are expected to become part of the mainline kernel 2.6.30.
Various distributions may choose to backport them to 2.6.28 or 2.6.29, for
instance Ubuntu made them part of the 2.6.28 kernel in version 9.04—Jaunty
Jackalope.

(from Wikipedia)






More information about the ubuntu-users mailing list