All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Peng Huang <penghuang@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Boqun Feng <boqun@kernel.org>, Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Waiman Long <longman@redhat.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	John Stultz <jstultz@google.com>,
	Suren Baghdasaryan <surenb@google.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	David Sterba <dsterba@suse.com>, Chris Mason <mason@kernel.org>,
	linux-btrfs@vger.kernel.org
Subject: Re: [RFC PATCH v2 2/6] btrfs: untrack i_rwsem before io_uring encoded read completion
Date: Tue, 1 Dec 2026 00:40:51 -0800	[thread overview]
Message-ID: <aw6IE7NugiMw2-ws@infradead.org> (raw)
In-Reply-To: <20261201062738.1047159-3-penghuang@google.com>

I only see patch 2 on the btrfs list, so something got really messed up
in your patch sending.

On Mon, Nov 30, 2026 at 10:27:29PM -0800, Peng Huang wrote:
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 6ba883db107b..073450a6df95 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -4725,6 +4725,13 @@ static int btrfs_uring_read_extent(struct kiocb *iocb, struct iov_iter *iter,
>  	priv->lockend = lockend;
>  	priv->err = 0;
>  
> +	/*
> +	 * Once the reads are queued, btrfs_uring_read_finished() may
> +	 * unlock i_rwsem from another task, so stop tracking it as held
> +	 * by this one.  On error the caller's unlock finds no record.
> +	 */
> +	rwsem_boost_untrack(&inode->vfs_inode.i_rwsem);

I don't think this is a good interface (and it looks like you're adding
it given no existing in-tree matches).

Currently there's a gazillion different things that need to be done
for handing off locks and releasing them in other threads including
lockdep fake release/acquire annotations, hacks to make it shut off when
returning to userspace, etc.  Which is sad, as in I/O and file system
land the idea of taking a lock and handing it to a different completion
path makes perfect sense.

But we need a better interface for that, something like a disown just
before returning to userspace or the caller, and a "take ownership"
called as early as possible from the completion callback.  Let's build
such a proper highlevel interface and make it all the right things
instead of encoding implementation details all over the tree.



  reply	other threads:[~2026-12-01  8:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  6:27 [RFC PATCH v2 0/6] rwsem: priority boost for holders blocking high-priority waiters Peng Huang
2026-12-01  6:27 ` [RFC PATCH v2 1/6] locking/rwsem: Track held rwsems per task Peng Huang
2026-12-01  6:27 ` [RFC PATCH v2 2/6] btrfs: untrack i_rwsem before io_uring encoded read completion Peng Huang
2026-12-01  8:40   ` Christoph Hellwig [this message]
2026-12-01 14:43     ` Steven Rostedt
2026-12-01 17:41     ` Peng Huang
2026-12-02  6:20       ` Christoph Hellwig
2026-12-01  6:27 ` [RFC PATCH v2 3/6] locking/rwsem: Publish the top waiter priority Peng Huang
2026-12-01  6:27 ` [RFC PATCH v2 4/6] sched: Apply rwsem holder boost to the fair load weight Peng Huang
2026-12-02  6:28   ` sashiko-bot
2026-12-01  6:27 ` [RFC PATCH v2 5/6] sched/fair: Boost rwsem holders with contended high-priority waiters Peng Huang
2026-12-01  6:27 ` [RFC PATCH v2 6/6] locking/rwsem: Add KUnit tests for scheduler priority boost Peng Huang
2026-12-02  6:28   ` sashiko-bot
2026-12-01 20:43 ` [RFC PATCH v2 0/6] rwsem: priority boost for holders blocking high-priority waiters Kayra Cizmeci
2026-12-01 21:10   ` Peng Huang

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=aw6IE7NugiMw2-ws@infradead.org \
    --to=hch@infradead.org \
    --cc=boqun@kernel.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dsterba@suse.com \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=longman@redhat.com \
    --cc=mason@kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=penghuang@google.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=surenb@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=will@kernel.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 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.