Linux filesystem development
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	 Jann Horn <jannh@google.com>
Subject: Re: [PATCH RFC 0/4] fs: port files to rcuref_long_t
Date: Mon, 7 Oct 2024 09:37:30 +0200	[thread overview]
Message-ID: <20241007-hundstage-ablesen-294eddfbe9c2@brauner> (raw)
In-Reply-To: <CAHk-=wg2VQzbenNK2puyjMQnpCLeXih92B8032Q-9ur0z33iXw@mail.gmail.com>

On Sun, Oct 06, 2024 at 11:09:30AM GMT, Linus Torvalds wrote:
> On Sun, 6 Oct 2024 at 03:21, Christian Brauner <brauner@kernel.org> wrote:
> >
> > Iiuc, then we should retain the deadzone handling but should replace
> > atomic_long_add_negative() with atomic_long_add_negative_relaxed().
> 
> I assume you meant the other way around.
> 
> However, then it's not the same as the regular rcuref any more. It
> looks similar, it sounds similar, but it's something completely
> different.
> 
> I definitely do *not* want to have "rcuref_long_get()" fundamentally
> different from just plain "rcuref_get()" .

Right, that's why I added a separate helper. IOW, I didn't change the
behavior of the helper.

> 
> Now, maybe we should just make the plain version also do a full memory
> barrier. Honestly, we have exactly *one* user of rcyref_get(): the
> networking code dst cache. Using the relaxed op clearly makes no
> difference at all on x86, and it _probably_ makes little to no
> difference on other relevant architectures either.
> 
> But if the networking people want their relaxed version, I really
> really don't want rcuref_long_get() using non-relaxed one. And with
> just one single user of the existing rcuref code, and now another
> single user of the "long" variant, I really don't think it makes much
> sense as a "library".
> 
> IOW, my gut feeling is that you'd actually be better off just taking
> the rcuref code, changing it to using atomic_long_t and the
> non-relaxed version, and renaming it to "file_ref", and keep it all
> purely in fs/file.c (actually right now it's oddly split between
> fs/file.c and fs/file_table.c, but whatever - you get the idea).
> 
> Trying to make it a library when it has one user and that one user
> wants a very very different model than the other user that looked
> similar smells like a BAD idea to me.

Ok, sounds good.

  reply	other threads:[~2024-10-07  7:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-05 19:16 [PATCH RFC 0/4] fs: port files to rcuref_long_t Christian Brauner
2024-10-05 19:16 ` [PATCH RFC 1/4] fs: protect backing files with rcu Christian Brauner
2024-10-05 19:16 ` [PATCH RFC 2/4] types: add rcuref_long_t Christian Brauner
2024-10-05 19:16 ` [PATCH RFC 3/4] rcuref: add rcuref_long_*() helpers Christian Brauner
2024-10-05 19:16 ` [PATCH RFC 4/4] fs: port files to rcuref_long_t Christian Brauner
2024-10-05 21:42 ` [PATCH RFC 0/4] " Linus Torvalds
2024-10-05 22:01   ` Al Viro
2024-10-05 22:14     ` Linus Torvalds
2024-10-05 22:28       ` Al Viro
2024-10-05 22:43         ` Linus Torvalds
2024-10-05 22:51           ` Al Viro
2024-10-06  9:55           ` Christian Brauner
2024-10-05 22:01   ` Linus Torvalds
2024-10-06 10:21     ` Christian Brauner
2024-10-06 18:09       ` Linus Torvalds
2024-10-07  7:37         ` Christian Brauner [this message]
2024-10-06  9:48   ` Christian Brauner

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=20241007-hundstage-ablesen-294eddfbe9c2@brauner \
    --to=brauner@kernel.org \
    --cc=jannh@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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