summaryrefslogtreecommitdiffstats
path: root/io_uring/io-wq.c
diff options
context:
space:
mode:
Diffstat (limited to 'io_uring/io-wq.c')
-rw-r--r--io_uring/io-wq.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 318ed067db..522196dfb0 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -564,7 +564,10 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
* clear the stalled flag.
*/
work = io_get_next_work(acct, worker);
+ raw_spin_unlock(&acct->lock);
if (work) {
+ __io_worker_busy(wq, worker);
+
/*
* Make sure cancelation can find this, even before
* it becomes the active work. That avoids a window
@@ -575,15 +578,9 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
raw_spin_lock(&worker->lock);
worker->next_work = work;
raw_spin_unlock(&worker->lock);
- }
-
- raw_spin_unlock(&acct->lock);
-
- if (!work)
+ } else {
break;
-
- __io_worker_busy(wq, worker);
-
+ }
io_assign_current_work(worker, work);
__set_current_state(TASK_RUNNING);