]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring: grab RCU read lock marking task run
authorJens Axboe <axboe@kernel.dk>
Fri, 12 Jun 2026 02:27:22 +0000 (20:27 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 13 Jun 2026 12:26:53 +0000 (06:26 -0600)
Not required right now, as io_req_local_work_add() already calls this
helper with the RCU read lock held. But in preparation for that not
being the case, grab it locally.

Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/tw.c

index 023d5e6bc491a6f72fd76f4e644fc43657d7c7a6..f4335c8d50d93ee0c761dfbd5039c4bf78b31171 100644 (file)
@@ -158,11 +158,11 @@ void tctx_task_work(struct callback_head *cb)
  */
 static void io_ctx_mark_taskrun(struct io_ring_ctx *ctx)
 {
-       lockdep_assert_in_rcu_read_lock();
-
        if (ctx->flags & IORING_SETUP_TASKRUN_FLAG) {
-               struct io_rings *rings = rcu_dereference(ctx->rings_rcu);
+               struct io_rings *rings;
 
+               guard(rcu)();
+               rings = rcu_dereference(ctx->rings_rcu);
                atomic_or(IORING_SQ_TASKRUN, &rings->sq_flags);
        }
 }