From: "Theodore Ts'o" <tytso@mit.edu>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
Amir Goldstein <amir73il@gmail.com>,
Jeff Layton <jlayton@kernel.org>,
Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH] uidgid: make sure we fit into one cacheline
Date: Tue, 10 Sep 2024 09:00:43 -0400 [thread overview]
Message-ID: <20240910130043.GA1545671@mit.edu> (raw)
In-Reply-To: <aqoub7lr2zg6mlxmhe4xgulk2vteu6p2rsptqajxol2qawgtef@mz2xks2gkjul>
On Tue, Sep 10, 2024 at 12:48:16PM +0200, Mateusz Guzik wrote:
> May I suggest adding a compile-time assert on the size? While it may be
> growing it will be unavoidable at some point, it at least wont happen
> unintentionally.
That should be fine for this structure since everything is defined in
terms of types that should be fixed across architectures, and they
aren't using any types that might change depending on the kernel
config, but as a general matter, we should be a bit careful when
rearranging structrues to avoid holes and to keep things on the same
cache line.
I recently had a patch submission which was rearranging structure
order for an ext4 data structure, and what worked for the patch
submitter didn't work for me, because of differences between kernel
configs and/or architecture types.
So it's been on my todo list to do a sanity check of various ext4
structuers, but to do so checking a number of different architectures
and common production kernel configs (I don't really care if enabling
lockdep results in more holes, because performance is going to be
impacted way more for reasons other than cache lines :-).
Hmm, maybe fodder for a GSOC or intern project would be creating some
kind of automation to check for optimal structure layouts across
multiple configs/architectures?
- Ted
next prev parent reply other threads:[~2024-09-10 13:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 8:16 [PATCH] uidgid: make sure we fit into one cacheline Christian Brauner
2024-09-10 10:48 ` Mateusz Guzik
2024-09-10 13:00 ` Theodore Ts'o [this message]
2024-09-10 13:44 ` Mateusz Guzik
2024-09-10 13:51 ` Jeff Layton
2024-09-10 17:16 ` Matthew Wilcox
2024-09-10 18:50 ` Jeff Layton
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=20240910130043.GA1545671@mit.edu \
--to=tytso@mit.edu \
--cc=amir73il@gmail.com \
--cc=arnd@arndb.de \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mjguzik@gmail.com \
/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