linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Hannes Reinecke <hare@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	"James Bottomley" <james.bottomley@hansenpartnership.com>,
	Ming Lei <ming.lei@redhat.com>, <linux-scsi@vger.kernel.org>,
	<linux-block@vger.kernel.org>
Subject: Re: [PATCH 03/11] blk-mq: rename blk_mq_update_tag_set_depth()
Date: Tue, 3 Dec 2019 14:30:07 +0000	[thread overview]
Message-ID: <fbc08f2a-e500-5e29-ccdc-c5a89be446dd@huawei.com> (raw)
In-Reply-To: <20191202153914.84722-4-hare@suse.de>

On 02/12/2019 15:39, Hannes Reinecke wrote:
> The function does not set the depth, but rather transitions from
> shared to non-shared queues and vice versa.
> So rename it to blk_mq_update_tag_set_shared() to better reflect
> its purpose.

We will probably need to split this patch into two, as we're doing more 
than just renaming.

The prep patches could be picked up earlier if we're lucky.

Thanks,
John

> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>   block/blk-mq-tag.c | 18 ++++++++++--------
>   block/blk-mq.c     |  8 ++++----
>   2 files changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index d7aa23c82dbf..f5009587e1b5 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -440,24 +440,22 @@ static int bt_alloc(struct sbitmap_queue *bt, unsigned int depth,
>   				       node);
>   }
>   
> -static struct blk_mq_tags *blk_mq_init_bitmap_tags(struct blk_mq_tags *tags,
> -						   int node, int alloc_policy)
> +static int blk_mq_init_bitmap_tags(struct blk_mq_tags *tags,
> +				   int node, int alloc_policy)
>   {
>   	unsigned int depth = tags->nr_tags - tags->nr_reserved_tags;
>   	bool round_robin = alloc_policy == BLK_TAG_ALLOC_RR;
>   
>   	if (bt_alloc(&tags->bitmap_tags, depth, round_robin, node))
> -		goto free_tags;
> +		return -ENOMEM;
>   	if (bt_alloc(&tags->breserved_tags, tags->nr_reserved_tags, round_robin,
>   		     node))
>   		goto free_bitmap_tags;
>   
> -	return tags;
> +	return 0;
>   free_bitmap_tags:
>   	sbitmap_queue_free(&tags->bitmap_tags);
> -free_tags:
> -	kfree(tags);
> -	return NULL;
> +	return -ENOMEM;
>   }
>   
>   struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
> @@ -478,7 +476,11 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
>   	tags->nr_tags = total_tags;
>   	tags->nr_reserved_tags = reserved_tags;
>   
> -	return blk_mq_init_bitmap_tags(tags, node, alloc_policy);
> +	if (blk_mq_init_bitmap_tags(tags, node, alloc_policy) < 0) {
> +		kfree(tags);
> +		tags = NULL;
> +	}
> +	return tags;
>   }
>   
>   void blk_mq_free_tags(struct blk_mq_tags *tags)
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 6b39cf0efdcd..91950d3e436a 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -2581,8 +2581,8 @@ static void queue_set_hctx_shared(struct request_queue *q, bool shared)
>   	}
>   }
>   
> -static void blk_mq_update_tag_set_depth(struct blk_mq_tag_set *set,
> -					bool shared)
> +static void blk_mq_update_tag_set_shared(struct blk_mq_tag_set *set,
> +					 bool shared)
>   {
>   	struct request_queue *q;
>   
> @@ -2605,7 +2605,7 @@ static void blk_mq_del_queue_tag_set(struct request_queue *q)
>   		/* just transitioned to unshared */
>   		set->flags &= ~BLK_MQ_F_TAG_QUEUE_SHARED;
>   		/* update existing queue */
> -		blk_mq_update_tag_set_depth(set, false);
> +		blk_mq_update_tag_set_shared(set, false);
>   	}
>   	mutex_unlock(&set->tag_list_lock);
>   	INIT_LIST_HEAD(&q->tag_set_list);
> @@ -2623,7 +2623,7 @@ static void blk_mq_add_queue_tag_set(struct blk_mq_tag_set *set,
>   	    !(set->flags & BLK_MQ_F_TAG_QUEUE_SHARED)) {
>   		set->flags |= BLK_MQ_F_TAG_QUEUE_SHARED;
>   		/* update existing queue */
> -		blk_mq_update_tag_set_depth(set, true);
> +		blk_mq_update_tag_set_shared(set, true);
>   	}
>   	if (set->flags & BLK_MQ_F_TAG_QUEUE_SHARED)
>   		queue_set_hctx_shared(q, true);
> 


  reply	other threads:[~2019-12-03 14:30 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02 15:39 [PATCH RFC v5 00/11] blk-mq/scsi: Provide hostwide shared tags for SCSI HBAs Hannes Reinecke
2019-12-02 15:39 ` [PATCH 01/11] blk-mq: Remove some unused function arguments Hannes Reinecke
2019-12-02 15:39 ` [PATCH 02/11] blk-mq: rename BLK_MQ_F_TAG_SHARED as BLK_MQ_F_TAG_QUEUE_SHARED Hannes Reinecke
2019-12-02 15:39 ` [PATCH 03/11] blk-mq: rename blk_mq_update_tag_set_depth() Hannes Reinecke
2019-12-03 14:30   ` John Garry [this message]
2019-12-03 14:53     ` Hannes Reinecke
2019-12-02 15:39 ` [PATCH 04/11] blk-mq: Facilitate a shared sbitmap per tagset Hannes Reinecke
2019-12-03 14:54   ` John Garry
2019-12-03 15:02     ` Hannes Reinecke
2019-12-04 10:24       ` John Garry
2019-12-03 16:38     ` Bart Van Assche
2019-12-02 15:39 ` [PATCH 05/11] blk-mq: add WARN_ON in blk_mq_free_rqs() Hannes Reinecke
2019-12-02 15:39 ` [PATCH 06/11] blk-mq: move shared sbitmap into elevator queue Hannes Reinecke
2019-12-02 15:39 ` [PATCH 07/11] scsi: Add template flag 'host_tagset' Hannes Reinecke
2019-12-02 15:39 ` [PATCH 08/11] scsi: hisi_sas: Switch v3 hw to MQ Hannes Reinecke
2019-12-02 15:39 ` [PATCH 09/11] megaraid_sas: switch fusion adapters " Hannes Reinecke
2019-12-09 10:10   ` Sumit Saxena
2019-12-09 11:02     ` Hannes Reinecke
2020-01-10  4:00       ` Sumit Saxena
2020-01-10 12:18         ` John Garry
2020-01-13 17:42         ` John Garry
2020-01-14  7:05           ` Hannes Reinecke
2020-01-16 15:47             ` John Garry
2020-01-16 17:45               ` Hannes Reinecke
2020-01-17 11:40             ` Sumit Saxena
2020-01-17 11:18           ` Sumit Saxena
2020-02-13 10:07             ` John Garry
2020-02-17 10:09               ` Sumit Saxena
2020-01-09 11:55     ` John Garry
2020-01-09 15:19       ` Hannes Reinecke
2020-01-09 18:17         ` John Garry
2020-01-10  2:00       ` Ming Lei
2020-01-10 12:09         ` John Garry
2020-01-14 13:57           ` John Garry
2019-12-02 15:39 ` [PATCH 10/11] smartpqi: enable host tagset Hannes Reinecke
2019-12-02 15:39 ` [PATCH 11/11] hpsa: enable host_tagset and switch to MQ Hannes Reinecke
2020-02-26 11:09 ` [PATCH RFC v5 00/11] blk-mq/scsi: Provide hostwide shared tags for SCSI HBAs John Garry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fbc08f2a-e500-5e29-ccdc-c5a89be446dd@huawei.com \
    --to=john.garry@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).