Skip to content

Commit

Permalink
io_uring/rsrc: remove redundant __set_current_state() post schedule()
Browse files Browse the repository at this point in the history
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 <torvalds@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Jun 16, 2024
1 parent 3474d1b commit 11d1946
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions io_uring/rsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,14 @@ __cold static int io_rsrc_ref_quiesce(struct io_rsrc_data *data,

ret = io_run_task_work_sig(ctx);
if (ret < 0) {
__set_current_state(TASK_RUNNING);
finish_wait(&ctx->rsrc_quiesce_wq, &we);
mutex_lock(&ctx->uring_lock);
if (list_empty(&ctx->rsrc_ref_list))
ret = 0;
break;
}

schedule();
__set_current_state(TASK_RUNNING);
mutex_lock(&ctx->uring_lock);
ret = 0;
} while (!list_empty(&ctx->rsrc_ref_list));
Expand Down

0 comments on commit 11d1946

Please sign in to comment.