diff options
author | 2019-12-24 09:14:29 -0700 | |
---|---|---|
committer | 2019-12-24 09:14:29 -0700 | |
commit | fd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c (patch) | |
tree | e0a9844d755b7ca81bee15fa3b15ea74208ce7f1 | |
parent | io-wq: remove unused busy list from io_sqe (diff) | |
download | linux-rng-fd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c.tar.xz linux-rng-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>
-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); |