From: Jaegeuk Kim Date: Fri, 25 Jan 2019 18:26:39 +0000 (-0800) Subject: f2fs: don't wake up too frequently, if there is lots of IOs X-Git-Tag: Ubuntu-5.13.0-19.19~8940^2~35 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b460866d27089ffaf915a5a3340b4d8c9f079d33;p=mirror_ubuntu-jammy-kernel.git f2fs: don't wake up too frequently, if there is lots of IOs Otherwise, it wakes up discard thread which will sleep again by busy IOs in a loop. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index a77f76f528b6..5c7ed0442d6e 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -865,7 +865,7 @@ static inline void wake_up_discard_thread(struct f2fs_sb_info *sbi, bool force) } } mutex_unlock(&dcc->cmd_lock); - if (!wakeup) + if (!wakeup || !is_idle(sbi, DISCARD_TIME)) return; wake_up: dcc->discard_wake = 1;