Skip to contentSkip to conversation

block: null_blk: batched complete poll requests

PATCH Applied Ming Lei 2 participants 2 messages Dec 3, 2021 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 block: null_blk: batched complete poll requests

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.

---
 drivers/block/null_blk/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/block/null_blk/main.c +3 -1
index b4ff5ae1f70c..20534a2daf17 100644
@@ -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++;
 	}
 
Signature · 1 line
2.31.1
maintainer Applied
#1 lore raw
Quoted 8 lines · 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.

[...]

Applied, thanks!

[1/1] block: null_blk: batched complete poll requests

      commit: 2385ebf38f94d4f7761b1e9a4973d04753da02c2

Best regards,

Signature · 1 line
Jens Axboe