OSDN Git Service

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>
Mon, 1 Oct 2018 01:42:50 +0000 (18:42 -0700)
commitf847c699cff3f050286ee0a08632046468e7a511
tree030956a695c5806406fab3571511d93bed2f6381
parent39a8695824510a951ded696d69b8dea3c720b109
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