linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: JunChao Sun <sunjunchao2870@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	linux-fsdevel@vger.kernel.org,  linux-xfs@vger.kernel.org,
	viro@zeniv.linux.org.uk, brauner@kernel.org,  jack@suse.cz,
	chandan.babu@oracle.com
Subject: Re: [PATCH 1/2] xfs: reorder xfs_inode structure elements to remove unneeded padding.
Date: Wed, 19 Jun 2024 18:05:48 +0800	[thread overview]
Message-ID: <CAHB1NaiSX6R3Xyem2XeNdYa3bM7WPyOqbOfiQ7Z7jhgqU5idqw@mail.gmail.com> (raw)
In-Reply-To: <ZnG7DJrVov5n6O5m@casper.infradead.org>

Matthew Wilcox <willy@infradead.org> 于2024年6月19日周三 00:51写道:
>
> On Tue, Jun 18, 2024 at 12:40:23PM -0400, JunChao Sun wrote:
> > Darrick J. Wong <djwong@kernel.org> 于2024年6月18日周二 12:23写道:
> > >
> > > On Tue, Jun 18, 2024 at 07:35:04PM +0800, Junchao Sun wrote:
> > > > By reordering the elements in the xfs_inode structure, we can
> > > > reduce the padding needed on an x86_64 system by 8 bytes.
> > >
> > >
> > > > Does this result in denser packing of xfs_inode objects in the slab
> > > > page?
> >
> > No. Before applying the patch, the size of xfs_inode is 1800 bytes
> > with my config, and after applying the patch, the size is 1792 bytes.
> > This slight reduction does not result in a denser packing of xfs_inode
> > objects within a single page.
>
>
> > The "config dependent" part of this is important though.  On my
> > laptop running Debian 6.6.15-amd64, xfs_inode is exactly 1024 bytes,
> > and slab chooses to allocate 32 of them from an order-3 slab.
> >
> > Your config gets you 18 from an order-3 slab, and you'd need to get
> > it down to 1724 (probably 1720 bytes due to alignment) to get 19
> > from an order-3 slab.  I bet you have lockdep or something on.

Hi,

I couldn't find the exact 6.6.15-amd64 kernel, but I installed the
Debian 6.8.12-amd64 and 6.1.0-21-amd64 kernels, along with their
corresponding debug packages. In both cases, the size of xfs_inode is
1000 bytes. By eliminating the padding bytes, the number of xfs_inode
objects allocated from an order-3 slab increased from 32 to 33.

I'm not sure what specific differences there are between our Debian
kernels, but I have submitted the v2 version of the patch. If there
are any issues, please feel free to let me know. Thank you!


Best regards
-- 
Junchao Sun <sunjunchao2870@gmail.com>

      reply	other threads:[~2024-06-19 10:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 11:35 [PATCH 1/2] xfs: reorder xfs_inode structure elements to remove unneeded padding Junchao Sun
2024-06-18 11:35 ` [PATCH 2/2] vfs: reorder struct file " Junchao Sun
2024-06-18 14:52   ` Christian Brauner
2024-06-18 16:23 ` [PATCH 1/2] xfs: reorder xfs_inode " Darrick J. Wong
2024-06-18 16:40   ` JunChao Sun
2024-06-18 16:51     ` Matthew Wilcox
2024-06-19 10:05       ` JunChao Sun [this message]

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=CAHB1NaiSX6R3Xyem2XeNdYa3bM7WPyOqbOfiQ7Z7jhgqU5idqw@mail.gmail.com \
    --to=sunjunchao2870@gmail.com \
    --cc=brauner@kernel.org \
    --cc=chandan.babu@oracle.com \
    --cc=djwong@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).