From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.137.202.133 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796114457; b=1FndzXcytgp3Z7v39jkDxhVVuqxtK6pr7oyqbYMALKJo9T+HucAVhq2MgcWM5MxFO8va WhmKCo0DHoM36X3KTLOBSz8eOgjFo3GOilSEp292jeD9wSKCyo9m+w9mKZCX3BG9fveE2 gUeaKXIxBUuQzLeIPD8BuHHCaC1HgDGvHoHY7/3F7odonzk+iS4pDC47i20VyU0/uv4rZ u3LI62G0snTqqD530f+dT7jOTpji+Jrz1bLCf0FlPFyUN2hh/1704f3o72Ezi1AMYkANi j6e7o3Kp4dCgLZBTNv3DBe8bhpee8jaJ6xIWbc9kaA7jAM3ZHWSSrsRygvdRettp8Mg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796114457; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:X-SRS-Rewrite; bh=mMzN6eXDV7RTu7eDG31o8yebrDIOB2NeFYKq8d4s10c=; b=PxNkwLDxXpnmXPoYbCQPRdbp5wPdNz8i+UtU8YNEt5tyz+V83wBL/ExtqOw1Bb4hGJ7g Q9HYPXzwdSIlkzLCtvi975JYVPAHt8frJFSuk2f3vS/doG/O/ZzvY71wFfMB07doUTIEY o3+VbentyBb2UPjHE5quoLOGsHcWSi7JNq6pCL9hbJXMV/yoNoz9yPGQmP0hq0OtuWPf0 yPOp7UhYdzeUOaRi5QVG5VIAgOvMpvxdGfTAhCygG1Ywwo+IZUTOiiLdvjfqG9CS7eRRY lhJqUqef403ImlRJklStLpgJlUa9ICfEZ8hd628Tu4mFa0YqNw3tfv1l8wDQLzycTHw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=4VUuQYNP; arc=none smtp.remote-ip=198.137.202.133 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABF89606A31A; Tue, 1 Dec 2026 08:40:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ABF89606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=4VUuQYNP DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mMzN6eXDV7RTu7eDG31o8yebrDIOB2NeFYKq8d4s10c=; b=4VUuQYNPD+stR3xZ2AJjyTpZri +HvwcoHSzqdCUjJUM5r/rtip75Ja6LsZ+boaoG7vmI9Pt39OFJoVz1BoeXSQMbfabuieEgk1dmND0 S/ZrXf6pzVYb0JIgOF/K7IjfAvR3R3mSvXTHrpdB0n+HhMSzrehqFNKz2JvWreqHB9z+tB2Til44L qKB9GaeCPkWYPLmGax7QP2ZTu5Y3e9+zFMdJLdCj5s7Bisf0hYRxg3s4MLIqj8z6Acu6c8FnAHzC6 NwwslVv3PgLPjSfJ7SSXZ/8ogufz+38gvyRJHuPBk/Z8f+aJ7+skYM14oJiwHF+DXVqjOrSUQIKMc /HQ86RFg==; Received: from hch by bombadil.infradead.org with local (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYJPv-0000000743l-19WN; Tue, 01 Dec 2026 08:40:51 +0000 Date: Tue, 1 Dec 2026 00:40:51 -0800 From: Christoph Hellwig To: Peng Huang Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Juri Lelli , Vincent Guittot , Waiman Long , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , John Stultz , Suren Baghdasaryan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Sterba , Chris Mason , linux-btrfs@vger.kernel.org Subject: Re: [RFC PATCH v2 2/6] btrfs: untrack i_rwsem before io_uring encoded read completion Message-ID: References: <20261201062738.1047159-1-penghuang@google.com> <20261201062738.1047159-3-penghuang@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201062738.1047159-3-penghuang@google.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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.