提交 6c0002d3 编写于 作者: H Hillf Danton 提交者: Joseph Qi

io-wq: add cond_resched() to worker thread

to #26323578

commit fd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c upstream.

Reschedule the current IO worker to cut the risk that it is becoming
a cpu hog.
Signed-off-by: NHillf Danton <hdanton@sina.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
上级 35521a06
......@@ -430,6 +430,8 @@ static void io_worker_handle_work(struct io_worker *worker)
if (signal_pending(current))
flush_signals(current);
cond_resched();
spin_lock_irq(&worker->lock);
worker->cur_work = work;
spin_unlock_irq(&worker->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册