f2fs: allow out-place-update for direct IO in LFS mode
authorChao Yu <yuchao0@huawei.com>
Thu, 27 Sep 2018 10:34:52 +0000 (18:34 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 26 Oct 2018 18:23:52 +0000 (11:23 -0700)
commit4d28ef1c541531fe590c487a395377cc55589d2c
tree1dd41b5e155f9ec4ea1adc4f475a2613a436731a
parente2c2e182ee35da9e3303db681813b26f137a03ce
f2fs: allow out-place-update for direct IO in LFS mode

Normally, DIO uses in-pllace-update, but in LFS mode, f2fs doesn't
allow triggering any in-place-update writes, so we fallback direct
write to buffered write, result in bad performance of large size
write.

This patch adds to support triggering out-place-update for direct IO
to enhance its performance.

Note that it needs to exclude direct read IO during direct write,
since new data writing to new block address will no be valid until
write finished.

storage: zram

time xfs_io -f -d /mnt/f2fs/file -c "pwrite 0 1073741824" -c "fsync"

Before:
real 0m13.061s
user 0m0.327s
sys 0m12.486s

After:
real 0m6.448s
user 0m0.228s
sys 0m6.212s

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/file.c