All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 5/6] nvme: track subsystems
Date: Fri, 16 Jun 2017 08:21:35 +0200	[thread overview]
Message-ID: <20170616062135.GC6592@lst.de> (raw)
In-Reply-To: <c6be6cd6-bb33-e3a7-484a-0070eff55949@grimberg.me>

On Thu, Jun 15, 2017@08:04:53PM +0300, Sagi Grimberg wrote:
>> +static struct nvme_subsystem *__nvme_find_subsystem(const char *subsysnqn)
>
> __nvme_find_get_subsystem?

Sure.

>> +	if (!subsys)
>> +		return -ENOMEM;
>> +	INIT_LIST_HEAD(&subsys->ctrls);
>> +	kref_init(&subsys->ref);
>> +	nvme_init_subnqn(subsys, ctrl, id);
>> +	mutex_init(&subsys->lock);
>
> Nit: might be nicer to allocate the subsys only if its new (in the
> else case) instead of freeing if you found a match. Maybe
> nvme_init_subsysnqn should receive the subsysnqn buffer (on stack
> here) which would be copied to the subsys->subnqn if new.

That means another huge stack buffer, and it means we'll have to do
a kmalloc under the global lock.  Not the end of the world, but given
that most subsystems have a single controller anyway probably not worth
optimizing for.

  reply	other threads:[~2017-06-16  6:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 16:34 track subsystem relationships and shared namespaces Christoph Hellwig
2017-06-15 16:34 ` [PATCH 1/6] nvme: remove an misleading comment on strut nvme_ns Christoph Hellwig
2017-06-15 16:51   ` Sagi Grimberg
2017-06-16  8:29   ` Johannes Thumshirn
2017-06-15 16:34 ` [PATCH 2/6] nvme: read the subsystem NQN from Identify Controller Christoph Hellwig
2017-06-15 16:54   ` Sagi Grimberg
2017-06-16  8:42   ` Johannes Thumshirn
2017-06-16  8:53     ` Christoph Hellwig
2017-06-18  8:03       ` Sagi Grimberg
2017-06-15 16:34 ` [PATCH 3/6] nvme: simplify nvme_dev_attrs_are_visible Christoph Hellwig
2017-06-15 16:55   ` Sagi Grimberg
2017-06-16  8:44   ` Johannes Thumshirn
2017-06-15 16:35 ` [PATCH 4/6] nvme-fabrics: verify that a controller returns the correct NQN Christoph Hellwig
2017-06-15 16:55   ` Sagi Grimberg
2017-06-16  8:47   ` Johannes Thumshirn
2017-06-15 16:35 ` [PATCH 5/6] nvme: track subsystems Christoph Hellwig
2017-06-15 17:04   ` Sagi Grimberg
2017-06-16  6:21     ` Christoph Hellwig [this message]
2017-06-15 16:35 ` [PATCH 6/6] nvme: track shared namespaces in a siblings list Christoph Hellwig
2017-06-15 16:49   ` Sagi Grimberg
2017-06-16  6:20     ` Christoph Hellwig
2017-06-18  8:17       ` Sagi Grimberg
  -- strict thread matches above, loose matches on Subject: below --
2017-06-19  9:57 track subsystem relationships and shared namespaces V2 Christoph Hellwig
2017-06-19  9:57 ` [PATCH 5/6] nvme: track subsystems Christoph Hellwig
2017-06-19 11:47   ` Johannes Thumshirn
2017-06-19 16:52   ` Keith Busch

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=20170616062135.GC6592@lst.de \
    --to=hch@lst.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.