diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-06-15 02:34:50 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-06-16 22:54:55 +0200 |
commit | 11d194669271642a5d1bfff6c8011478309e7849 (patch) | |
tree | 8f2ad5888b2d155ac4200a3c5b7424a41f2916a6 /io_uring | |
parent | io_uring/io-wq: make io_wq_work flags atomic (diff) | |
download | linux-11d194669271642a5d1bfff6c8011478309e7849.tar.xz linux-11d194669271642a5d1bfff6c8011478309e7849.zip |
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 <torvalds@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/rsrc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index e89c5e2326a2..60c00144471a 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -224,7 +224,7 @@ __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; @@ -232,7 +232,6 @@ __cold static int io_rsrc_ref_quiesce(struct io_rsrc_data *data, } schedule(); - __set_current_state(TASK_RUNNING); mutex_lock(&ctx->uring_lock); ret = 0; } while (!list_empty(&ctx->rsrc_ref_list)); |