f2fs: readahead contiguous SSA blocks for f2fs_gc
If there are multi segments in one section, we will read those SSA blocks which have contiguous address one by one in f2fs_gc. It may lost performance, let's read ahead SSA blocks by merge multi read request. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
parent
ab9fa662e4
commit
81c1a0f13e
@ -82,6 +82,7 @@ inline int get_max_meta_blks(struct f2fs_sb_info *sbi, int type)
|
|||||||
return NM_I(sbi)->max_nid / NAT_ENTRY_PER_BLOCK;
|
return NM_I(sbi)->max_nid / NAT_ENTRY_PER_BLOCK;
|
||||||
case META_SIT:
|
case META_SIT:
|
||||||
return SIT_BLK_CNT(sbi);
|
return SIT_BLK_CNT(sbi);
|
||||||
|
case META_SSA:
|
||||||
case META_CP:
|
case META_CP:
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
@ -90,7 +91,7 @@ inline int get_max_meta_blks(struct f2fs_sb_info *sbi, int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Readahead CP/NAT/SIT pages
|
* Readahead CP/NAT/SIT/SSA pages
|
||||||
*/
|
*/
|
||||||
int ra_meta_pages(struct f2fs_sb_info *sbi, int start, int nrpages, int type)
|
int ra_meta_pages(struct f2fs_sb_info *sbi, int start, int nrpages, int type)
|
||||||
{
|
{
|
||||||
@ -125,8 +126,9 @@ int ra_meta_pages(struct f2fs_sb_info *sbi, int start, int nrpages, int type)
|
|||||||
goto out;
|
goto out;
|
||||||
prev_blk_addr = blk_addr;
|
prev_blk_addr = blk_addr;
|
||||||
break;
|
break;
|
||||||
|
case META_SSA:
|
||||||
case META_CP:
|
case META_CP:
|
||||||
/* get cp block addr */
|
/* get ssa/cp block addr */
|
||||||
blk_addr = blkno;
|
blk_addr = blkno;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -89,12 +89,13 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For CP/NAT/SIT readahead
|
* For CP/NAT/SIT/SSA readahead
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
META_CP,
|
META_CP,
|
||||||
META_NAT,
|
META_NAT,
|
||||||
META_SIT
|
META_SIT,
|
||||||
|
META_SSA
|
||||||
};
|
};
|
||||||
|
|
||||||
/* for the list of orphan inodes */
|
/* for the list of orphan inodes */
|
||||||
|
@ -708,6 +708,11 @@ gc_more:
|
|||||||
goto stop;
|
goto stop;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
/* readahead multi ssa blocks those have contiguous address */
|
||||||
|
if (sbi->segs_per_sec > 1)
|
||||||
|
ra_meta_pages(sbi, GET_SUM_BLOCK(sbi, segno), sbi->segs_per_sec,
|
||||||
|
META_SSA);
|
||||||
|
|
||||||
for (i = 0; i < sbi->segs_per_sec; i++)
|
for (i = 0; i < sbi->segs_per_sec; i++)
|
||||||
do_garbage_collect(sbi, segno + i, &ilist, gc_type);
|
do_garbage_collect(sbi, segno + i, &ilist, gc_type);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user