aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-03-24 20:41:45 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2017-03-29 17:34:37 -0700
commit7a20b8a61eff81bdb7097a578752a74860e9d142 (patch)
treeaebd2031eeea3771201126c0b4020e4f09d6a20a /fs/f2fs/gc.c
parentf2fs: fix wrong max cost initialization (diff)
downloadlinux-dev-7a20b8a61eff81bdb7097a578752a74860e9d142.tar.xz
linux-dev-7a20b8a61eff81bdb7097a578752a74860e9d142.zip
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.c6
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,