summaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-05-10 21:18:25 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2017-05-24 07:05:39 +0300
commita912b54d3aaa011266dc266e3694f782f27233cf (patch)
treea79d1016b655cb27cab2889365575a2f3cd53c85 /fs/f2fs/segment.c
parent81377bd62837c8113b1c49c5dfa6b1af8f9ee5c2 (diff)
downloadlinux-a912b54d3aaa011266dc266e3694f782f27233cf.tar.xz
f2fs: split bio cache
Split DATA/NODE type bio cache according to different temperature, so write IOs with the same temperature can be merged in corresponding bio cache as much as possible, otherwise, different temperature write IOs submitting into one bio cache will always cause split of bio. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c9f3a2faee21..fcada9d03817 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2084,17 +2084,29 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
static int __get_segment_type(struct f2fs_io_info *fio)
{
+ int type = 0;
+
switch (fio->sbi->active_logs) {
case 2:
- return __get_segment_type_2(fio);
+ type = __get_segment_type_2(fio);
+ break;
case 4:
- return __get_segment_type_4(fio);
+ type = __get_segment_type_4(fio);
+ break;
+ case 6:
+ type = __get_segment_type_6(fio);
+ break;
+ default:
+ f2fs_bug_on(fio->sbi, true);
}
- /* NR_CURSEG_TYPE(6) logs by default */
- f2fs_bug_on(fio->sbi, fio->sbi->active_logs != NR_CURSEG_TYPE);
-
- return __get_segment_type_6(fio);
+ if (IS_HOT(type))
+ fio->temp = HOT;
+ else if (IS_WARM(type))
+ fio->temp = WARM;
+ else
+ fio->temp = COLD;
+ return type;
}
void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,