diff options
author | Hillf Danton <hdanton@sina.com> | 2019-12-24 17:14:29 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-12-24 17:14:29 +0100 |
commit | fd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c (patch) | |
tree | e0a9844d755b7ca81bee15fa3b15ea74208ce7f1 /fs | |
parent | io-wq: remove unused busy list from io_sqe (diff) | |
download | linux-fd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c.tar.xz linux-fd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c.zip |
io-wq: add cond_resched() to worker thread
Reschedule the current IO worker to cut the risk that it is becoming
a cpu hog.
Signed-off-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io-wq.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c index a1c85458f021..541c8a3e0bbb 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -429,6 +429,8 @@ next: if (signal_pending(current)) flush_signals(current); + cond_resched(); + spin_lock_irq(&worker->lock); worker->cur_work = work; spin_unlock_irq(&worker->lock); |