From ed64f5c546b3d5e3a4840f6c055448ce90edf56c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 11 Jun 2026 20:27:22 -0600 Subject: [PATCH] io_uring: grab RCU read lock marking task run 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 Signed-off-by: Jens Axboe --- io_uring/tw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/io_uring/tw.c b/io_uring/tw.c index 023d5e6bc491..f4335c8d50d9 100644 --- a/io_uring/tw.c +++ b/io_uring/tw.c @@ -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); } }