linux-stable/fs/f2fs
Chao Yu 718e53fa63 f2fs: enhance foreground GC
If we configure section consist of multiple segments, foreground GC will
do the garbage collection with following approach:

	for each segment in victim section
		blk_start_plug
		for each valid block in segment
			write out by OPU method
		submit bio cache   <---
		blk_finish_plug   <---

There are two issue:
1) for most of the time, 'submit bio cache' will break the merging in
current bio buffer from writes of next segments, making a smaller bio
submitting.
2) block plug only cover IO submitting in one segment, which reduce
opportunity of merging IOs in plug with multiple segments.

So refactor the code as below structure to strive for biggest
opportunity of merging IOs:

	blk_start_plug
	for each segment in victim section
		for each valid block in segment
			write out by OPU method
	submit bio cache
	blk_finish_plug

Test method:
1. mkfs.f2fs -s 8 /dev/sdX
2. touch 32 files
3. write 2M data into each file
4. punch 1.5M data from offset 0 for each file
5. trigger foreground gc through ioctl

Before patch, there are totoally 40 bios submitted.
f2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 65536, size = 122880
f2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 65776, size = 122880
f2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 66016, size = 122880
f2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 66256, size = 122880
f2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 66496, size = 32768
----repeat for 8 times

After patch, there are totally 35 bios submitted.
f2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 65536, size = 122880
----repeat 34 times
f2fs_submit_write_bio: dev = (8,32), WRITE_SYNC, DATA, sector = 73696, size = 16384

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2016-02-22 16:07:23 -08:00
..
acl.c f2fs: make posix_acl_create() safer and cleaner 2015-05-07 11:38:31 -07:00
acl.h f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00
checkpoint.c f2fs: introduce time and interval facility 2016-01-11 15:36:27 -08:00
crypto.c f2fs crypto: add alloc_bounce_page 2015-06-11 15:04:20 -07:00
crypto_fname.c f2fs crypto: clean up error handling in f2fs_fname_setup_filename 2015-06-01 16:21:08 -07:00
crypto_key.c KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
crypto_policy.c f2fs crypto: do not set encryption policy for non-directory by ioctl 2015-06-01 16:21:07 -07:00
data.c f2fs: don't need to call set_page_dirty for io error 2016-02-22 16:07:23 -08:00
debug.c Merge tag 'for-f2fs-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs 2016-01-13 21:01:44 -08:00
dir.c f2fs: detect idle time depending on user behavior 2016-01-11 15:56:37 -08:00
extent_cache.c f2fs: skip releasing nodes in chindless extent tree 2016-01-08 11:57:18 -08:00
f2fs.h f2fs: export dirty_nats_ratio in sysfs 2016-02-22 16:07:23 -08:00
f2fs_crypto.h f2fs crypto: remove alloc_page for bounce_page 2015-06-01 16:21:10 -07:00
file.c wrappers for ->i_mutex access 2016-01-22 18:04:28 -05:00
gc.c f2fs: enhance foreground GC 2016-02-22 16:07:23 -08:00
gc.h f2fs: detect idle time depending on user behavior 2016-01-11 15:56:37 -08:00
hash.c f2fs: introduce dot and dotdot name check 2015-05-28 15:41:34 -07:00
inline.c f2fs: avoid multiple node page writes due to inline_data 2016-02-22 16:07:23 -08:00
inode.c f2fs: avoid multiple node page writes due to inline_data 2016-02-22 16:07:23 -08:00
Kconfig f2fs: fix typo 2015-08-21 22:43:32 -07:00
Makefile f2fs: maintain extent cache in separated file 2015-08-04 14:09:58 -07:00
namei.c Merge tag 'for-f2fs-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs 2016-01-13 21:01:44 -08:00
node.c f2fs: avoid multiple node page writes due to inline_data 2016-02-22 16:07:23 -08:00
node.h f2fs: avoid multiple node page writes due to inline_data 2016-02-22 16:07:23 -08:00
recovery.c f2fs: report error of do_checkpoint 2015-12-30 10:14:09 -08:00
segment.c f2fs: correct search area in get_new_segment 2016-02-22 16:07:23 -08:00
segment.h Revert "f2fs: do not skip dentry block writes" 2015-10-12 13:38:02 -07:00
shrinker.c f2fs: speed up shrinking extent tree entries 2015-12-30 10:13:00 -08:00
super.c f2fs: export dirty_nats_ratio in sysfs 2016-02-22 16:07:23 -08:00
trace.c f2fs: add sbi and page pointer in f2fs_io_info 2015-05-28 15:41:32 -07:00
trace.h f2fs: add sbi and page pointer in f2fs_io_info 2015-05-28 15:41:32 -07:00
xattr.c Merge tag 'for-f2fs-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs 2016-01-13 21:01:44 -08:00
xattr.h vfs: Distinguish between full xattr names and proper prefixes 2015-12-06 21:33:52 -05:00