Commit fd1c4bc6 authored by Hillf Danton's avatar Hillf Danton Committed by Jens Axboe

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: default avatarHillf Danton <hdanton@sina.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1f424e8b
...@@ -429,6 +429,8 @@ static void io_worker_handle_work(struct io_worker *worker) ...@@ -429,6 +429,8 @@ static void io_worker_handle_work(struct io_worker *worker)
if (signal_pending(current)) if (signal_pending(current))
flush_signals(current); flush_signals(current);
cond_resched();
spin_lock_irq(&worker->lock); spin_lock_irq(&worker->lock);
worker->cur_work = work; worker->cur_work = work;
spin_unlock_irq(&worker->lock); spin_unlock_irq(&worker->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment