All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Max Kellermann <max.kellermann@ionos.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: When to lock pipe->rd_wait.lock?
Date: Wed, 20 Sep 2023 17:50:26 +0200	[thread overview]
Message-ID: <20230920-kabine-senden-e1a137f3d7cc@brauner> (raw)
In-Reply-To: <CAKPOu+9uO=wbTnesZ-jCw5E+AY1fwvcXykBtEQYOzHTyEeP_8g@mail.gmail.com>

On Wed, Sep 20, 2023 at 05:21:03PM +0200, Max Kellermann wrote:
> On Wed, Sep 20, 2023 at 3:30 PM Christian Brauner <brauner@kernel.org> wrote:
> > Afaict, the mutex is sufficient protection unless you're using
> > watchqueues which use post_one_notification() that cannot acquire the
> > pipe mutex. Since splice operations aren't supported on such kernel
> > notification pipes - see get_pipe_info() - it should be unproblematic.
> 
> Which means that the spinlocks can safely be removed from
> pipe_write(), because they are unnecessary overhead?

I don't think so, O_NOTIFICATION/watch queue pipes allow userspace to
use pipe_read() and pipe_write() but prevent the usage of splice. The
spinlock is there for post_one_notification() which is called from
kernel context.

  reply	other threads:[~2023-09-20 15:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 12:34 When to lock pipe->rd_wait.lock? Max Kellermann
2023-09-20 13:30 ` Christian Brauner
2023-09-20 15:21   ` Max Kellermann
2023-09-20 15:50     ` Christian Brauner [this message]
2023-09-20 16:14       ` Max Kellermann
2023-09-21  7:28   ` Max Kellermann
2023-09-21  8:05     ` Max Kellermann
2023-09-21  9:17       ` Christian Brauner
2023-09-21  9:38         ` Max Kellermann

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=20230920-kabine-senden-e1a137f3d7cc@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=max.kellermann@ionos.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.