Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH 2/2] NVMe: Remove hctx reliance for multi-namespace
Date: Fri, 29 May 2015 17:58:37 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LNX.2.00.1505291754580.15930@localhost.lm.intel.com> (raw)
In-Reply-To: <20150529162944.GA31249@infradead.org>

On Fri, 29 May 2015, Christoph Hellwig wrote:
>> +static void nvme_exit_tags(void *data, unsigned int hctx_idx)
>>  {
>> +	struct nvme_dev *dev = data;
>> +	struct nvme_queue *nvmeq = dev->queues[
>> +					(hctx_idx % dev->queue_count) + 1];
>> +	nvmeq->tags = NULL;
>> +}
>>
>> +static int nvme_init_tags(struct blk_mq_tags *tags, void *data,
>> +			  unsigned int hctx_idx)
>> +{
>> +	struct nvme_dev *dev = data;
>> +	struct nvme_queue *nvmeq = dev->queues[
>> +					(hctx_idx % dev->queue_count) + 1];
>> +	WARN_ON(nvmeq->tags);
>> +	nvmeq->tags = tags;
>> +	return 0;
>
> I'd rather do the runtime indexing with the qid into the tags array than
> adding these methods.  I also don't see why you need the modulo
> arithmetic.

Good call. I copied the modulo from existing functions, but that's
useless since hctx_idx is never > queue_count.

Only now do I see I can get the tags with

 	dev->tagset->tags[nvmeq->qid - 1]

This will simplify a lot of things...

> Otherwise the series looks nice to me.

      reply	other threads:[~2015-05-29 17:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 18:37 [PATCH 1/2] blk-mq: Shared tag enhancements Keith Busch
2015-05-28 18:37 ` [PATCH 2/2] NVMe: Remove hctx reliance for multi-namespace Keith Busch
2015-05-29 16:29   ` Christoph Hellwig
2015-05-29 17:58     ` Keith Busch [this message]

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=alpine.LNX.2.00.1505291754580.15930@localhost.lm.intel.com \
    --to=keith.busch@intel.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