]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
f2fs: don't wake up too frequently, if there is lots of IOs
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 25 Jan 2019 18:26:39 +0000 (10:26 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 16 Feb 2019 04:59:45 +0000 (20:59 -0800)
Otherwise, it wakes up discard thread which will sleep again by busy IOs
in a loop.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.h

index a77f76f528b61597c3ebce03c18d05ff1f25ef74..5c7ed0442d6e25dd08caa73efb4a506ecfd2d894 100644 (file)
@@ -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;