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>
This commit is contained in:
Jaegeuk Kim
2017-05-10 11:18:25 -07:00
parent 81377bd628
commit a912b54d3a
7 changed files with 103 additions and 29 deletions

View File

@@ -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,