mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
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>
This commit is contained in:
parent
6cd5fef390
commit
7688fb401d
|
|
@ -1759,6 +1759,8 @@ static int issue_discard_thread(void *data)
|
||||||
wait_ms = dpolicy.max_interval;
|
wait_ms = dpolicy.max_interval;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!atomic_read(&dcc->discard_cmd_cnt))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (sbi->gc_mode == GC_URGENT_HIGH)
|
if (sbi->gc_mode == GC_URGENT_HIGH)
|
||||||
__init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1);
|
__init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user