From: Dave Chinner <david@fromorbit.com>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org,
josef@toxicpanda.com, hch@infradead.org
Subject: Re: [PATCH v3 1/2] vfs: add rcu-based find_inode variants for iget ops
Date: Wed, 12 Jun 2024 07:43:23 +1000 [thread overview]
Message-ID: <ZmjE+y9nw/+1CnJB@dread.disaster.area> (raw)
In-Reply-To: <CAGudoHHFh1d3AWcGQ-dm=DbwR8o-+a6+pcsvQbW-F_=qxbD0LA@mail.gmail.com>
On Tue, Jun 11, 2024 at 03:13:45PM +0200, Mateusz Guzik wrote:
> On Tue, Jun 11, 2024 at 3:04 PM Christian Brauner <brauner@kernel.org> wrote:
> >
> > On Tue, Jun 11, 2024 at 01:40:37PM +0200, Mateusz Guzik wrote:
> > > On Tue, Jun 11, 2024 at 12:50:11PM +0200, Jan Kara wrote:
> > > > On Tue 11-06-24 12:16:31, Mateusz Guzik wrote:
> > > > > +/**
> > > > > + * ilookup5 - search for an inode in the inode cache
> > > > ^^^ ilookup5_rcu
> > > >
> > >
> > > fixed in my branch
> > >
> > > > > + * @sb: super block of file system to search
> > > > > + * @hashval: hash value (usually inode number) to search for
> > > > > + * @test: callback used for comparisons between inodes
> > > > > + * @data: opaque data pointer to pass to @test
> > > > > + *
> > > > > + * This is equivalent to ilookup5, except the @test callback must
> > > > > + * tolerate the inode not being stable, including being mid-teardown.
> > > > > + */
> > > > ...
> > > > > +struct inode *ilookup5_nowait_rcu(struct super_block *sb, unsigned long hashval,
> > > > > + int (*test)(struct inode *, void *), void *data);
> > > >
> > > > I'd prefer wrapping the above so that it fits into 80 columns.
> > > >
> > >
> > > the last comma is precisely at 80, but i can wrap it if you insist
> > >
> > > > Otherwise feel free to add:
> > > >
> > > > Reviewed-by: Jan Kara <jack@suse.cz>
> > > >
> > >
> > > thanks
> > >
> > > I'm going to wait for more feedback, tweak the commit message to stress
> > > that this goes from 2 hash lock acquires to 1, maybe fix some typos and
> > > submit a v4.
> > >
> > > past that if people want something faster they are welcome to implement
> > > or carry it over the finish line themselves.
> >
> > I'm generally fine with this but I would think that we shouldn't add all
> > these helpers without any users. I'm not trying to make this a chicken
> > and egg problem though. Let's get the blessing from Josef to convert
> > btrfs to that *_rcu variant and then we can add that helper. Additional
> > helpers can follow as needed? @Jan, thoughts?
>
> That's basically v1 of the patch (modulo other changes like EXPORT_SYMBOL_GPL).
>
> It only has iget5_locked_rcu for btrfs and ilookup5_rcu for bcachefs,
> which has since turned out to not use it.
>
> Jan wanted iget5_locked_rcu to follow the iget5_locked in style, hence
> I ended up with 3 helpers instead of 1.
We don't need any extra APIs if you just convert the inode cache to
using hash-bl rather than just converting lookups to RCU. Everyone
automatically gets the all extra scalability improvements and no new
interfaces are needed at all.
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2024-06-11 21:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 10:16 [PATCH v3 0/2] rcu-based inode lookup for iget* Mateusz Guzik
2024-06-11 10:16 ` [PATCH v3 1/2] vfs: add rcu-based find_inode variants for iget ops Mateusz Guzik
2024-06-11 10:50 ` Jan Kara
2024-06-11 11:40 ` Mateusz Guzik
2024-06-11 13:04 ` Christian Brauner
2024-06-11 13:13 ` Mateusz Guzik
2024-06-11 21:43 ` Dave Chinner [this message]
2024-06-11 10:16 ` [PATCH v3 2/2] btrfs: use iget5_locked_rcu Mateusz Guzik
2024-06-11 16:49 ` [PATCH v3 0/2] rcu-based inode lookup for iget* Josef Bacik
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=ZmjE+y9nw/+1CnJB@dread.disaster.area \
--to=david@fromorbit.com \
--cc=brauner@kernel.org \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.com \
--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