From: Hillf Danton Date: Tue, 24 Dec 2019 16:14:29 +0000 (-0700) Subject: io-wq: add cond_resched() to worker thread X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c;p=linux.git 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 Signed-off-by: Jens Axboe --- diff --git a/fs/io-wq.c b/fs/io-wq.c index a1c85458f021a..541c8a3e0bbb5 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);