Skip to content

Commit fd1c4bc

Browse files
Hillf Dantonaxboe
authored andcommitted
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 1f424e8 commit fd1c4bc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/io-wq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ static void io_worker_handle_work(struct io_worker *worker)
429429
if (signal_pending(current))
430430
flush_signals(current);
431431

432+
cond_resched();
433+
432434
spin_lock_irq(&worker->lock);
433435
worker->cur_work = work;
434436
spin_unlock_irq(&worker->lock);

0 commit comments

Comments
 (0)