linux-stable/fs/f2fs
Chao Yu df6136ef55 f2fs: preallocate fallocated blocks for direct IO
Normally, due to DIO_SKIP_HOLES flag is set by default, blockdev_direct_IO in
f2fs_direct_IO tries to skip DIO in holes when writing inside i_size, this
makes us falling back to buffered IO which shows lower performance.

So in commit 59b802e5a4 ("f2fs: allocate data blocks in advance for
f2fs_direct_IO"), we improve perfromance by allocating data blocks in advance
if we meet holes no matter in i_size or not, since with it we can avoid falling
back to buffered IO.

But we forget to consider for unwritten fallocated block in this commit.
This patch tries to fix it for fallocate case, this helps to improve
performance.

Test result:
Storage info: sandisk ultra 64G micro sd card.

touch /mnt/f2fs/file
truncate -s 67108864 /mnt/f2fs/file
fallocate -o 0 -l 67108864 /mnt/f2fs/file
time dd if=/dev/zero of=/mnt/f2fs/file bs=1M count=64 conv=notrunc oflag=direct

Time before applying the patch:
67108864 bytes (67 MB) copied, 36.16 s, 1.9 MB/s
real    0m36.162s
user    0m0.000s
sys     0m0.180s

Time after applying the patch:
67108864 bytes (67 MB) copied, 27.7776 s, 2.4 MB/s
real    0m27.780s
user    0m0.000s
sys     0m0.036s

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2015-04-10 15:08:52 -07:00
..
acl.c f2fs: fix reference leaks in f2fs_acl_create 2015-04-10 15:08:40 -07:00
acl.h f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00
checkpoint.c f2fs: cleanup statement about max orphan inodes calc 2015-04-10 15:08:38 -07:00
data.c f2fs: preallocate fallocated blocks for direct IO 2015-04-10 15:08:52 -07:00
debug.c f2fs: add stat info for moved blocks by background gc 2015-04-10 15:08:32 -07:00
dir.c f2fs: fix to calculate max length of contiguous free slots correctly 2015-04-10 15:08:40 -07:00
f2fs.h f2fs: preserve extent info for extent cache 2015-04-10 15:08:51 -07:00
file.c f2fs: split set_data_blkaddr from f2fs_update_extent_cache 2015-04-10 15:08:49 -07:00
gc.c f2fs: add stat info for moved blocks by background gc 2015-04-10 15:08:32 -07:00
gc.h f2fs: fix sparse warnings 2015-02-11 17:04:49 -08:00
hash.c f2fs: fix wrong casting for dentry name 2014-08-29 00:26:50 -07:00
inline.c f2fs: split set_data_blkaddr from f2fs_update_extent_cache 2015-04-10 15:08:49 -07:00
inode.c f2fs: preserve extent info for extent cache 2015-04-10 15:08:51 -07:00
Kconfig f2fs: relocate Kconfig from misc filesystems 2015-04-10 15:08:35 -07:00
Makefile f2fs: add f2fs_io_tracer support 2015-01-09 17:02:24 -08:00
namei.c f2fs: fix incorrectly stat number of inline data inode 2015-03-03 09:58:45 -08:00
node.c f2fs: fix unlocked nat set cache operation 2015-04-10 15:08:39 -07:00
node.h f2fs: introduce infra macro and data structure of rb-tree extent cache 2015-03-03 09:58:46 -08:00
recovery.c f2fs: split set_data_blkaddr from f2fs_update_extent_cache 2015-04-10 15:08:49 -07:00
segment.c f2fs: add some tracepoints to debug volatile and atomic writes 2015-04-10 15:08:47 -07:00
segment.h f2fs: reduce searching region of segmap when set free section 2015-04-10 15:08:36 -07:00
super.c f2fs: enable inline data by default 2015-04-10 15:08:52 -07:00
trace.c f2fs: fix sparse warnings 2015-02-11 17:04:49 -08:00
trace.h f2fs: add f2fs_destroy_trace_ios to free radix tree 2015-01-09 17:02:28 -08:00
xattr.c f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00
xattr.h f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00