diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-25 01:05:13 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-04-05 20:05:05 +0200 |
commit | ef095d19e82f25bbdead472b8b71f4ef3b7a636d (patch) | |
tree | 2eb2262bb5ef4baa05b44d592bf30e4c8872cd72 /fs/f2fs/segment.c | |
parent | f2fs: use bitmap in discard_entry (diff) | |
download | linux-ef095d19e82f25bbdead472b8b71f4ef3b7a636d.tar.xz linux-ef095d19e82f25bbdead472b8b71f4ef3b7a636d.zip |
f2fs: write small sized IO to hot log
It would better split small and large IOs separately in order to get more
consecutive big writes.
The default threshold is set to 64KB, but configurable by sysfs/min_hot_blocks.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 12d2aa7032bb..b749cff59420 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1829,18 +1829,16 @@ static int __get_segment_type_6(struct page *page, enum page_type p_type) if (p_type == DATA) { struct inode *inode = page->mapping->host; - if (S_ISDIR(inode->i_mode)) - return CURSEG_HOT_DATA; - else if (is_cold_data(page) || file_is_cold(inode)) + if (is_cold_data(page) || file_is_cold(inode)) return CURSEG_COLD_DATA; - else - return CURSEG_WARM_DATA; + if (is_inode_flag_set(inode, FI_HOT_DATA)) + return CURSEG_HOT_DATA; + return CURSEG_WARM_DATA; } else { if (IS_DNODE(page)) return is_cold_node(page) ? CURSEG_WARM_NODE : CURSEG_HOT_NODE; - else - return CURSEG_COLD_NODE; + return CURSEG_COLD_NODE; } } @@ -2947,6 +2945,7 @@ int build_segment_manager(struct f2fs_sb_info *sbi) sm_info->ipu_policy = 1 << F2FS_IPU_FSYNC; sm_info->min_ipu_util = DEF_MIN_IPU_UTIL; sm_info->min_fsync_blocks = DEF_MIN_FSYNC_BLOCKS; + sm_info->min_hot_blocks = DEF_MIN_HOT_BLOCKS; sm_info->trim_sections = DEF_BATCHED_TRIM_SECTIONS; |