public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: Re: [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
Date: Sat, 24 Jan 2026 10:44:47 +0000	[thread overview]
Message-ID: <9c10b8e7-d64c-491a-96b3-fc26863e0dbf@gmail.com> (raw)
In-Reply-To: <2d2da3b2-74c6-4605-8d13-3f0cdc67191e@kernel.dk>

On 1/23/26 19:04, Jens Axboe wrote:
> On 1/23/26 7:14 AM, Pavel Begunkov wrote:
>> On 1/22/26 23:05, Jens Axboe wrote:
>>> On 1/22/26 3:59 PM, Jens Axboe wrote:
>>>>
>>>> On Wed, 21 Jan 2026 22:23:20 +0000, Pavel Begunkov wrote:
>>>>> Add liburing support and tests for IORING_SETUP_SQ_REWIND.
>>>>>
>>>>> Pavel Begunkov (2):
>>>>>     src/queue: Add support for non circular SQ
>>>>>     tests: add SETUP_SQ_REWIND tests
>>>>>
>>>>> src/include/liburing.h          |  5 ++++-
>>>>>    src/include/liburing/io_uring.h | 12 ++++++++++++
>>>>>    src/queue.c                     |  5 +++++
>>>>>    test/test.h                     |  2 ++
>>>>>    4 files changed, 23 insertions(+), 1 deletion(-)
>>>>>
>>>>> [...]
>>>>
>>>> Applied, thanks!
>>>>
>>>> [1/2] src/queue: Add support for non circular SQ
>>>>         commit: c22129cf0b8c936eb478d920ef84e53d89c6a5cc
>>>> [2/2] tests: add SETUP_SQ_REWIND tests
>>>>         commit: 346c063d16bda52f02d00feb744aafe35b4002a9
>>>
>>> Hmm I do think you're missing some spots though, no?
>>>
>>> diff --git a/src/include/liburing.h b/src/include/liburing.h
>>> index 987b28aaf99e..016be1e80ef2 100644
>>> --- a/src/include/liburing.h
>>> +++ b/src/include/liburing.h
>>> @@ -1702,8 +1702,13 @@ IOURINGINLINE unsigned io_uring_load_sq_head(const struct io_uring *ring)
>>>    IOURINGINLINE unsigned io_uring_sq_ready(const struct io_uring *ring)
>>>        LIBURING_NOEXCEPT
>>>    {
>>> +    unsigned head = 0;
>>> +
>>> +    if (!(ring->flags & IORING_SETUP_SQ_REWIND))
>>> +        head = io_uring_load_sq_head(ring);
>>
>> The head should already be zero. Actually, sounds like the get_sqe
>> hunk from the patch is not needed either.
> 
> Yeah agree, I think they are both false alarms. Might warrant a comment
> though. Or maybe we just fold it into io_uring_load_sq_head()?

What I'm implying is that the

+	if (!(ring->flags & IORING_SETUP_SQ_REWIND))
+		head = io_uring_load_sq_head(ring);
+

change from the original patch for normal 64B _io_uring_get_sqe()
doesn't seem to be necessary. I need to take a look, but that's
a good thing since the function is somewhat frequently called and
inlined.

That would leave __io_uring_flush_sq() to be the only place
checking the flag, so maybe comments would better to be put
there.

-- 
Pavel Begunkov


  reply	other threads:[~2026-01-24 10:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 22:23 [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND Pavel Begunkov
2026-01-21 22:23 ` [PATCH liburing 1/2] src/queue: Add support for non circular SQ Pavel Begunkov
2026-01-21 22:23 ` [PATCH liburing 2/2] tests: add SETUP_SQ_REWIND tests Pavel Begunkov
2026-01-22 22:59 ` [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND Jens Axboe
2026-01-22 23:05   ` Jens Axboe
2026-01-23 14:14     ` Pavel Begunkov
2026-01-23 19:04       ` Jens Axboe
2026-01-24 10:44         ` Pavel Begunkov [this message]
2026-01-24 15:12           ` Jens Axboe
2026-01-24 16:37             ` Pavel Begunkov

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=9c10b8e7-d64c-491a-96b3-fc26863e0dbf@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox