]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: optimize ext4_ext_convert_to_initialized()
authorEric Gouriou <egouriou@google.com>
Thu, 27 Oct 2011 15:43:23 +0000 (11:43 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 27 Oct 2011 15:43:23 +0000 (11:43 -0400)
commit864d216529d7962ed9161ae9a54e58a7b53b849a
tree61f6664dc277dac16d2c0656822c0d96ed9d635d
parent446066724c3629664e29942a00b0aee0d6b1663a
ext4: optimize ext4_ext_convert_to_initialized()

This patch introduces a fast path in ext4_ext_convert_to_initialized()
for the case when the conversion can be performed by transferring
the newly initialized blocks from the uninitialized extent into
an adjacent initialized extent. Doing so removes the expensive
invocations of memmove() which occur during extent insertion and
the subsequent merge.

In practice this should be the common case for clients performing
append writes into files pre-allocated via
fallocate(FALLOC_FL_KEEP_SIZE). In such a workload performed via
direct IO and when using a suboptimal implementation of memmove()
(x86_64 prior to the 2.6.39 rewrite), this patch reduces kernel CPU
consumption by 32%.

Two new trace points are added to ext4_ext_convert_to_initialized()
to offer visibility into its operations. No exit trace point has
been added due to the multiplicity of return points. This can be
revisited once the upstream cleanup is backported.

Signed-off-by: Eric Gouriou <egouriou@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c
fs/ext4/super.c
include/trace/events/ext4.h