[PATCH 7.2 0/2] ublk: optimize ublk_rq_has_data()

Caleb Sander Mateos posted 2 patches 4 weeks, 1 day ago
drivers/block/ublk_drv.c | 21 ++++++++-------------
include/linux/blk-mq.h   |  9 +++++++++
2 files changed, 17 insertions(+), 13 deletions(-)
[PATCH 7.2 0/2] ublk: optimize ublk_rq_has_data()
Posted by Caleb Sander Mateos 4 weeks, 1 day ago
ublk_rq_has_data() currently uses bio_has_data(), which involves 2
indirections and several branches. Introduce a blk_rq_has_data()
analogue for struct request and use it instead to save an indirection
and NULL check.

Caleb Sander Mateos (2):
  blk-mq: introduce blk_rq_has_data()
  ublk: optimize ublk_rq_has_data()

 drivers/block/ublk_drv.c | 21 ++++++++-------------
 include/linux/blk-mq.h   |  9 +++++++++
 2 files changed, 17 insertions(+), 13 deletions(-)

-- 
2.54.0
Re: [PATCH 7.2 0/2] ublk: optimize ublk_rq_has_data()
Posted by Jens Axboe 3 weeks ago
On Wed, 13 May 2026 15:18:44 -0600, Caleb Sander Mateos wrote:
> ublk_rq_has_data() currently uses bio_has_data(), which involves 2
> indirections and several branches. Introduce a blk_rq_has_data()
> analogue for struct request and use it instead to save an indirection
> and NULL check.
> 
> Caleb Sander Mateos (2):
>   blk-mq: introduce blk_rq_has_data()
>   ublk: optimize ublk_rq_has_data()
> 
> [...]

Applied, thanks!

[1/2] blk-mq: introduce blk_rq_has_data()
      commit: 999722b34441b4ab65b7ca7fb16dd4b62fc3c354
[2/2] ublk: optimize ublk_rq_has_data()
      commit: 5995e751d2612cd8254cdf9c1155a96bbbb2d509

Best regards,
-- 
Jens Axboe