public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring/uring_cmd: fix buffer index retrieval
@ 2024-11-11 10:13 ` Ming Lei
  2024-11-11 10:54   ` Kanchan Joshi
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ming Lei @ 2024-11-11 10:13 UTC (permalink / raw)
  To: Jens Axboe, io-uring, Pavel Begunkov; +Cc: Ming Lei, Guangwu Zhang, Jeff Moyer

Add back buffer index retrieval for IORING_URING_CMD_FIXED.

Reported-by: Guangwu Zhang <[email protected]>
Cc: Jeff Moyer <[email protected]>
Fixes: b54a14041ee6 ("io_uring/rsrc: add io_rsrc_node_lookup() helper")
Signed-off-by: Ming Lei <[email protected]>
---
 io_uring/uring_cmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index e7723759cb23..1abb5c9f803f 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -220,8 +220,9 @@ int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 	if (ioucmd->flags & IORING_URING_CMD_FIXED) {
 		struct io_ring_ctx *ctx = req->ctx;
 		struct io_rsrc_node *node;
+		u16 index = READ_ONCE(sqe->buf_index);
 
-		node = io_rsrc_node_lookup(&ctx->buf_table, req->buf_index);
+		node = io_rsrc_node_lookup(&ctx->buf_table, index);
 		if (unlikely(!node))
 			return -EFAULT;
 		/*
-- 
2.46.0


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

* Re: [PATCH] io_uring/uring_cmd: fix buffer index retrieval
  2024-11-11 10:13 ` [PATCH] io_uring/uring_cmd: fix buffer index retrieval Ming Lei
@ 2024-11-11 10:54   ` Kanchan Joshi
  2024-11-11 12:34   ` Anuj gupta
  2024-11-11 15:13   ` Jens Axboe
  2 siblings, 0 replies; 5+ messages in thread
From: Kanchan Joshi @ 2024-11-11 10:54 UTC (permalink / raw)
  To: Ming Lei, Jens Axboe, io-uring, Pavel Begunkov; +Cc: Guangwu Zhang, Jeff Moyer

Reviewed-by: Kanchan Joshi <[email protected]>

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

* Re: [PATCH] io_uring/uring_cmd: fix buffer index retrieval
  2024-11-11 10:13 ` [PATCH] io_uring/uring_cmd: fix buffer index retrieval Ming Lei
  2024-11-11 10:54   ` Kanchan Joshi
@ 2024-11-11 12:34   ` Anuj gupta
  2024-11-11 13:01     ` Guangwu Zhang
  2024-11-11 15:13   ` Jens Axboe
  2 siblings, 1 reply; 5+ messages in thread
From: Anuj gupta @ 2024-11-11 12:34 UTC (permalink / raw)
  To: Ming Lei; +Cc: Jens Axboe, io-uring, Pavel Begunkov, Guangwu Zhang, Jeff Moyer

Looks good:
Reviewed-by: Anuj Gupta <[email protected]>

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

* Re: [PATCH] io_uring/uring_cmd: fix buffer index retrieval
  2024-11-11 12:34   ` Anuj gupta
@ 2024-11-11 13:01     ` Guangwu Zhang
  0 siblings, 0 replies; 5+ messages in thread
From: Guangwu Zhang @ 2024-11-11 13:01 UTC (permalink / raw)
  To: Anuj gupta; +Cc: Ming Lei, Jens Axboe, io-uring, Pavel Begunkov, Jeff Moyer

test pass after apply the patch.
Tested-by: Guangwu Zhang <[email protected]>

# fio --numjobs=1 --ioengine=io_uring_cmd --runtime='300'
--size='300G' --filename=/dev/ng0n1 --rw='randrw' --name='fio_test'
--iodepth=64 --bs=8k --group_reporting=1 --cmd_type='nvme'
--md_per_io_size='4K'  --fixedbufs
fio_test: (g=0): rw=randrw, bs=(R) 8192B-8192B, (W) 8192B-8192B, (T)
8192B-8192B, ioengine=io_uring_cmd, iodepth=64
fio-3.38-13-gf241
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=1109MiB/s,w=1106MiB/s][r=142k,w=142k
IOPS][eta 00m:00s]
fio_test: (groupid=0, jobs=1): err= 0: pid=4664: Mon Nov 11 07:52:00 2024
  read: IOPS=142k, BW=1112MiB/s (1166MB/s)(150GiB/138132msec)
    slat (nsec): min=1520, max=894021, avg=2704.11, stdev=1197.90
    clat (usec): min=15, max=1145, avg=223.54, stdev=13.09
     lat (usec): min=18, max=1148, avg=226.25, stdev=13.09
    clat percentiles (usec):
     |  1.00th=[  212],  5.00th=[  215], 10.00th=[  217], 20.00th=[  219],
     | 30.00th=[  219], 40.00th=[  221], 50.00th=[  221], 60.00th=[  223],
     | 70.00th=[  225], 80.00th=[  227], 90.00th=[  231], 95.00th=[  235],
     | 99.00th=[  289], 99.50th=[  318], 99.90th=[  363], 99.95th=[  379],
     | 99.99th=[  416]
   bw (  MiB/s): min= 1099, max= 1131, per=100.00%, avg=1112.40,
stdev= 5.29, samples=276
   iops        : min=140748, max=144770, avg=142386.64, stdev=677.26,
samples=276
  write: IOPS=142k, BW=1112MiB/s (1166MB/s)(150GiB/138132msec); 0 zone resets
    slat (nsec): min=1550, max=916951, avg=3027.13, stdev=1290.29
    clat (usec): min=7, max=1141, avg=219.38, stdev=11.06
     lat (usec): min=9, max=1146, avg=222.41, stdev=11.12
    clat percentiles (usec):
     |  1.00th=[  172],  5.00th=[  212], 10.00th=[  215], 20.00th=[  217],
     | 30.00th=[  219], 40.00th=[  219], 50.00th=[  221], 60.00th=[  221],
     | 70.00th=[  223], 80.00th=[  225], 90.00th=[  229], 95.00th=[  231],
     | 99.00th=[  237], 99.50th=[  245], 99.90th=[  269], 99.95th=[  281],
     | 99.99th=[  314]
   bw (  MiB/s): min= 1100, max= 1126, per=100.00%, avg=1112.15,
stdev= 4.92, samples=276
   iops        : min=140822, max=144244, avg=142355.08, stdev=629.28,
samples=276
  lat (usec)   : 10=0.01%, 20=0.01%, 50=0.01%, 100=0.03%, 250=98.76%
  lat (usec)   : 500=1.20%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.01%
  cpu          : usr=20.74%, sys=54.54%, ctx=2887, majf=0, minf=11
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
     issued rwts: total=19662985,19658615,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=1112MiB/s (1166MB/s), 1112MiB/s-1112MiB/s
(1166MB/s-1166MB/s), io=150GiB (161GB), run=138132-138132msec
  WRITE: bw=1112MiB/s (1166MB/s), 1112MiB/s-1112MiB/s
(1166MB/s-1166MB/s), io=150GiB (161GB), run=138132-138132msec




Anuj gupta <[email protected]> 于2024年11月11日周一 20:35写道:
>
> Looks good:
> Reviewed-by: Anuj Gupta <[email protected]>
>


-- 
Guangwu Zhang
Thanks


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

* Re: [PATCH] io_uring/uring_cmd: fix buffer index retrieval
  2024-11-11 10:13 ` [PATCH] io_uring/uring_cmd: fix buffer index retrieval Ming Lei
  2024-11-11 10:54   ` Kanchan Joshi
  2024-11-11 12:34   ` Anuj gupta
@ 2024-11-11 15:13   ` Jens Axboe
  2 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2024-11-11 15:13 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov, Ming Lei; +Cc: Guangwu Zhang, Jeff Moyer


On Mon, 11 Nov 2024 18:13:18 +0800, Ming Lei wrote:
> Add back buffer index retrieval for IORING_URING_CMD_FIXED.
> 
> 

Applied, thanks!

[1/1] io_uring/uring_cmd: fix buffer index retrieval
      commit: a43e236fb9aef4528f2bd24095d1f348030f5d9d

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2024-11-11 15:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20241111101340epcas5p1a52121e40ddaa3377201ed3727f0e0fc@epcas5p1.samsung.com>
2024-11-11 10:13 ` [PATCH] io_uring/uring_cmd: fix buffer index retrieval Ming Lei
2024-11-11 10:54   ` Kanchan Joshi
2024-11-11 12:34   ` Anuj gupta
2024-11-11 13:01     ` Guangwu Zhang
2024-11-11 15:13   ` Jens Axboe

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