lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230924-zementieren-milan-89b5b2650821@brauner>
Date:   Sun, 24 Sep 2023 12:15:34 +0200
From:   Christian Brauner <brauner@...nel.org>
To:     Amir Goldstein <amir73il@...il.com>
Cc:     Jeff Layton <jlayton@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jan Kara <jack@...e.cz>
Subject: Re: [GIT PULL v2] timestamp fixes

> As luck would have it, if my calculations are correct, on x86-64 and with

I hope you're aware that you can use pahole to get struct layouts and
that you don't have to manually calculate this...

> CONFIG_FS_POSIX_ACL=y, CONFIG_SECURITY=y (as they are on
> distro kernels), __i_ctime is exactly on split cache lines and maybe even

(Make sure that your kernel doesn't use randomize_layout...)

tv_nsec has always been on a split cacheline. We've optimized struct
file a little bit in the same way before as there were actual
regressions in some workloads

I can put it into one of the vfs.git perf branches that are tested by
LKP to see if there's any actual performance changes.

5.15:
        /* --- cacheline 1 boundary (64 bytes) --- */
        long unsigned int          i_ino;                                                /*    64     8 */
        union {
                const unsigned int i_nlink;                                              /*    72     4 */
                unsigned int       __i_nlink;                                            /*    72     4 */
        };                                                                               /*    72     4 */
        /* typedef dev_t -> __kernel_dev_t -> u32 -> __u32 */ unsigned int               i_rdev; /*    76     4 */
        /* typedef loff_t -> __kernel_loff_t */ long long int              i_size;       /*    80     8 */
        struct timespec64 {
                /* typedef time64_t -> __s64 */ long long int      tv_sec;               /*    88     8 */
                long int           tv_nsec;                                              /*    96     8 */
        }i_atime; /*    88    16 */
        struct timespec64 {
                /* typedef time64_t -> __s64 */ long long int      tv_sec;               /*   104     8 */
                long int           tv_nsec;                                              /*   112     8 */
        }i_mtime; /*   104    16 */
        struct timespec64 {
                /* typedef time64_t -> __s64 */ long long int      tv_sec;               /*   120     8 */
                /* --- cacheline 2 boundary (128 bytes) --- */
                long int           tv_nsec;                                              /*   128     8 */
        }i_ctime; /*   120    16 */
        /* typedef spinlock_t */ struct spinlock {

6.6:
        /* --- cacheline 1 boundary (64 bytes) --- */
        long unsigned int          i_ino;                                                /*    64     8 */
        union {
                const unsigned int i_nlink;                                              /*    72     4 */
                unsigned int       __i_nlink;                                            /*    72     4 */
        };                                                                               /*    72     4 */
        /* typedef dev_t -> __kernel_dev_t -> u32 -> __u32 */ unsigned int               i_rdev; /*    76     4 */
        /* typedef loff_t -> __kernel_loff_t */ long long int              i_size;       /*    80     8 */
        struct timespec64 {
                /* typedef time64_t -> __s64 */ long long int      tv_sec;               /*    88     8 */
                long int           tv_nsec;                                              /*    96     8 */
        }i_atime; /*    88    16 */
        struct timespec64 {
                /* typedef time64_t -> __s64 */ long long int      tv_sec;               /*   104     8 */
                long int           tv_nsec;                                              /*   112     8 */
        }i_mtime; /*   104    16 */
        struct timespec64 {
                /* typedef time64_t -> __s64 */ long long int      tv_sec;               /*   120     8 */
                /* --- cacheline 2 boundary (128 bytes) --- */
                long int           tv_nsec;                                              /*   128     8 */
        }__i_ctime; /*   120    16 */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ