[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGudoHGN8ZKGCQCARU3kxX2XTk=LJE-AVGzPjYcQTjLcbCwqrA@mail.gmail.com>
Date: Wed, 19 Mar 2025 17:16:06 +0100
From: Mateusz Guzik <mjguzik@...il.com>
To: Jan Kara <jack@...e.cz>
Cc: brauner@...nel.org, viro@...iv.linux.org.uk, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] fs: load the ->i_sb pointer once in inode_sb_list_{add,del}
On Wed, Mar 19, 2025 at 5:11 PM Jan Kara <jack@...e.cz> wrote:
>
> On Wed 19-03-25 01:46:35, Mateusz Guzik wrote:
> > While this may sound like a pedantic clean up, it does in fact impact
> > code generation -- the patched add routine is slightly smaller.
> >
> > Signed-off-by: Mateusz Guzik <mjguzik@...il.com>
>
> I'm surprised it matters for the compiler but as Christian wrote, why not.
> Feel free to add:
>
In stock code the fence in spin_lock forces the compiler to load
->i_sb again -- as far as it knows it could have changed.
On the other this patch forces the compiler to remember the value for
the same reason, which turns out to produce less code.
--
Mateusz Guzik <mjguzik gmail.com>
Powered by blists - more mailing lists