mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v2 89/89] fs: move i_generation into new hole created after timestamp conversion
Date: Thu, 05 Oct 2023 08:45:53 -0400	[thread overview]
Message-ID: <9af5c896da0c39c66d0555879c04c23fd853c9de.camel@kernel.org> (raw)
In-Reply-To: <CAOQ4uxgtyaBTM1bOSSGmsk+F4ZwsK+-N5ZZ3wAt_nv_E6G3C7Q@mail.gmail.com>

On Thu, 2023-10-05 at 08:08 +0300, Amir Goldstein wrote:
> On Wed, Oct 4, 2023 at 9:56 PM Jeff Layton <jlayton@kernel.org> wrote:
> > 
> > The recent change to use discrete integers instead of struct timespec64
> > shaved 8 bytes off of struct inode, but it also moves the i_lock
> > into the previous cacheline, away from the fields that it protects.
> > 
> > Move i_generation above the i_lock, which moves the new 4 byte hole to
> > just after the i_fsnotify_mask in my setup.
> 
> Might be good to mention that this hole has a purpose...
> 
> > 
> > Suggested-by: Amir Goldstein <amir73il@gmail.com>
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> >  include/linux/fs.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/fs.h b/include/linux/fs.h
> > index 485b5e21c8e5..686c9f33e725 100644
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -677,6 +677,7 @@ struct inode {
> >         u32                     i_atime_nsec;
> >         u32                     i_mtime_nsec;
> >         u32                     i_ctime_nsec;
> > +       u32                     i_generation;
> >         spinlock_t              i_lock; /* i_blocks, i_bytes, maybe i_size */
> >         unsigned short          i_bytes;
> >         u8                      i_blkbits;
> > @@ -733,7 +734,6 @@ struct inode {
> >                 unsigned                i_dir_seq;
> >         };
> > 
> > -       __u32                   i_generation;
> > 
> >  #ifdef CONFIG_FSNOTIFY
> >         __u32                   i_fsnotify_mask; /* all events this inode cares about */
> 
> If you post another version, please leave a comment here
> 
> +         /* 32bit hole reserved for expanding i_fsnotify_mask to 64bit */
> 

Sure.

I suppose we could create a union there too if you really want to
reserve it:

	union {
		__u32		i_fsnotify_mask;
		__u64		__i_fsnotify_mask_ext;
	};

-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2023-10-05 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 18:55 [PATCH v2 87/89] fs: rename inode i_atime and i_mtime fields Jeff Layton
2023-10-04 18:55 ` [PATCH v2 88/89] fs: switch timespec64 fields in inode to discrete integers Jeff Layton
2023-10-04 18:55 ` [PATCH v2 89/89] fs: move i_generation into new hole created after timestamp conversion Jeff Layton
2023-10-05  5:08   ` Amir Goldstein
2023-10-05 12:45     ` Jeff Layton [this message]
2023-10-05 13:07       ` Amir Goldstein

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=9af5c896da0c39c66d0555879c04c23fd853c9de.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome