linux-rt-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Christian Brauner <brauner@kernel.org>
Cc: Eric Chanudet <echanude@redhat.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>, Ian Kent <ikent@redhat.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rt-devel@lists.linux.dev,
	Alexander Larsson <alexl@redhat.com>,
	Lucas Karpinski <lkarpins@redhat.com>
Subject: Re: [PATCH v4] fs/namespace: defer RCU sync for MNT_DETACH umount
Date: Wed, 9 Apr 2025 15:14:44 +0200	[thread overview]
Message-ID: <20250409131444.9K2lwziT@linutronix.de> (raw)
In-Reply-To: <20250409-egalisieren-halbbitter-23bc252d3a38@brauner>

On 2025-04-09 12:37:06 [+0200], Christian Brauner wrote:
> I still hate this with a passion because it adds another special-sauce
> path into the unlock path. I've folded the following diff into it so it
> at least doesn't start passing that pointless boolean and doesn't
> introduce __namespace_unlock(). Just use a global variable and pick the
> value off of it just as we do with the lists. Testing this now:

I tried to apply this on top of the previous one but it all chunks
failed.

One question: Do we need this lazy/ MNT_DETACH case? Couldn't we handle
them all via queue_rcu_work()?
If so, couldn't we have make deferred_free_mounts global and have two
release_list, say release_list and release_list_next_gp? The first one
will be used if queue_rcu_work() returns true, otherwise the second.
Then once defer_free_mounts() is done and release_list_next_gp not
empty, it would move release_list_next_gp -> release_list and invoke
queue_rcu_work().
This would avoid the kmalloc, synchronize_rcu_expedited() and the
special-sauce.

> diff --git a/fs/namespace.c b/fs/namespace.c
> index e5b0b920dd97..25599428706c 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -1840,29 +1842,21 @@ static void __namespace_unlock(bool lazy)
> +               d = kmalloc(sizeof(struct deferred_free_mounts), GFP_KERNEL);
> +               if (d) {
> +                       hlist_move_list(&head, &d->release_list);
> +                       INIT_RCU_WORK(&d->rwork, defer_free_mounts);
> +                       queue_rcu_work(system_wq, &d->rwork);

Couldn't we do system_unbound_wq?

Sebastian

  reply	other threads:[~2025-04-09 13:14 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 20:58 [PATCH v4] fs/namespace: defer RCU sync for MNT_DETACH umount Eric Chanudet
2025-04-09 10:37 ` Christian Brauner
2025-04-09 13:14   ` Sebastian Andrzej Siewior [this message]
2025-04-09 14:02     ` Mateusz Guzik
2025-04-09 14:25       ` Sebastian Andrzej Siewior
2025-04-09 16:04         ` Christian Brauner
2025-04-10  3:04           ` Ian Kent
2025-04-10  8:28           ` Sebastian Andrzej Siewior
2025-04-10 10:48             ` Christian Brauner
2025-04-10 13:58           ` Ian Kent
2025-04-11  2:36             ` Ian Kent
2025-04-09 16:08         ` Eric Chanudet
2025-04-11 15:17           ` Christian Brauner
2025-04-11 18:30             ` Eric Chanudet
2025-04-09 16:09     ` Christian Brauner
2025-04-10  1:17   ` Ian Kent
2025-04-09 13:04 ` Mateusz Guzik
2025-04-09 16:41   ` Eric Chanudet
2025-04-16 22:11 ` Mark Brown
2025-04-17  9:01   ` Christian Brauner
2025-04-17 10:17     ` Ian Kent
2025-04-17 11:31       ` Christian Brauner
2025-04-17 11:49         ` Mark Brown
2025-04-17 15:12         ` Christian Brauner
2025-04-17 15:28           ` Christian Brauner
2025-04-17 15:31             ` Sebastian Andrzej Siewior
2025-04-17 16:28               ` Christian Brauner
2025-04-17 22:33                 ` Eric Chanudet
2025-04-18  1:13                 ` Ian Kent
2025-04-18  1:20                   ` Ian Kent
2025-04-18  8:47                     ` Christian Brauner
2025-04-18 12:55                       ` Christian Brauner
2025-04-18 19:59                       ` Christian Brauner
2025-04-18 21:20                         ` Eric Chanudet
2025-04-19  1:24                       ` Ian Kent
2025-04-19 10:44                         ` Christian Brauner
2025-04-19 13:26                           ` Christian Brauner
2025-04-21  0:12                             ` Ian Kent
2025-04-21  0:44                               ` Al Viro
2025-04-18  0:31           ` Ian Kent
2025-04-18  8:59             ` Christian Brauner
2025-04-19  1:14               ` Ian Kent
2025-04-20  4:24           ` Al Viro
2025-04-20  5:54 ` Al Viro
2025-04-22 19:53   ` Eric Chanudet
2025-04-23  2:15     ` Al Viro
2025-04-23 15:04       ` Eric Chanudet

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=20250409131444.9K2lwziT@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=alexl@redhat.com \
    --cc=brauner@kernel.org \
    --cc=clrkwllms@kernel.org \
    --cc=echanude@redhat.com \
    --cc=ikent@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=lkarpins@redhat.com \
    --cc=rostedt@goodmis.org \
    --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;
as well as URLs for NNTP newsgroup(s).