diff options
author | Chao Yu <yuchao0@huawei.com> | 2021-02-22 18:07:33 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2021-03-12 13:16:42 -0800 |
commit | 43f8c47ea7d59c7b2270835f1d7c4618a1ea27b6 (patch) | |
tree | 1c056b5cf8b92c3fec9d733e6de555d36d2365e5 | |
parent | 3b42c741b1bf52ee9ed6fba5f9636d80ddacf73f (diff) | |
download | linux-43f8c47ea7d59c7b2270835f1d7c4618a1ea27b6.tar.bz2 |
f2fs: check discard command number before traversing discard pending list
In trim thread, let's add a condition to check discard command number
before traversing discard pending list, it can avoid unneeded traversing
if there is no discard command.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/segment.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 29403540ff6e..b5a40a39a03f 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1759,6 +1759,8 @@ static int issue_discard_thread(void *data) wait_ms = dpolicy.max_interval; continue; } + if (!atomic_read(&dcc->discard_cmd_cnt)) + continue; if (sbi->gc_mode == GC_URGENT_HIGH) __init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1); |