f2fs: delay awaking discard thread

It's better to delay awaking discard thread while queuing discard commands
in checkpoint, it will help to give more chances for merging big and small
discard.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Chao Yu 2017-04-25 00:21:34 +08:00 committed by Jaegeuk Kim
parent 9933f6e186
commit e7a9ce2e7c

View file

@ -1047,7 +1047,6 @@ static int __queue_discard_cmd(struct f2fs_sb_info *sbi,
blkstart -= FDEV(devi).start_blk; blkstart -= FDEV(devi).start_blk;
} }
__update_discard_tree_range(sbi, bdev, lblkstart, blkstart, blklen); __update_discard_tree_range(sbi, bdev, lblkstart, blkstart, blklen);
wake_up(&SM_I(sbi)->dcc_info->discard_wait_queue);
return 0; return 0;
} }
@ -1414,6 +1413,8 @@ skip:
SM_I(sbi)->dcc_info->nr_discards -= total_len; SM_I(sbi)->dcc_info->nr_discards -= total_len;
kmem_cache_free(discard_entry_slab, entry); kmem_cache_free(discard_entry_slab, entry);
} }
wake_up(&SM_I(sbi)->dcc_info->discard_wait_queue);
} }
static int create_discard_cmd_control(struct f2fs_sb_info *sbi) static int create_discard_cmd_control(struct f2fs_sb_info *sbi)