Re: [PATCH v2 1/4] file: add fput and file_ref_put routines optimized for use when closing a fd
From: Mateusz Guzik
Date: Wed Mar 05 2025 - 07:40:50 EST
On Wed, Mar 5, 2025 at 11:47 AM Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> On Tue, Mar 04, 2025 at 07:35:03PM +0100, Mateusz Guzik wrote:
> > Vast majority of the time closing a file descriptor also operates on the
> > last reference, where a regular fput usage will result in 2 atomics.
> > This can be changed to only suffer 1.
> >
> > See commentary above file_ref_put_close() for more information.
> >
> > Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
> > ---
>
> I'm not enthused about the patches tbh because we end up with two new
> primivites and I really dislike so many new primitives with slightly
> different semantics. But it should at least all be kept private to fs/.
>
Caller-observable behavior is the same, so I don't think this is a big
deal. The intent was to keep this very much for vfs-internal usage.
The EXPORT thing was copy-pasto.
Anyhow, everyone interested can still just fput so this does not put
any burden on other people afaics. The few patched spots are very much
vfs-internal.
I sent v3 with the feedback addressed.
--
Mateusz Guzik <mjguzik gmail.com>