fs: switch timespec64 fields in inode to discrete integers
authorJeff Layton <jlayton@kernel.org>
Sat, 18 May 2024 00:08:40 +0000 (20:08 -0400)
committerChristian Brauner <brauner@kernel.org>
Mon, 27 May 2024 13:58:46 +0000 (15:58 +0200)
commit3aa63a569c64e708df547a8913c84e64a06e7853
treece9a4bff9586690c2bb689c2f826a0de5c8e7156
parent23cc6ef6fd453b13502caae23130844e7d6ed0fe
fs: switch timespec64 fields in inode to discrete integers

Adjacent struct timespec64's pack poorly. Switch them to discrete
integer fields for the seconds and nanoseconds. This shaves 8 bytes off
struct inode with a garden-variety Fedora Kconfig on x86_64, but that
also moves the i_lock into the previous cacheline, away from the fields
it protects.

To remedy that, move i_generation above the i_lock, which moves the new
4-byte hole to just after the i_fsnotify_mask in my setup. Amir has
plans to use that to expand the i_fsnotify_mask, so add a comment to
that effect as well.

Cc: Amir Goldstein <amir73il@gmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20240517-amtime-v1-1-7b804ca4be8f@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/fs.h