summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHillf Danton <hdanton@sina.com>2019-12-24 09:14:29 -0700
committerJens Axboe <axboe@kernel.dk>2019-12-24 09:14:29 -0700
commitfd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c (patch)
treee0a9844d755b7ca81bee15fa3b15ea74208ce7f1 /fs
parent1f424e8bd18754d27b15f49359004b0cea344fb5 (diff)
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.c2
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);