<div dir="ltr"><div>Hi all,</div><div><br></div><div>I would like to understand how actually queue_depth parameter is set.</div><div>I need this information to understand how can I affect on nr_request parameter from here <a href="https://elixir.bootlin.com/linux/latest/source/block/blk-mq-sched.c#L541">https://elixir.bootlin.com/linux/latest/source/block/blk-mq-sched.c#L541</a>.</div><div></div><div>I have found that for my block device queue_depth is set equal to 1 so nr_request is equal to 2 but before the patch 32825c45("blk-mq-sched: fix performance regression of mq-deadline") was introduced it had been equal to 128 and because of nr_request is equal to 2 now it affects the performance of read/write operations. When I switched it back to 128 it starts to work as it was before.</div><div><br></div><div>Currently, I am looking for a driver where is q->tag_set->queue_depth initialized.</div><div>I found that for the block device is used sd driver using the next command:</div><div>udevadm info -a /dev/sdb</div><div>...<br></div><div>looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.1/3-3.1:1.0/host6/target6:0:0/6:0:0:0':                                              <br>    KERNELS=="6:0:0:0"<br>    SUBSYSTEMS=="scsi"  <br>    DRIVERS=="sd"                                                                                                   </div><div>....</div><div>So I decided to go sd_probe and try to understand how struct request_queue *q from blk_mq_init_sched() function is gotten and from sd_probe() function I can conclude that it is passed through (<a href="https://elixir.bootlin.com/linux/latest/source/drivers/scsi/sd.c#L3388">https://elixir.bootlin.com/linux/latest/source/drivers/scsi/sd.c#L3388</a>) device_add_disk() -> __device_add_disk() -> elevator_init_mq() -> blk_mq_init_mq() using gd variable. The queue for gd variable is set here <a href="https://elixir.bootlin.com/linux/latest/source/drivers/scsi/sd.c#L3360">https://elixir.bootlin.com/linux/latest/source/drivers/scsi/sd.c#L3360</a> so we can see that is actually taken value from a scsi_device structure.</div><div><br></div><div>My question is how to find out a driver of a scsi_device? Am I correct that queue_depth should be set somewhere in the scsci_device?</div><div><br></div><div></div><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Best regards,</div><div> Oleksii<br></div></div></div></div></div></div>