summaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-09-10 16:53:02 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2014-09-16 04:10:44 -0700
commitc1ce1b02bb25640567dc484dc94d3a195d21e705 (patch)
tree66d98ac24b6959a78618b1706f156f8f76614ad8 /fs/f2fs/segment.h
parenta7ffdbe22cecaed59b5d76a5f003d68907d64240 (diff)
f2fs: give an option to enable in-place-updates during fsync to users
If user wrote F2FS_IPU_FSYNC:4 in /sys/fs/f2fs/ipu_policy, f2fs_sync_file only starts to try in-place-updates. And, if the number of dirty pages is over /sys/fs/f2fs/min_fsync_blocks, it keeps out-of-order manner. Otherwise, it triggers in-place-updates. This may be used by storage showing very high random write performance. For example, it can be used when, Seq. writes (Data) + wait + Seq. writes (Node) is pretty much slower than, Rand. writes (Data) Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index bed0dc967f29..013aed2f3539 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -472,15 +472,20 @@ static inline int utilization(struct f2fs_sb_info *sbi)
* F2FS_IPU_UTIL - if FS utilization is over threashold,
* F2FS_IPU_SSR_UTIL - if SSR mode is activated and FS utilization is over
* threashold,
+ * F2FS_IPU_FSYNC - activated in fsync path only for high performance flash
+ * storages. IPU will be triggered only if the # of dirty
+ * pages over min_fsync_blocks.
* F2FS_IPUT_DISABLE - disable IPU. (=default option)
*/
#define DEF_MIN_IPU_UTIL 70
+#define DEF_MIN_FSYNC_BLOCKS 8
enum {
F2FS_IPU_FORCE,
F2FS_IPU_SSR,
F2FS_IPU_UTIL,
F2FS_IPU_SSR_UTIL,
+ F2FS_IPU_FSYNC,
F2FS_IPU_DISABLE,
};
@@ -492,10 +497,6 @@ static inline bool need_inplace_update(struct inode *inode)
if (S_ISDIR(inode->i_mode))
return false;
- /* this is only set during fdatasync */
- if (is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU))
- return true;
-
switch (SM_I(sbi)->ipu_policy) {
case F2FS_IPU_FORCE:
return true;
@@ -511,6 +512,11 @@ static inline bool need_inplace_update(struct inode *inode)
if (need_SSR(sbi) && utilization(sbi) > SM_I(sbi)->min_ipu_util)
return true;
break;
+ case F2FS_IPU_FSYNC:
+ /* this is only set during fdatasync */
+ if (is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU))
+ return true;
+ break;
case F2FS_IPU_DISABLE:
break;
}