diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-24 20:41:45 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-29 17:34:37 -0700 |
commit | 7a20b8a61eff81bdb7097a578752a74860e9d142 (patch) | |
tree | aebd2031eeea3771201126c0b4020e4f09d6a20a /fs/f2fs/gc.c | |
parent | c541a51b8ce81d003b02ed67ad3604a2e6220e3e (diff) | |
download | linux-7a20b8a61eff81bdb7097a578752a74860e9d142.tar.bz2 |
f2fs: allocate node and hot data in the beginning of partition
In order to give more spatial locality, this patch changes the block allocation
policy which assigns beginning of partition for small and hot data/node blocks.
In order to do this, we set noheap allocation by default and introduce another
mount option, heap, to reset it back.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 704bea678d37..63fefef04184 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -172,7 +172,11 @@ static void select_policy(struct f2fs_sb_info *sbi, int gc_type, if (gc_type != FG_GC && p->max_search > sbi->max_victim_search) p->max_search = sbi->max_victim_search; - p->offset = sbi->last_victim[p->gc_mode]; + /* let's select beginning hot/small space first */ + if (type == CURSEG_HOT_DATA || IS_NODESEG(type)) + p->offset = 0; + else + p->offset = sbi->last_victim[p->gc_mode]; } static unsigned int get_max_cost(struct f2fs_sb_info *sbi, |