The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Jeff Layton <jlayton@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org,
	Amir Goldstein <amir73il@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: switch timespec64 fields in inode to discrete integers
Date: Sat, 18 May 2024 06:23:04 +0100	[thread overview]
Message-ID: <Zkg7OCSYJ7rzv6_D@casper.infradead.org> (raw)
In-Reply-To: <20240517-amtime-v1-1-7b804ca4be8f@kernel.org>

On Fri, May 17, 2024 at 08:08:40PM -0400, Jeff Layton wrote:
> For reference (according to pahole):
> 
>     Before:	/* size: 624, cachelines: 10, members: 53 */
>     After: 	/* size: 616, cachelines: 10, members: 56 */

Smaller is always better, but for a meaningful improvement, we'd want
to see more.  On my laptop running a Debian 6.6.15 kernel, I see:

inode_cache        11398  11475    640   25    4 : tunables    0    0    0 : slabdata    459    459      0

so there's 25 inodes per 4 pages.  Going down to 632 is still 25 per 4
pages.  At 628 bytes, we get 26 per 4 pages.  Ar 604 bytes, we're at 27.
And at 584 bytes, we get 28.

Of course, struct inode gets embedded in a lot of filesystem inodes.
xfs_inode         142562 142720   1024   32    8 : tunables    0    0    0 : slabdata   4460   4460      0
ext4_inode_cache      81     81   1184   27    8 : tunables    0    0    0 : slabdata      3      3      0
sock_inode_cache    2123   2223    832   39    8 : tunables    0    0    0 : slabdata     57     57      0

So any of them might cross a magic boundary where we suddenly get more
objects per slab.

Not trying to diss the work you've done here, just pointing out the
limits for anyone who's trying to do something similar.  Or maybe
inspire someone to do more reductions ;-)

  reply	other threads:[~2024-05-18  5:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18  0:08 [PATCH] fs: switch timespec64 fields in inode to discrete integers Jeff Layton
2024-05-18  5:23 ` Matthew Wilcox [this message]
2024-05-18 10:48   ` Jeff Layton
2024-05-21 16:08     ` David Sterba
2024-05-18 16:03   ` Linus Torvalds
2024-05-20 10:43 ` Jan Kara
2024-05-21 14:27 ` Christian Brauner

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=Zkg7OCSYJ7rzv6_D@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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