Skip to content

Commit b40dcdf

Browse files
calebsanderaxboe
authored andcommitted
ublk: don't dereference ublk_queue in ublk_check_and_get_req()
For ublk servers with many ublk queues, accessing the ublk_queue in ublk_ch_{read,write}_iter() is a frequent cache miss. Get the flags and queue depth from the ublk_device instead, which is accessed just before. Signed-off-by: Caleb Sander Mateos <csander@purestorage.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 5125535 commit b40dcdf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/block/ublk_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2527,10 +2527,10 @@ static struct request *ublk_check_and_get_req(struct kiocb *iocb,
25272527
return ERR_PTR(-EINVAL);
25282528

25292529
ubq = ublk_get_queue(ub, q_id);
2530-
if (!ublk_support_user_copy(ubq))
2530+
if (!ublk_dev_support_user_copy(ub))
25312531
return ERR_PTR(-EACCES);
25322532

2533-
if (tag >= ubq->q_depth)
2533+
if (tag >= ub->dev_info.queue_depth)
25342534
return ERR_PTR(-EINVAL);
25352535

25362536
*io = &ubq->ios[tag];

0 commit comments

Comments
 (0)