From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796146891; b=kVY4fwfwrwaxyIPJiFZMj6XBJiSWN6g/fsPtnZcFPghr19nIQKHBLRXNim9h/WpX1e1b zFT01qmLe4pu0T1cOD4679Pym6pVErtknYYDANbiZ3cdNEzcRNlwggHm82NUJiabUuyr1 o3+6CuGFRyQ7y3gm25w8fz0x9NCf0DEarUd1MzyVvXbInB3eVnlP6ynhodIEIgRIcxJk9 xK0vE+p0MlTxaMJNZCDMfCgMxfMScgQe+9OilLVdgYfkTKteelXBpVOHFu67b9uJZPgjD HuwQY+ht3cbUDapZ5cyyt5juLifn/jgr44Wyh+xdFxdKjkOq+yKsWW3ekxtGQ3wqj7Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796146891; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=5kPfKEdHQ/ebffkcSc66mOsEcL5VkEJR0KAlu68t4Qc=; b=5Nv6uPV4BKYjxbW5XSicXabCLGywJBmgxSsVQe9TvYoxqgKgY7FUPsTPL0tRd97srKiJ 9VcsuMzxfJGIewToYsWmkhyWjeu0rqcs1yK3FzPZdlAASXy/MLbv7uHMtCSYs/lrfNzDL vzTOCjucihew9QEQTgISlE89epCIC0CWqgEJDRoDC9obyqJiKmYKbrBjp+ljowvO6hDPI kbsjiutEW0aOLNY8im2mSJMHIVY4oJ/XX1yzpsWdqgdhYt+hpjWnwmgNQeUOhw9KSIQct u42eQ4ZjECiZBt/X4c2fv4F5mSCGXNmNDC3dvU5medbcyD6jYQTY7J2ca+mrarQ9KQQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--penghuang.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=ZI4PjD3s; arc=none smtp.remote-ip=74.125.82.200 Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8233D606A31A for ; Tue, 1 Dec 2026 17:41:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8233D606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--penghuang.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=ZI4PjD3s Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-38355b03cb8so11131822eec.0 for ; Tue, 01 Dec 2026 09:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796146886; x=1796751686; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=5kPfKEdHQ/ebffkcSc66mOsEcL5VkEJR0KAlu68t4Qc=; b=ZI4PjD3s5pU1n7ZU/2AMPyys36Fu3PnJPjgVrawu/hekGATmanoqkUSdo1zrGAv42N aLJx5tdMNw27vwhYrPYxPaf24cT3wO83x4uON3gTrkZZjBesG+bi5x9lz8CWE4YCBSXo makjPPAd+27wLaOZjZZla/RCekDQ95snJxxVDVJUHGWr3IuYJObc4I5uABQuB3JEwjsU 2BHtPM7xqE2Zk0txOaL+7FlYE8jFiQLYsT5uZ7vB8Kf9YaZa4xh1F784ml6u5IGnLvHX GKVihQLhN4wweWNaT9Yx8EVJm8M3+Xwg6JWjFq5UaXA8HBDFkLgtqgkJKe9GWEiBtffg 4BSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796146886; x=1796751686; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=5kPfKEdHQ/ebffkcSc66mOsEcL5VkEJR0KAlu68t4Qc=; b=oDD7h8LX/zNM/4nfamNv2ljeKBOKW1iKfoVXGJuVyh9OLIP7EGOcy/YReu67wDC1Eq jVCUC73LhK8DkbLOgoqGWuSl+Cm7RRj53ekS63fu3+IP/Av0Amz/Wh9C0Pmp3Awh2MMG 3lhokwPoQqbH22WuAr4dFcu0T41L1OMqGt1zxlY/x/gmKvPT9CqA4UVt8d9+nb9N0Fbh QtxImvY6x1ddDqsbfFIenBxCAZQnK5mzo26vFiWPqdgp/viXWqXH8cZwjVNrg2+gkVm9 U5C6m5BEdOffWBgNa5XB99esVYPDOasCsXRKJoKmsENxdTPO66Evp3OXySc9FC0TWwMO lSbw== X-Forwarded-Encrypted: i=1; AL+hErH5+8Ergvk/GIwIfdNtAX8ullAgeb1Uu1R5yMnmgxZaXVULb0oOyBbFxeK+u4AEVE0j1s11jzHjnZ6gw2g=@vger.kernel.org X-Gm-Message-State: APuU4Z/sCg8vz9LqmqGB1El67cTrj3tww5kARto+ulkNaCCc4W22mGYO Vwu1lVG1/MsW0irtm7rPJC+GZ+RMQKVnnreyPaQ0IRrGz7MYVslSiyqmQ+V60r/izXHr6nnn+dg NAGwWEY8MXJ/JO1MQxg== X-Received: from dycnn7.prod.google.com ([2002:a05:7301:1407:b0:384:71f1:1227]) (user=penghuang job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7301:e0c8:b0:386:c724:cc68 with SMTP id 5a478bee46e88-386c724ceb2mr21012091eec.2.1796146885128; Tue, 01 Dec 2026 09:41:25 -0800 (PST) Date: Tue, 1 Dec 2026 09:41:24 -0800 In-Reply-To: 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 References: <20261201062738.1047159-1-penghuang@google.com> <20261201062738.1047159-3-penghuang@google.com> X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261201174124.3578350-1-penghuang@google.com> Subject: Re: [RFC PATCH v2 2/6] btrfs: untrack i_rwsem before io_uring encoded read completion From: Peng Huang To: Christoph Hellwig 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, Peng Huang Content-Type: text/plain; charset="UTF-8" On Tue, Dec 01, 2026 at 12:40:51AM -0800, Christoph Hellwig wrote: > I only see patch 2 on the btrfs list, so something got really messed up > in your patch sending. Sorry, I used per-patch --cc-cmd so linux-btrfs only got patch 2. The full series is here: https://lore.kernel.org/all/20261201062738.1047159-1-penghuang@google.com/ I'll Cc the cover letter to linux-btrfs next time. > 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. Good point. btrfs_uring_read_extent() and btrfs_uring_read_finished() already call btrfs_lockdep_inode_release() / acquire() for this handoff, so replacing both that and rwsem_boost_untrack() with a proper pair on rw_semaphore makes much more sense. One small thing: we'd want to disown before submitting the async read (and re-own on error) since completion can unlock i_rwsem right away. Do you or the locking folks have a preferred name, like rwsem_disown_read() / rwsem_own_read()? Thanks, Peng