Re: [PATCH 1/6] io_uring: grab RCU read lock marking task run

Caleb Sander Mateos <[email protected]>
Newsgroups org.kernel.vger.io-uring
Message-ID <CADUfDZqYzTU6Kt+_HPv05kxUe5h=CXO5g1k8cCXSt-UVxJuPag@mail.gmail.com>
On Thu, Jun 11, 2026 at 7:51 PM Jens Axboe <[email protected]> wrote:
>
> 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.
>
> Signed-off-by: Jens Axboe <[email protected]>

Reviewed-by: Caleb Sander Mateos <[email protected]>

> ---
>  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);
>         }
>  }
> --
> 2.53.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.