Re: [PATCH] blk-mq: always allow reserved allocation in hctx_may_queue

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

 



On Fri, Sep 11, 2020 at 05:44:53PM +0800, Ming Lei wrote:
>  	unsigned int tag_offset = rq->mq_hctx->tags->nr_reserved_tags;
>  	int tag;
> +	bool reserved = blk_mq_tag_is_reserved(rq->mq_hctx->sched_tags,
> +			rq->internal_tag);
>  
>  	blk_mq_tag_busy(rq->mq_hctx);
>  
> -	if (blk_mq_tag_is_reserved(rq->mq_hctx->sched_tags, rq->internal_tag)) {
> +	if (reserved) {
>  		bt = rq->mq_hctx->tags->breserved_tags;
>  		tag_offset = 0;
>  	}
>  
> -	if (!hctx_may_queue(rq->mq_hctx, bt))
> +	if (!reserved && !hctx_may_queue(rq->mq_hctx, bt))

What about:

	if (blk_mq_tag_is_reserved(rq->mq_hctx->sched_tags, rq->internal_tag)) {
  		bt = rq->mq_hctx->tags->breserved_tags;
  		tag_offset = 0;
	} else {
		if (!hctx_may_queue(rq->mq_hctx, bt))
	 		return false;
	}

which seems a little easier to follow?

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[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