On Wed, Jun 03, 2020 at 09:36:08PM +0800, Ming Lei wrote: > > +bool __blk_mq_get_driver_tag(struct request *rq) > > +{ > > + struct sbitmap_queue *bt = &rq->mq_hctx->tags->bitmap_tags; > > + unsigned int tag_offset = rq->mq_hctx->tags->nr_reserved_tags; > > + bool shared = blk_mq_tag_busy(rq->mq_hctx); > > Not necessary to add 'shared' which is just used once. blk_mq_tag_busy also increments active_queues, and the existing code does that before various early returns. To keep the behavior as-is the call to blk_mq_tag_busy can't be moved around. > > + int tag; > > + > > + if (blk_mq_tag_is_reserved(rq->mq_hctx->sched_tags, rq->internal_tag)) { > > + bt = &rq->mq_hctx->tags->breserved_tags; > > Too many rq->mq_hctx->tags, you can add one local variable to store it. Really just three of them. And with a local variable confusing it with rq->mq_hctx->sched_tags becomes much easier.