Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Max Gurtovoy <mgurtovoy@nvidia.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-nvme@lists.infradead.org, kbusch@kernel.org,
	sagi@grimberg.me, kch@nvidia.com, israelr@nvidia.com
Subject: Re: [PATCH 3/3] nvmet: replace transports array with a linked list
Date: Tue, 23 Sep 2025 00:19:59 +0300	[thread overview]
Message-ID: <cfe873eb-5e39-48b5-9d9d-1e2874bc1e30@nvidia.com> (raw)
In-Reply-To: <20250922173540.GC14393@lst.de>


On 22/09/2025 20:35, Christoph Hellwig wrote:
> On Sun, Sep 21, 2025 at 02:49:43AM +0300, Max Gurtovoy wrote:
>> The nvmet_transports array was sized to 255 (NVMF_TRTYPE_MAX), although
>> only up to 5 transport types can ever be registered, resulting in
>> some unused memory. This change replaces the array with a linked list to
>> store registered transport ops, substantially improving memory
>> efficiency by allocating space only for active transports.
> This adds extra code and makes previously const data structures mutable
> to save a little bit of space, which feels like the wrong tradeoff.
>
> What is your motivation here?

The main goal is to save the wasted memory (even though it is no huge).

maybe we can do something like this instead:

diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 655d194f8e72..8e076960875c 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -68,7 +68,7 @@ enum {
         NVMF_TRTYPE_RDMA        = 1,    /* RDMA */
         NVMF_TRTYPE_FC          = 2,    /* Fibre Channel */
         NVMF_TRTYPE_TCP         = 3,    /* TCP/IP */
-       NVMF_TRTYPE_LOOP        = 254,  /* Reserved for host usage */
+       NVMF_TRTYPE_LOOP        = 15,   /* Reserved for host usage */
         NVMF_TRTYPE_MAX,
  };




  reply	other threads:[~2025-09-22 21:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-20 23:49 [PATCH 1/3] nvmet: prevent redundant enable/disable of nvmet_port Max Gurtovoy
2025-09-20 23:49 ` [PATCH 2/3] nvmet: use port's tr_ops in nvmet_disable_port Max Gurtovoy
2025-09-22 17:33   ` Christoph Hellwig
2025-09-20 23:49 ` [PATCH 3/3] nvmet: replace transports array with a linked list Max Gurtovoy
2025-09-22 17:35   ` Christoph Hellwig
2025-09-22 21:19     ` Max Gurtovoy [this message]
2025-09-22 21:27       ` Keith Busch
2025-09-22 21:45         ` Max Gurtovoy
2025-09-22 17:33 ` [PATCH 1/3] nvmet: prevent redundant enable/disable of nvmet_port Christoph Hellwig

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=cfe873eb-5e39-48b5-9d9d-1e2874bc1e30@nvidia.com \
    --to=mgurtovoy@nvidia.com \
    --cc=hch@lst.de \
    --cc=israelr@nvidia.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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