linux/fs/f2fs
Chao Yu 184a5cd2ce f2fs: refactor flush_sit_entries codes for reducing SIT writes
In commit aec71382c6 ("f2fs: refactor flush_nat_entries codes for reducing NAT
writes"), we descripte the issue as below:

"Although building NAT journal in cursum reduce the read/write work for NAT
block, but previous design leave us lower performance when write checkpoint
frequently for these cases:
1. if journal in cursum has already full, it's a bit of waste that we flush all
   nat entries to page for persistence, but not to cache any entries.
2. if journal in cursum is not full, we fill nat entries to journal util
   journal is full, then flush the left dirty entries to disk without merge
   journaled entries, so these journaled entries may be flushed to disk at next
   checkpoint but lost chance to flushed last time."

Actually, we have the same problem in using SIT journal area.

In this patch, firstly we will update sit journal with dirty entries as many as
possible. Secondly if there is no space in sit journal, we will remove all
entries in journal and walk through the whole dirty entry bitmap of sit,
accounting dirty sit entries located in same SIT block to sit entry set. All
entry sets are linked to list sit_entry_set in sm_info, sorted ascending order
by count of entries in set. Later we flush entries in set which have fewest
entries into journal as many as we can, and then flush dense set with merged
entries to disk.

In this way we can use sit journal area more effectively, also we will reduce
SIT update, result in gaining in performance and saving lifetime of flash
device.

In my testing environment, it shows this patch can help to reduce SIT block
update obviously.

virtual machine + hard disk:
fsstress -p 20 -n 400 -l 5
		sit page num	cp count	sit pages/cp
based		2006.50		1349.75		1.486
patched		1566.25		1463.25		1.070

Our latency of merging op is small when handling a great number of dirty SIT
entries in flush_sit_entries:
latency(ns)	dirty sit count
36038		2151
49168		2123
37174		2232

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2014-09-09 13:15:05 -07:00
..
acl.c f2fs: remove the redundant validation check of acl 2014-07-09 14:04:25 -07:00
acl.h f2fs: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
checkpoint.c f2fs: need fsck.f2fs when f2fs_bug_on is triggered 2014-09-09 13:15:02 -07:00
data.c f2fs: need fsck.f2fs when f2fs_bug_on is triggered 2014-09-09 13:15:02 -07:00
debug.c f2fs: fix typo 2014-08-19 10:01:33 -07:00
dir.c f2fs: need fsck.f2fs when f2fs_bug_on is triggered 2014-09-09 13:15:02 -07:00
f2fs.h f2fs: refactor flush_sit_entries codes for reducing SIT writes 2014-09-09 13:15:05 -07:00
file.c f2fs: need fsck.f2fs when f2fs_bug_on is triggered 2014-09-09 13:15:02 -07:00
gc.c f2fs: reposition unlock_new_inode to prevent accessing invalid inode 2014-09-02 00:22:24 -07:00
gc.h f2fs: fix typo 2014-08-19 10:01:33 -07:00
hash.c f2fs: fix wrong casting for dentry name 2014-08-29 00:26:50 -07:00
inline.c f2fs: need fsck.f2fs when f2fs_bug_on is triggered 2014-09-09 13:15:02 -07:00
inode.c f2fs: need fsck.f2fs when f2fs_bug_on is triggered 2014-09-09 13:15:02 -07:00
Kconfig f2fs: fix typo 2014-08-19 10:01:33 -07:00
Makefile f2fs: key functions to handle inline data 2013-12-26 20:40:09 +09:00
namei.c f2fs: introduce F2FS_I_SB, F2FS_M_SB, and F2FS_P_SB 2014-09-03 17:37:13 -07:00
node.c f2fs: refactor flush_sit_entries codes for reducing SIT writes 2014-09-09 13:15:05 -07:00
node.h f2fs: introduce F2FS_I_SB, F2FS_M_SB, and F2FS_P_SB 2014-09-03 17:37:13 -07:00
recovery.c f2fs: need fsck.f2fs when f2fs_bug_on is triggered 2014-09-09 13:15:02 -07:00
segment.c f2fs: refactor flush_sit_entries codes for reducing SIT writes 2014-09-09 13:15:05 -07:00
segment.h f2fs: refactor flush_sit_entries codes for reducing SIT writes 2014-09-09 13:15:05 -07:00
super.c f2fs: need fsck.f2fs if the recovery was failed 2014-09-09 13:15:04 -07:00
xattr.c f2fs: need fsck.f2fs when f2fs_bug_on is triggered 2014-09-09 13:15:02 -07:00
xattr.h f2fs: pass flags field to setxattr functions 2014-05-07 10:21:56 +09:00