From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="HLN15rxS" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A76C111 for ; Sat, 25 Nov 2023 21:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BFdmgWqpI/imfedi/zQTMTb5eYeuOEdtJupWmeLMbOM=; b=HLN15rxSUJze4axJN0R/QMY/s5 l8PaC3C7riOCr5mBtFbblasn/+XbUv2pI/UTJxgEvbHLAhZR0q6JWzCwUtZ5mszMfYFIFeYh9STcR TfzJ4AtCQvF/o7Aw49vxyBYi8DKd4HdoEbRYcKzWe9TImT9bMRGshOQnd4QP0tDjJvNfs8kjV9Qee WCLvysdUJHddaZlvWqwPfR+9OrKJYy1UO4fFk6/LWNRAxgalhDKw99pxIZbmiC72y/UwyklcDQPMY JZJQETIaEj6G7BLlGOZDbMbTXKNPvWfK1WJVM1T5pwKUZYJKsaqvAJJ1BgZ4RJIJdxKPL0Y6xj6Ts xGyLtOHA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1r77NY-003LMm-0g; Sun, 26 Nov 2023 05:08:24 +0000 Date: Sun, 26 Nov 2023 05:08:24 +0000 From: Al Viro To: Linus Torvalds Cc: linux-fsdevel@vger.kernel.org, Mateusz Guzik , Christian Brauner Subject: Re: [RFC][PATCH] simpler way to get benefits of "vfs: shave work on failed file open" Message-ID: <20231126050824.GE38156@ZenIV> References: <20231126020834.GC38156@ZenIV> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro On Sat, Nov 25, 2023 at 08:59:54PM -0800, Linus Torvalds wrote: > On Sat, 25 Nov 2023 at 18:08, Al Viro wrote: > > > > However, all of that can be achieved easier - all it takes is fput() > > recognizing that case and calling file_free() directly. > > No need to introduce a special primitive for that - and things like > > failing dentry_open() could benefit from that as well. > > > > Objections? > > Ack, looks fine. > > In fact, I did suggest something along the lines at the time: > > https://lore.kernel.org/all/CAHk-=whLadznjNKZPYUjxVzAyCH-rRhb24_KaGegKT9E6A86Kg@mail.gmail.com/ > > although yours is simpler, because I for some reason (probably looking > at Mateusz' original patch too much) re-implemented file_free() as > fput_immediate().. file_free() was with RCU delay at that time, IIRC. I don't think that cost of one test and (rarely) branch on each final fput() is going to be measurable. Mateusz, do you still have the setup you used for the original patch? Could you profile and compare the current tree and current tree + the patch upthread?