Re: [PATCH 3/3] blk-mq: centralise related handling into blk_mq_get_driver_tag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 30, 2020 at 06:05:57AM +0100, Christoph Hellwig wrote:
> > index 21108a550fbf..3b0c5cfe922a 100644
> > --- a/block/blk-flush.c
> > +++ b/block/blk-flush.c
> > @@ -236,12 +236,10 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)
> >  		error = fq->rq_status;
> >  
> >  	hctx = flush_rq->mq_hctx;
> > +	if (!q->elevator)
> >  		flush_rq->tag = -1;
> > +	else
> >  		flush_rq->internal_tag = -1;
> 
> These should switch to BLK_MQ_NO_TAG which you're at it.

OK, we can do that in this patch.

> 
> > -	if (!(data->flags & BLK_MQ_REQ_INTERNAL))
> > -		blk_mq_tag_busy(data->hctx);
> 
> BLK_MQ_REQ_INTERNAL is gone now, so this won't apply.

blk_mq_tag_busy() is needed for either none and io scheduler, so it
is moved into blk_mq_get_driver_tag(), then check on BLK_MQ_REQ_INTERNAL
is gone.

> 
> >  static bool blk_mq_get_driver_tag(struct request *rq)
> >  {
> > +	struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
> > +	bool shared = blk_mq_tag_busy(rq->mq_hctx);
> > +
> > +	if (rq->tag == BLK_MQ_NO_TAG && !__blk_mq_get_driver_tag(rq))
> > +		return false;
> > +
> > +	if (shared) {
> > +		rq->rq_flags |= RQF_MQ_INFLIGHT;
> > +		atomic_inc(&hctx->nr_active);
> > +	}
> > +	hctx->tags->rqs[rq->tag] = rq;
> > +	return true;
> >  }
> 
> The function seems a bit misnamed now, although I don't have a good
> suggestion for a better name.

I think it is fine to leave it as-is, since what the patch does is just
to move blk_mq_tag_busy() & the RQF_MQ_INFLIGHT part from __blk_mq_get_driver_tag
to blk_mq_get_driver_tag().


Thanks,
Ming




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux