From: Jan Kara <jack@suse.cz>
To: JunChao Sun <sunjunchao2870@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
linux-ext4@vger.kernel.org, tytso@mit.edu,
adilger.kernel@dilger.ca
Subject: Re: [PATCH] ext4: Adjust the layout of the ext4_inode_info structure to save memory.
Date: Mon, 3 Jun 2024 17:24:19 +0200 [thread overview]
Message-ID: <20240603152419.dklvgmf6m4akdyzf@quack3> (raw)
In-Reply-To: <CAHB1NagapRk62L9vn0uSKYJMMSq=9kNiB+jdaxA3JBY16f9jig@mail.gmail.com>
On Mon 03-06-24 22:43:16, JunChao Sun wrote:
> Jan Kara <jack@suse.cz> 于2024年6月3日周一 22:07写道:
> >
> > On Mon 03-06-24 21:15:24, Junchao Sun wrote:
> > > Using pahole, we can see that there are some padding holes
> > > in the current ext4_inode_info structure. Adjusting the
> > > layout of ext4_inode_info can reduce these holes,
> > > resulting in the size of the structure decreasing
> > > from 2424 bytes to 2408 bytes.
> >
> >
> > > But AFAICT this will save two holes 4 bytes each so only 8 bytes in total?
> > > Not 16?
>
> Indeed it's 16.
> Consider the layout int a; hole 0; int b; hole 1; And then move int b
> to hole 0 position, this adjustment resulted in saving 8 bytes. There
> are two adjustments like this, so it's 16. And GDB confirmed this.
Aha, OK. Thanks for clarification!
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-06-03 15:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 13:15 [PATCH] ext4: Adjust the layout of the ext4_inode_info structure to save memory Junchao Sun
2024-06-03 14:07 ` Jan Kara
2024-06-03 14:43 ` JunChao Sun
2024-06-03 15:24 ` Jan Kara [this message]
2024-08-22 15:00 ` Theodore Ts'o
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=20240603152419.dklvgmf6m4akdyzf@quack3 \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=sunjunchao2870@gmail.com \
--cc=tytso@mit.edu \
/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