Skip to content

Commit 11d1946

Browse files
committed
io_uring/rsrc: remove redundant __set_current_state() post schedule()
We're guaranteed to be in a TASK_RUNNING state post schedule, so we never need to set the state after that. While in there, remove the other __set_current_state() as well, and just call finish_wait() when we now we're going to break anyway. This is easier to grok than manual __set_current_state() calls. Reported-by: Linus Torvalds <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 3474d1b commit 11d1946

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

io_uring/rsrc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,14 @@ __cold static int io_rsrc_ref_quiesce(struct io_rsrc_data *data,
224224

225225
ret = io_run_task_work_sig(ctx);
226226
if (ret < 0) {
227-
__set_current_state(TASK_RUNNING);
227+
finish_wait(&ctx->rsrc_quiesce_wq, &we);
228228
mutex_lock(&ctx->uring_lock);
229229
if (list_empty(&ctx->rsrc_ref_list))
230230
ret = 0;
231231
break;
232232
}
233233

234234
schedule();
235-
__set_current_state(TASK_RUNNING);
236235
mutex_lock(&ctx->uring_lock);
237236
ret = 0;
238237
} while (!list_empty(&ctx->rsrc_ref_list));

0 commit comments

Comments
 (0)