Recent changes (master)
Jens Axboe <[email protected]> Thu, 16 Oct 2025 06:00:01 -0600
| Newsgroups | org.kernel.vger.fio |
|---|---|
| Message-ID | <[email protected]> |
The following changes since commit ae3475defe994e855f912d4b8dadf69c479b9ca2:
memory: fix typo in cuda < 13 cuCtxCreate() (2025-10-10 14:56:44 -0600)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to 7272fd82813a65e3d72ef5c543c7473ec411f4cd:
t/io_uring: use IORING_SETUP_NO_SQARRAY if available (2025-10-15 08:12:57 -0600)
----------------------------------------------------------------
Jens Axboe (2):
os/linux: sync io_uring.h header for setup flags
t/io_uring: use IORING_SETUP_NO_SQARRAY if available
os/linux/io_uring.h | 26 ++++++++++++++++++++++++++
t/io_uring.c | 15 +++++++++++----
2 files changed, 37 insertions(+), 4 deletions(-)
---
Diff of recent changes:
diff --git a/os/linux/io_uring.h b/os/linux/io_uring.h
index 7b099902..10cb3c4c 100644
--- a/os/linux/io_uring.h
+++ b/os/linux/io_uring.h
@@ -162,6 +162,32 @@ enum {
*/
#define IORING_SETUP_DEFER_TASKRUN (1U << 13)
+/*
+ * Application provides the memory for the rings
+ */
+#define IORING_SETUP_NO_MMAP (1U << 14)
+
+/*
+ * Register the ring fd in itself for use with
+ * IORING_REGISTER_USE_REGISTERED_RING; return a registered fd index rather
+ * than an fd.
+ */
+#define IORING_SETUP_REGISTERED_FD_ONLY (1U << 15)
+
+/*
+ * Removes indirection through the SQ index array.
+ */
+#define IORING_SETUP_NO_SQARRAY (1U << 16)
+
+/* Use hybrid poll in iopoll process */
+#define IORING_SETUP_HYBRID_IOPOLL (1U << 17)
+
+/*
+ * Allow both 16b and 32b CQEs. If a 32b CQE is posted, it will have
+ * IORING_CQE_F_32 set in cqe->flags.
+ */
+#define IORING_SETUP_CQE_MIXED (1U << 18)
+
enum {
IORING_OP_NOP,
IORING_OP_READV,
diff --git a/t/io_uring.c b/t/io_uring.c
index 2a5d0c81..9da5cc9e 100644
--- a/t/io_uring.c
+++ b/t/io_uring.c
@@ -439,6 +439,7 @@ static int io_uring_setup(unsigned entries, struct io_uring_params *p)
p->flags |= IORING_SETUP_COOP_TASKRUN;
p->flags |= IORING_SETUP_SINGLE_ISSUER;
p->flags |= IORING_SETUP_DEFER_TASKRUN;
+ p->flags |= IORING_SETUP_NO_SQARRAY;
retry:
ret = syscall(__NR_io_uring_setup, entries, p);
if (!ret)
@@ -456,6 +457,10 @@ retry:
p->flags &= ~IORING_SETUP_DEFER_TASKRUN;
goto retry;
}
+ if (errno == EINVAL && p->flags & IORING_SETUP_NO_SQARRAY) {
+ p->flags &= ~IORING_SETUP_NO_SQARRAY;
+ goto retry;
+ }
return ret;
}
@@ -941,9 +946,14 @@ static int setup_ring(struct submitter *s)
sring->ring_mask = ptr + p.sq_off.ring_mask;
sring->ring_entries = ptr + p.sq_off.ring_entries;
sring->flags = ptr + p.sq_off.flags;
- sring->array = ptr + p.sq_off.array;
sq_ring_mask = *sring->ring_mask;
+ if (!(p.flags & IORING_SETUP_NO_SQARRAY)) {
+ sring->array = ptr + p.sq_off.array;
+ for (i = 0; i < p.sq_entries; i++)
+ sring->array[i] = i;
+ }
+
if (p.flags & IORING_SETUP_SQE128)
len = 2 * p.sq_entries * sizeof(struct io_uring_sqe);
else
@@ -969,9 +979,6 @@ static int setup_ring(struct submitter *s)
cring->cqes = ptr + p.cq_off.cqes;
cq_ring_mask = *cring->ring_mask;
- for (i = 0; i < p.sq_entries; i++)
- sring->array[i] = i;
-
s->per_file_depth = INT_MAX;
if (s->nr_files)
s->per_file_depth = (depth + s->nr_files - 1) / s->nr_files;