All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: null_blk: batched complete poll requests
@ 2021-12-03  8:17 Ming Lei
  2021-12-03 13:36 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Lei @ 2021-12-03  8:17 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Ming Lei

Complete poll requests via blk_mq_add_to_batch() and
blk_mq_end_request_batch(), so that we can cover batched complete
code path by running null_blk test.

Meantime this way shows ~14% IOPS boost on 't/io_uring /dev/nullb0'
in my test.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 drivers/block/null_blk/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index b4ff5ae1f70c..20534a2daf17 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1574,7 +1574,9 @@ static int null_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob)
 		cmd = blk_mq_rq_to_pdu(req);
 		cmd->error = null_process_cmd(cmd, req_op(req), blk_rq_pos(req),
 						blk_rq_sectors(req));
-		end_cmd(cmd);
+		if (!blk_mq_add_to_batch(req, iob, cmd->error,
+					blk_mq_end_request_batch))
+			end_cmd(cmd);
 		nr++;
 	}
 
-- 
2.31.1


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

* Re: [PATCH] block: null_blk: batched complete poll requests
  2021-12-03  8:17 [PATCH] block: null_blk: batched complete poll requests Ming Lei
@ 2021-12-03 13:36 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-12-03 13:36 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-block

On Fri, 3 Dec 2021 16:17:03 +0800, Ming Lei wrote:
> Complete poll requests via blk_mq_add_to_batch() and
> blk_mq_end_request_batch(), so that we can cover batched complete
> code path by running null_blk test.
> 
> Meantime this way shows ~14% IOPS boost on 't/io_uring /dev/nullb0'
> in my test.
> 
> [...]

Applied, thanks!

[1/1] block: null_blk: batched complete poll requests
      commit: 2385ebf38f94d4f7761b1e9a4973d04753da02c2

Best regards,
-- 
Jens Axboe



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

end of thread, other threads:[~2021-12-03 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03  8:17 [PATCH] block: null_blk: batched complete poll requests Ming Lei
2021-12-03 13:36 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.