On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > More importantly, for some SCSI devices, driver > tags are host wide, and the number is quite big, > but each lun has very limited queue depth. This may be the case but is not always the case. Another important use-case is one LUN per host and where the queue depth per LUN is identical to the number of host tags. > +struct request *blk_mq_dispatch_rq_from_ctx(struct blk_mq_hw_ctx *hctx, > + struct blk_mq_ctx *start) > +{ > + unsigned off = start ? start->index_hw : 0; Please consider to rename this function into blk_mq_dispatch_rq_from_next_ctx() and to start from start->index_hw + 1 instead of start->index_hw. I think that will not only result in simpler but also in faster code. Thanks, Bart.