public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"sagi@grimberg.me" <sagi@grimberg.me>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH 0/5] optimize some data structure in nvme
Date: Sat, 13 May 2023 01:01:49 +0000	[thread overview]
Message-ID: <3ed34562-f366-2bb7-1a8a-e7cc9cc1c7e4@nvidia.com> (raw)
In-Reply-To: <cover.1682941568.git.christophe.jaillet@wanadoo.fr>

On 5/1/23 05:40, Christophe JAILLET wrote:
> This serie is a proposal to slighly optimize the memory needed for some
> structures used in nvme.
>
> This follows the discussion in [1].
>
> Honnestly, I'm not convinced that this serie really brings semething.
> Because of the way memory alocation works, and its over-allocation to try to
> avoid memory fragmentation, some limited gains are most of the time useless.
>
> It could still help:
>     - many holes in structure can, at some point, have its size reach a threshold
>       (this is specially true if such structures are allocated with kcalloc() or
>       kmalloc_array())
>     - it can save some space in some other structures if embedded in them
>     - it can save a few cycles if the structure is memcpy()'ed or zeroed, for
>       example
>     - can reduce cache usage
>
> With that in mind, patch 3 is a win, patch 4 is likely a win, the other ones are
> much more theorical.
>
> The changes are really limited, so even if the gain is marginal, maybe it still
> makes sense to merge them.
>
> Each patch gives the layout generated by pahole before and after the patch.
>
> [1]: https://lore.kernel.org/all/67a9e53e-4ac9-7ba8-9713-96c1dfe1e341@nvidia.com/
>
> Christophe JAILLET (5):
>    nvmet: Reorder fields in 'struct nvmet_sq'
>    nvmet: Reorder fields in 'struct nvme_ctrl'
>    nvmet: Reorder fields in 'struct nvmf_ctrl_options'
>    nvmet: Reorder fields in 'struct nvme_dhchap_queue_context'
>    nvmet: Reorder fields in 'struct nvmefc_fcp_req'
>
>   drivers/nvme/host/auth.c       |  6 +++---
>   drivers/nvme/host/fabrics.h    |  8 ++++----
>   drivers/nvme/host/nvme.h       |  6 +++---
>   drivers/nvme/target/nvmet.h    |  4 ++--
>   include/linux/nvme-fc-driver.h | 10 +++++-----
>   5 files changed, 17 insertions(+), 17 deletions(-)
>

thanks a lot for doing this and following the comment on the other patch.

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



  parent reply	other threads:[~2023-05-13  1:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-01 12:40 [PATCH 0/5] optimize some data structure in nvme Christophe JAILLET
2023-05-01 12:40 ` [PATCH 1/5] nvmet: Reorder fields in 'struct nvmet_sq' Christophe JAILLET
2023-05-01 12:40 ` [PATCH 2/5] nvmet: Reorder fields in 'struct nvme_ctrl' Christophe JAILLET
2023-05-15 14:21   ` Keith Busch
2023-05-15 17:22     ` Christophe JAILLET
2023-05-01 12:40 ` [PATCH 3/5] nvmet: Reorder fields in 'struct nvmf_ctrl_options' Christophe JAILLET
2023-05-01 12:40 ` [PATCH 4/5] nvmet: Reorder fields in 'struct nvme_dhchap_queue_context' Christophe JAILLET
2023-05-01 12:40 ` [PATCH 5/5] nvmet: Reorder fields in 'struct nvmefc_fcp_req' Christophe JAILLET
2023-05-01 13:57 ` [PATCH 0/5] optimize some data structure in nvme Sagi Grimberg
2023-05-12 20:26 ` Christoph Hellwig
2023-05-13  1:01 ` Chaitanya Kulkarni [this message]
2023-05-15 17:13 ` 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=3ed34562-f366-2bb7-1a8a-e7cc9cc1c7e4@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=hch@lst.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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