diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-04-02 02:34:36 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-04-06 20:50:58 -0400 |
commit | 6b4afdd794783fe515b50838aa36591e3feea990 (patch) | |
tree | 5f35f32e27db8deaf248cf1e7a4930aab0822a73 /fs/f2fs/f2fs.h | |
parent | ce23447fe5764391025a67c20c97eaf5c6ac1ec3 (diff) |
f2fs: introduce f2fs_issue_flush to avoid redundant flush issue
Some storage devices show relatively high latencies to complete cache_flush
commands, even though their normal IO speed is prettry much high. In such
the case, it needs to merge cache_flush commands as much as possible to avoid
issuing them redundantly.
So, this patch introduces a mount option, "-o flush_merge", to mitigate such
the overhead.
If this option is enabled by user, F2FS merges the cache_flush commands and then
issues just one cache_flush on behalf of them. Once the single command is
finished, F2FS sends a completion signal to all the pending threads.
Note that, this option can be used under a workload consisting of very intensive
concurrent fsync calls, while the storage handles cache_flush commands slowly.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 1e3d869b60cd..2ecac8312359 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #define F2FS_MOUNT_DISABLE_EXT_IDENTIFY 0x00000040 | 40 | #define F2FS_MOUNT_DISABLE_EXT_IDENTIFY 0x00000040 |
41 | #define F2FS_MOUNT_INLINE_XATTR 0x00000080 | 41 | #define F2FS_MOUNT_INLINE_XATTR 0x00000080 |
42 | #define F2FS_MOUNT_INLINE_DATA 0x00000100 | 42 | #define F2FS_MOUNT_INLINE_DATA 0x00000100 |
43 | #define F2FS_MOUNT_FLUSH_MERGE 0x00000200 | ||
43 | 44 | ||
44 | #define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option) | 45 | #define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option) |
45 | #define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option) | 46 | #define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option) |
@@ -316,6 +317,12 @@ enum { | |||
316 | NO_CHECK_TYPE | 317 | NO_CHECK_TYPE |
317 | }; | 318 | }; |
318 | 319 | ||
320 | struct flush_cmd { | ||
321 | struct flush_cmd *next; | ||
322 | struct completion wait; | ||
323 | int ret; | ||
324 | }; | ||
325 | |||
319 | struct f2fs_sm_info { | 326 | struct f2fs_sm_info { |
320 | struct sit_info *sit_info; /* whole segment information */ | 327 | struct sit_info *sit_info; /* whole segment information */ |
321 | struct free_segmap_info *free_info; /* free segment information */ | 328 | struct free_segmap_info *free_info; /* free segment information */ |
@@ -344,6 +351,14 @@ struct f2fs_sm_info { | |||
344 | 351 | ||
345 | unsigned int ipu_policy; /* in-place-update policy */ | 352 | unsigned int ipu_policy; /* in-place-update policy */ |
346 | unsigned int min_ipu_util; /* in-place-update threshold */ | 353 | unsigned int min_ipu_util; /* in-place-update threshold */ |
354 | |||
355 | /* for flush command control */ | ||
356 | struct task_struct *f2fs_issue_flush; /* flush thread */ | ||
357 | wait_queue_head_t flush_wait_queue; /* waiting queue for wake-up */ | ||
358 | struct flush_cmd *issue_list; /* list for command issue */ | ||
359 | struct flush_cmd *dispatch_list; /* list for command dispatch */ | ||
360 | spinlock_t issue_lock; /* for issue list lock */ | ||
361 | struct flush_cmd *issue_tail; /* list tail of issue list */ | ||
347 | }; | 362 | }; |
348 | 363 | ||
349 | /* | 364 | /* |
@@ -1160,6 +1175,7 @@ void destroy_node_manager_caches(void); | |||
1160 | */ | 1175 | */ |
1161 | void f2fs_balance_fs(struct f2fs_sb_info *); | 1176 | void f2fs_balance_fs(struct f2fs_sb_info *); |
1162 | void f2fs_balance_fs_bg(struct f2fs_sb_info *); | 1177 | void f2fs_balance_fs_bg(struct f2fs_sb_info *); |
1178 | int f2fs_issue_flush(struct f2fs_sb_info *); | ||
1163 | void invalidate_blocks(struct f2fs_sb_info *, block_t); | 1179 | void invalidate_blocks(struct f2fs_sb_info *, block_t); |
1164 | void refresh_sit_entry(struct f2fs_sb_info *, block_t, block_t); | 1180 | void refresh_sit_entry(struct f2fs_sb_info *, block_t, block_t); |
1165 | void clear_prefree_segments(struct f2fs_sb_info *); | 1181 | void clear_prefree_segments(struct f2fs_sb_info *); |