io_uring/fdinfo: show SQEs for no array setup
PATCH 1/1 io_uring/fdinfo: show SQEs for no array setup
From: Keith Busch <[email protected]>
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.
--- io_uring/fdinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
io_uring/fdinfo.c +4 -2
@@ -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 ;
Signature · 1 line
2.47.3
Jens Axboe
maintainerQuoted 17 lines · Keith Busch
From: Keith Busch <[email protected]>
The
sq_headindicates the index directly in the submission queue when theIORING_SETUP_NO_SQARRAYoption is used, so use that instead of skipping showing the entries.Signed-off-by Keith Busch <[email protected]>--- io_uring/fdinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)io_uring/fdinfo.c +0
-0@@ -95,8 +95,10 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)u8 opcode;
io_uring/fdinfo.c static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m) · line 103
Quoted 10 lines
io_uring/fdinfo.c +4
-2if (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:
would be useful here?
Signature · 1 line
Jens Axboe
Quoted 5 lines · Keith Busch
The
sq_headindicates the index directly in the submission queue when theIORING_SETUP_NO_SQARRAYoption 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,
Signature · 1 line
Jens Axboe