diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-12-13 20:50:51 -0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-01-02 16:17:41 -0800 |
| commit | 7beec23358c44d1c876141f4e6847c1ddf318ffb (patch) | |
| tree | b4833e148c0f97f46990fae17fcdced57fb3e391 /fs | |
| parent | 6f3ef9d3c43c59ac92745c33f34aebae1970d3d8 (diff) | |
f2fs: flush stale issued discard candidates
Sometimes, I could observe # of issuing_discard to be 1 which blocks background
jobs due to is_idle()=false.
The only way to get out of it was to trigger gc_urgent. This patch avoids that
by checking any candidates as done in the list.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/f2fs/segment.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index d674e9693d08..aa6b5fcf4567 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1728,6 +1728,10 @@ static int issue_discard_thread(void *data) if (dcc->discard_wake) dcc->discard_wake = 0; + /* clean up pending candidates before going to sleep */ + if (atomic_read(&dcc->queued_discard)) + __wait_all_discard_cmd(sbi, NULL); + if (try_to_freeze()) continue; if (f2fs_readonly(sbi->sb)) |
