All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Keith Busch <kbusch@kernel.org>
Cc: io-uring@vger.kernel.org, asml.silence@gmail.com,
	naup96721@gmail.com, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] io_uring: ensure ctx->rings is stable for task work flags manipulation
Date: Wed, 11 Mar 2026 09:12:56 -0600	[thread overview]
Message-ID: <002add9f-6cde-4263-92b5-dd74f04f8b10@kernel.dk> (raw)
In-Reply-To: <abGE_CLo4vW_-Tkh@kbusch-mbp>

On 3/11/26 9:06 AM, Keith Busch wrote:
> On Wed, Mar 11, 2026 at 07:11:55AM -0600, Jens Axboe wrote:
>> +/*
>> + * Sets IORING_SQ_TASKRUN in the sq_flags shared with userspace, using the
>> + * RCU protected rings pointer to be safe against concurrent ring resizing.
>> + * Must be called inside an RCU read-side critical section.
> 
> You can make the rcu requirement explicit in the code with:
> 
> 	ASSERT(rcu_read_lock_held());
> 
> And debug kernels will catch misuse, too.

We have lockdep_assert_in_rcu_read_lock(), that should do it. Did ponder
that, and then I could also kill the comment as it's self documenting
by that point.

-- 
Jens Axboe


  reply	other threads:[~2026-03-11 15:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 13:11 [PATCHSET v2] Fix DEFER_TASKRUN ring resize flag manipulation Jens Axboe
2026-03-11 13:11 ` [PATCH 1/2] io_uring: ensure ctx->rings is stable for task work flags manipulation Jens Axboe
2026-03-11 15:06   ` Keith Busch
2026-03-11 15:12     ` Jens Axboe [this message]
2026-03-11 13:11 ` [PATCH 2/2] io_uring/eventfd: use ctx->rings_rcu for flags checking Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2026-03-10 14:45 [PATCHSET 0/2] Fix DEFER_TASKRUN ring resize flag manipulation Jens Axboe
2026-03-10 14:45 ` [PATCH 1/2] io_uring: ensure ctx->rings is stable for task work flags manipulation Jens Axboe
2026-03-11 11:13   ` Pavel Begunkov
2026-03-11 13:05     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=002add9f-6cde-4263-92b5-dd74f04f8b10@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    --cc=kbusch@kernel.org \
    --cc=naup96721@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.