* [PATCH] io_uring/fdinfo: show SQEs for no array setup
@ 2025-10-22 20:56 Keith Busch
2025-10-22 22:09 ` Jens Axboe
2025-10-22 22:10 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Keith Busch @ 2025-10-22 20:56 UTC (permalink / raw)
To: axboe, io-uring; +Cc: Keith Busch
From: Keith Busch <kbusch@kernel.org>
The sq_head indicates the index directly in the submission queue when
the IORING_SETUP_NO_SQARRAY option is used, so use that instead of
skipping showing the entries.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
io_uring/fdinfo.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
index 5b26b2a97e1b9..f034786030105 100644
--- a/io_uring/fdinfo.c
+++ b/io_uring/fdinfo.c
@@ -95,8 +95,10 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
u8 opcode;
if (ctx->flags & IORING_SETUP_NO_SQARRAY)
- break;
- sq_idx = READ_ONCE(ctx->sq_array[sq_head & sq_mask]);
+ sq_idx = sq_head & sq_mask;
+ else
+ sq_idx = READ_ONCE(ctx->sq_array[sq_head & sq_mask]);
+
if (sq_idx > sq_mask)
continue;
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] io_uring/fdinfo: show SQEs for no array setup
2025-10-22 20:56 [PATCH] io_uring/fdinfo: show SQEs for no array setup Keith Busch
@ 2025-10-22 22:09 ` Jens Axboe
2025-10-22 22:10 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2025-10-22 22:09 UTC (permalink / raw)
To: Keith Busch, io-uring; +Cc: Keith Busch
On 10/22/25 2:56 PM, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> The sq_head indicates the index directly in the submission queue when
> the IORING_SETUP_NO_SQARRAY option is used, so use that instead of
> skipping showing the entries.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> io_uring/fdinfo.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
> index 5b26b2a97e1b9..f034786030105 100644
> --- a/io_uring/fdinfo.c
> +++ b/io_uring/fdinfo.c
> @@ -95,8 +95,10 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
> u8 opcode;
>
> if (ctx->flags & IORING_SETUP_NO_SQARRAY)
> - break;
> - sq_idx = READ_ONCE(ctx->sq_array[sq_head & sq_mask]);
> + sq_idx = sq_head & sq_mask;
> + else
> + sq_idx = READ_ONCE(ctx->sq_array[sq_head & sq_mask]);
> +
> if (sq_idx > sq_mask)
> continue;
Huh indeed, I wonder why that was never done...
/checks notes - oh it's me. NO_SQARRAY originally forgot about
fdinfo, and hence we got a crash. Rather than change it to display,
it just added the break.
Could argue that:
Fixes: 32f5dea040ee ("io_uring/fdinfo: only print ->sq_array[] if it's there")
would be useful here?
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] io_uring/fdinfo: show SQEs for no array setup
2025-10-22 20:56 [PATCH] io_uring/fdinfo: show SQEs for no array setup Keith Busch
2025-10-22 22:09 ` Jens Axboe
@ 2025-10-22 22:10 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2025-10-22 22:10 UTC (permalink / raw)
To: io-uring, Keith Busch; +Cc: Keith Busch
On Wed, 22 Oct 2025 13:56:07 -0700, Keith Busch wrote:
> The sq_head indicates the index directly in the submission queue when
> the IORING_SETUP_NO_SQARRAY option is used, so use that instead of
> skipping showing the entries.
>
>
Applied, thanks!
[1/1] io_uring/fdinfo: show SQEs for no array setup
commit: 0ecf0e6748120842700efc5dbf22a18580f7efcf
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-22 22:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22 20:56 [PATCH] io_uring/fdinfo: show SQEs for no array setup Keith Busch
2025-10-22 22:09 ` Jens Axboe
2025-10-22 22:10 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox