From: Jens Axboe <axboe@kernel.dk>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvmet: Reorder fields in 'struct nvmet_ns'
Date: Thu, 27 Apr 2023 16:51:59 -0600 [thread overview]
Message-ID: <f9b06711-6d3c-2271-b2eb-13ab4e8ec040@kernel.dk> (raw)
In-Reply-To: <aea924d31f2bd2f740b1ccc6f462905bd6cab763.1682624855.git.christophe.jaillet@wanadoo.fr>
On 4/27/23 1:47 PM, Christophe JAILLET wrote:
> Group some variables based on their sizes to reduce holes.
> On x86_64, this shrinks the size of 'struct nvmet_ns' from 520 to 512
> bytes.
>
> When such a structure is allocated in nvmet_ns_alloc(), because of the way
> memory allocation works, when 520 bytes were requested, 1024 bytes were
> allocated.
>
> So, on x86_64, this change saves 512 bytes per allocation.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> More aggressive grouping could be done to be more future proof, but the
> way the struct nvmet_ns is written suggest that some fields should be
> kept together. So keep grouping as-is.
I think you did the right thing, that move doesn't matter and it brings
it to pow-of-2 or less and that is really what matters. So looks fine to
me:
Reviewed-by: Jens Axboe <axboe@kernel.dk>
--
Jens Axboe
next prev parent reply other threads:[~2023-04-27 22:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 19:47 Christophe JAILLET
2023-04-27 22:51 ` Jens Axboe [this message]
2023-04-27 22:59 ` Chaitanya Kulkarni
2023-04-27 23:01 ` Jens Axboe
2023-04-27 23:07 ` Chaitanya Kulkarni
2023-06-19 18:08 ` Christophe JAILLET
2023-06-20 5:21 ` Chaitanya Kulkarni
2023-06-20 15:45 ` Keith Busch
2023-06-21 17:25 ` Keith Busch
2023-04-27 23:12 ` Chaitanya Kulkarni
2023-04-28 7:33 ` Christophe JAILLET
2023-04-28 8:11 ` Chaitanya Kulkarni
2023-05-01 13:58 ` Sagi Grimberg
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=f9b06711-6d3c-2271-b2eb-13ab4e8ec040@kernel.dk \
--to=axboe@kernel.dk \
--cc=christophe.jaillet@wanadoo.fr \
--cc=hch@lst.de \
--cc=kch@nvidia.com \
--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
all inboxes | Powered by JetHome®