public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
@ 2026-01-21 22:23 Pavel Begunkov
  2026-01-21 22:23 ` [PATCH liburing 1/2] src/queue: Add support for non circular SQ Pavel Begunkov
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Pavel Begunkov @ 2026-01-21 22:23 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence, axboe

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(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH liburing 1/2] src/queue: Add support for non circular SQ
  2026-01-21 22:23 [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND Pavel Begunkov
@ 2026-01-21 22:23 ` 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
  2 siblings, 0 replies; 10+ messages in thread
From: Pavel Begunkov @ 2026-01-21 22:23 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence, axboe

With IORING_SETUP_SQ_REWIND, the kernel doesn't use the SQ headers and
always submits SQEs with indices in a range [0, nr_submit), where
nr_submit is the syscall argument. Add liburing support for that.
The head is now kept to be 0, and tail effectively tracks the number of
entries to submit, which matches the normal formula
to_submit = (tail - head) mod N

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 src/include/liburing.h          |  5 ++++-
 src/include/liburing/io_uring.h | 12 ++++++++++++
 src/queue.c                     |  5 +++++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/include/liburing.h b/src/include/liburing.h
index 8a882a08..4758c955 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -1918,9 +1918,12 @@ IOURINGINLINE struct io_uring_sqe *_io_uring_get_sqe(struct io_uring *ring)
 	LIBURING_NOEXCEPT
 {
 	struct io_uring_sq *sq = &ring->sq;
-	unsigned head = io_uring_load_sq_head(ring), tail = sq->sqe_tail;
+	unsigned head = 0, tail = sq->sqe_tail;
 	struct io_uring_sqe *sqe;
 
+	if (!(ring->flags & IORING_SETUP_SQ_REWIND))
+		head = io_uring_load_sq_head(ring);
+
 	if (tail - head >= sq->ring_entries)
 		return NULL;
 
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index 8e8b8e6a..2696b43d 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -233,6 +233,18 @@ enum io_uring_sqe_flags_bit {
  */
 #define IORING_SETUP_SQE_MIXED		(1U << 19)
 
+/*
+ * When set, io_uring ignores SQ head and tail and fetches SQEs to submit
+ * starting from index 0 instead from the index stored in the head pointer.
+ * IOW, the user should place all SQE at the beginning of the SQ memory
+ * before issuing a submission syscall.
+ *
+ * It requires IORING_SETUP_NO_SQARRAY and is incompatible with
+ * IORING_SETUP_SQPOLL. The user must also never change the SQ head and tail
+ * values and keep it set to 0. Any other value is undefined behaviour.
+ */
+#define IORING_SETUP_SQ_REWIND		(1U << 20)
+
 enum io_uring_op {
 	IORING_OP_NOP,
 	IORING_OP_READV,
diff --git a/src/queue.c b/src/queue.c
index c8ada7e8..00995ace 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -205,6 +205,11 @@ static unsigned __io_uring_flush_sq(struct io_uring *ring)
 	struct io_uring_sq *sq = &ring->sq;
 	unsigned tail = sq->sqe_tail;
 
+	if (ring->flags & IORING_SETUP_SQ_REWIND) {
+		sq->sqe_tail = 0;
+		return tail;
+	}
+
 	if (sq->sqe_head != tail) {
 		sq->sqe_head = tail;
 		/*
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH liburing 2/2] tests: add SETUP_SQ_REWIND tests
  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 ` Pavel Begunkov
  2026-01-22 22:59 ` [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND Jens Axboe
  2 siblings, 0 replies; 10+ messages in thread
From: Pavel Begunkov @ 2026-01-21 22:23 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence, axboe

Add a couple of IORING_SETUP_SQ_REWIND configurations to the nop test.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/test.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/test.h b/test/test.h
index e99a8d20..f6baf61d 100644
--- a/test/test.h
+++ b/test/test.h
@@ -20,6 +20,8 @@ static io_uring_test_config io_uring_test_configs[] = {
 	{ IORING_SETUP_SQE128, 				"large SQE"},
 	{ IORING_SETUP_CQE32, 				"large CQE"},
 	{ IORING_SETUP_SQE128 | IORING_SETUP_CQE32, 	"large SQE/CQE" },
+	{ IORING_SETUP_SQ_REWIND,			"rewind SQ"},
+	{ IORING_SETUP_SQ_REWIND | IORING_SETUP_SQE128,	"large rewind SQ"},
 };
 
 #define FOR_ALL_TEST_CONFIGS							\
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
  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 ` Jens Axboe
  2026-01-22 23:05   ` Jens Axboe
  2 siblings, 1 reply; 10+ messages in thread
From: Jens Axboe @ 2026-01-22 22:59 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov


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

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Jens Axboe @ 2026-01-22 23:05 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov

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);
+
 	/* always use real head, to avoid losing sync for short submit */
-	return ring->sq.sqe_tail - io_uring_load_sq_head(ring);
+	return ring->sq.sqe_tail - head;
 }
 
 /*
@@ -2063,7 +2068,7 @@ IOURINGINLINE struct io_uring_sqe *io_uring_get_sqe128(struct io_uring *ring)
 	LIBURING_NOEXCEPT
 {
 	struct io_uring_sq *sq = &ring->sq;
-	unsigned head = io_uring_load_sq_head(ring), tail = sq->sqe_tail;
+	unsigned head = 0, tail = sq->sqe_tail;
 	struct io_uring_sqe *sqe;
 
 	if (ring->flags & IORING_SETUP_SQE128)
@@ -2071,6 +2076,9 @@ IOURINGINLINE struct io_uring_sqe *io_uring_get_sqe128(struct io_uring *ring)
 	if (!(ring->flags & IORING_SETUP_SQE_MIXED))
 		return NULL;
 
+	if (!(ring->flags & IORING_SETUP_SQ_REWIND))
+		head = io_uring_load_sq_head(ring);
+
 	if (((tail + 1) & sq->ring_mask) == 0) {
 		if ((tail + 2) - head >= sq->ring_entries)
 			return NULL;

-- 
Jens Axboe

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
  2026-01-22 23:05   ` Jens Axboe
@ 2026-01-23 14:14     ` Pavel Begunkov
  2026-01-23 19:04       ` Jens Axboe
  0 siblings, 1 reply; 10+ messages in thread
From: Pavel Begunkov @ 2026-01-23 14:14 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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.

-- 
Pavel Begunkov


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
  2026-01-23 14:14     ` Pavel Begunkov
@ 2026-01-23 19:04       ` Jens Axboe
  2026-01-24 10:44         ` Pavel Begunkov
  0 siblings, 1 reply; 10+ messages in thread
From: Jens Axboe @ 2026-01-23 19:04 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

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()?

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
  2026-01-23 19:04       ` Jens Axboe
@ 2026-01-24 10:44         ` Pavel Begunkov
  2026-01-24 15:12           ` Jens Axboe
  0 siblings, 1 reply; 10+ messages in thread
From: Pavel Begunkov @ 2026-01-24 10:44 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
  2026-01-24 10:44         ` Pavel Begunkov
@ 2026-01-24 15:12           ` Jens Axboe
  2026-01-24 16:37             ` Pavel Begunkov
  0 siblings, 1 reply; 10+ messages in thread
From: Jens Axboe @ 2026-01-24 15:12 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 1/24/26 3:44 AM, Pavel Begunkov wrote:
> 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.

If you have time, would you mind checking the current repo and sending a
patch? Looks like I messed up a bit and committed some of these bits
with:

commit 5d1c94f754f3bca156d84b4ebcaf2f211dcd09f2
Author: Jens Axboe <axboe@kernel.dk>
Date:   Thu Jan 22 17:11:53 2026 -0700

    test/sqe-mixed-noop: add SQ_REWIND testing

inadvertently as I was doing some testing.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH liburing 0/2] Add support for IORING_SETUP_SQ_REWIND
  2026-01-24 15:12           ` Jens Axboe
@ 2026-01-24 16:37             ` Pavel Begunkov
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Begunkov @ 2026-01-24 16:37 UTC (permalink / raw)
  To: Jens Axboe, io-uring

On 1/24/26 15:12, Jens Axboe wrote:
> On 1/24/26 3:44 AM, Pavel Begunkov wrote:
...
>>>> 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.
> 
> If you have time, would you mind checking the current repo and sending a
> patch? Looks like I messed up a bit and committed some of these bits
> with:

I'll take a look a bit later, but removing should be fine
unless liburing overwrites the sq head.

-- 
Pavel Begunkov


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-01-24 16:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-01-24 15:12           ` Jens Axboe
2026-01-24 16:37             ` Pavel Begunkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox