* [PATCH] io_uring: document advise SQE field reuse for 64-bit lengths
@ 2026-02-16 16:14 redacherkaoui
2026-02-16 16:23 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: redacherkaoui @ 2026-02-16 16:14 UTC (permalink / raw)
To: io-uring; +Cc: axboe, linux-kernel, redacherkaoui
IORING_OP_FADVISE and IORING_OP_MADVISE reuse SQE fields to
support 64-bit lengths without extending struct io_uring_sqe.
For IORING_OP_FADVISE, the length is carried in sqe->addr when
non-zero, with sqe->len providing legacy fallback.
For IORING_OP_MADVISE, the length is carried in sqe->off when
non-zero, with sqe->len providing legacy fallback.
This differs from the more common addr/off/len interpretation
used by many other opcodes and can be confusing when constructing
SQEs manually.
Document the field mapping in the UAPI header to clarify the
intended behavior and reduce the risk of misuse.
Signed-off-by: redacherkaoui <redacherkaoui67@gmail.com>
---
include/uapi/linux/io_uring.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index d84627cf06b4..a19bd1e42561 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -25,9 +25,11 @@ extern "C" {
#endif
/*
+ * IO submission data structure (Submission Queue Entry)
+ *
* Field reuse for 64-bit lengths:
*
- * Most opcodes interpret:
+ * Many opcodes interpret:
* - addr as a userspace pointer (buffer/iov/etc)
* - off as a file offset
* - len as a 32-bit length
@@ -37,12 +39,14 @@ extern "C" {
*
* IORING_OP_FADVISE:
* - off : file offset
- * - fadvise_advice: POSIX_FADV_* advice
+ * - fadvise_advice: POSIX_FADV_*
+
* - length : addr if non-zero, otherwise len (legacy)
*
* IORING_OP_MADVISE:
* - addr : start address of mapping
- * - fadvise_advice: MADV_* advice
+ * - fadvise_advice: MADV_*
+
* - length : off if non-zero, otherwise len (legacy)
*
* This mapping is part of the stable UAPI.
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] io_uring: document advise SQE field reuse for 64-bit lengths
2026-02-16 16:14 [PATCH] io_uring: document advise SQE field reuse for 64-bit lengths redacherkaoui
@ 2026-02-16 16:23 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2026-02-16 16:23 UTC (permalink / raw)
To: redacherkaoui, io-uring; +Cc: linux-kernel
On 2/16/26 9:14 AM, redacherkaoui wrote:
> IORING_OP_FADVISE and IORING_OP_MADVISE reuse SQE fields to
> support 64-bit lengths without extending struct io_uring_sqe.
>
> For IORING_OP_FADVISE, the length is carried in sqe->addr when
> non-zero, with sqe->len providing legacy fallback.
>
> For IORING_OP_MADVISE, the length is carried in sqe->off when
> non-zero, with sqe->len providing legacy fallback.
>
> This differs from the more common addr/off/len interpretation
> used by many other opcodes and can be confusing when constructing
> SQEs manually.
>
> Document the field mapping in the UAPI header to clarify the
> intended behavior and reduce the risk of misuse.
Like I asked you before, what on earth is this patch against?
Stop re-sending the same stuff without answering the question.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] io_uring: document advise SQE field reuse for 64-bit lengths
@ 2026-02-16 11:37 redacherkaoui
2026-02-16 15:17 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: redacherkaoui @ 2026-02-16 11:37 UTC (permalink / raw)
To: io-uring; +Cc: axboe, linux-kernel, redacherkaoui
IORING_OP_FADVISE and IORING_OP_MADVISE reuse SQE fields to
support 64-bit lengths without extending struct io_uring_sqe.
For IORING_OP_FADVISE, the length is carried in sqe->addr when
non-zero, with sqe->len providing legacy fallback.
For IORING_OP_MADVISE, the length is carried in sqe->off when
non-zero, with sqe->len providing legacy fallback.
This differs from the more common addr/off/len interpretation
used by many other opcodes and can be confusing when constructing
SQEs manually.
Document the field mapping in the UAPI header to clarify the
intended behavior and reduce the risk of misuse.
Signed-off-by: redacherkaoui <redacherkaoui67@gmail.com>
---
include/uapi/linux/io_uring.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index 883c9ceb5..7955ebb98 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -25,9 +25,11 @@ extern "C" {
#endif
/*
+ * IO submission data structure (Submission Queue Entry)
+ *
* Field reuse for 64-bit lengths:
*
- * Most opcodes interpret:
+ * Many opcodes interpret:
* - addr as a userspace pointer (buffer/iov/etc)
* - off as a file offset
* - len as a 32-bit length
@@ -37,12 +39,14 @@ extern "C" {
*
* IORING_OP_FADVISE:
* - off : file offset
- * - fadvise_advice: POSIX_FADV_* advice
+ * - fadvise_advice: POSIX_FADV_*
+
* - length : addr if non-zero, otherwise len (legacy)
*
* IORING_OP_MADVISE:
* - addr : start address of mapping
- * - fadvise_advice: MADV_* advice
+ * - fadvise_advice: MADV_*
+
* - length : off if non-zero, otherwise len (legacy)
*
* This mapping is part of the stable UAPI.
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] io_uring: document advise SQE field reuse for 64-bit lengths
2026-02-16 11:37 redacherkaoui
@ 2026-02-16 15:17 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2026-02-16 15:17 UTC (permalink / raw)
To: redacherkaoui, io-uring; +Cc: linux-kernel
On 2/16/26 4:37 AM, redacherkaoui wrote:
> IORING_OP_FADVISE and IORING_OP_MADVISE reuse SQE fields to
> support 64-bit lengths without extending struct io_uring_sqe.
>
> For IORING_OP_FADVISE, the length is carried in sqe->addr when
> non-zero, with sqe->len providing legacy fallback.
>
> For IORING_OP_MADVISE, the length is carried in sqe->off when
> non-zero, with sqe->len providing legacy fallback.
>
> This differs from the more common addr/off/len interpretation
> used by many other opcodes and can be confusing when constructing
> SQEs manually.
>
> Document the field mapping in the UAPI header to clarify the
> intended behavior and reduce the risk of misuse.
What is this patch against? Not the upstream kernel...
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-16 16:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-16 16:14 [PATCH] io_uring: document advise SQE field reuse for 64-bit lengths redacherkaoui
2026-02-16 16:23 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2026-02-16 11:37 redacherkaoui
2026-02-16 15:17 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox