author: Jens Axboe <axboe@kernel.dk> 2021-03-21 07:06:56 -0600
committer: Jens Axboe <axboe@kernel.dk> 2021-03-21 09:41:14 -0600
commit: 00ddff431a458bbf143ea7c4c42d022676da1b17
parent: 4db4b1a0d1779dc159f7b87feb97030ec0b12597
Commit Summary:
Diffstat:
1 file changed, 6 insertions, 2 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c
index e05f996d088f..3dc10bfd8c3b 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -386,13 +386,16 @@ static struct io_wq_work *io_get_next_work(struct io_wqe *wqe)
return NULL;
}
-static void io_flush_signals(void)
+static bool io_flush_signals(void)
{
if (unlikely(test_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL))) {
+ __set_current_state(TASK_RUNNING);
if (current->task_works)
task_work_run();
clear_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL);
+ return true;
}
+ return false;
}
static void io_assign_current_work(struct io_worker *worker,
@@ -499,7 +502,8 @@ loop:
}
__io_worker_idle(wqe, worker);
raw_spin_unlock_irq(&wqe->lock);
- io_flush_signals();
+ if (io_flush_signals())
+ continue;
ret = schedule_timeout(WORKER_IDLE_TIMEOUT);
if (try_to_freeze() || ret)
continue;