From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F62D2DECBA for ; Tue, 27 Jan 2026 06:15:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769494557; cv=none; b=lT3ImOX6ys3rufWkFdBH6Z1/o7QOBO+94ZQFNZtaV2CzAM7KCaxzkZaqt9/KPAOYRnnVYczMbW2qmPBnDTawXUSR+VHJyX6tpTLykhVP+enJSK+ADs8C1kawozBcK+BJWc4zzouFROFTgkNS+Rc/qI19QkpNNZhBiL/0BCEdWU8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769494557; c=relaxed/simple; bh=A+Qvt7PJ1zzJc5nC8vIE7nhGKBhLxaI43psasrisBGg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cdrmKRdtfSzSH1LmI7iR6KCcWbBy4SXeL+SPNCd/t2D8oSl9+GJvoc0/j9c1Z88iZ0fb6I8Chvn3RTb/qwcT7alvZVTjOnRxf4lUk44letigmGygRCyrSERZxjqMVa0b0j1zNYS6QULEbLxSSeIE4AjDcqH43l7bVNCpGoKoOYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 2F41D227AAE; Tue, 27 Jan 2026 07:15:52 +0100 (CET) Date: Tue, 27 Jan 2026 07:15:51 +0100 From: Christoph Hellwig To: Eric Biggers Cc: Christoph Hellwig , Al Viro , Christian Brauner , Jan Kara , David Sterba , Theodore Ts'o , Jaegeuk Kim , Chao Yu , Andrey Albershteyn , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, fsverity@lists.linux.dev Subject: Re: [PATCH 16/16] fsverity: use a hashtable to find the fsverity_info Message-ID: <20260127061551.GA25522@lst.de> References: <20260126045212.1381843-1-hch@lst.de> <20260126045212.1381843-17-hch@lst.de> <20260126204030.GC30838@quark> Precedence: bulk X-Mailing-List: fsverity@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260126204030.GC30838@quark> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Jan 26, 2026 at 12:40:30PM -0800, Eric Biggers wrote: > On Mon, Jan 26, 2026 at 05:51:02AM +0100, Christoph Hellwig wrote: > > The file open path uses rhashtable_lookup_get_insert_fast, > > which can either find an existing object for the hash key or insert a > > new one in a single atomic operation, so that concurrent opens never > > allocate duplicate fsverity_info structure. > > They still do, though. But that's unchanged from before. > ensure_verity_info() frees the one it allocated if it finds that one got > set concurrently. You're right. We allocate them, but never register them. I'll fix that up. > > > Because insertion into the hash table now happens before S_VERITY is set, > > fsverity just becomes a barrier and a flag check and doesn't have to look > > up the fsverity_info at all, so there is only a single lookup per > > ->read_folio or ->readahead invocation. For btrfs there is an additional > > one for each bio completion, while for ext4 and f2fs the fsverity_info > > is stored in the per-I/O context and reused for the completion workqueue. > > btrfs actually still looks up the verity info once per folio. See: > > btrfs_readahead() > -> btrfs_do_readpage() > -> fsverity_get_info() True. I've fixed up btrfs to avoid extra lookups. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1992D25944 for ; Tue, 27 Jan 2026 06:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:In-Reply-To:MIME-Version:References:Message-ID:To:From:Date:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=A3duc7hbOXLpMGDxmQXzYI5OdlGW3ZG9eaGssv/svXQ=; b=Iw1hh7MY036FaYXKameP3I3C09 htBaGJF2HBhqnmpd05lcKY5rYF2/4EYjLfAFWwSLgmoaAIxEGvZ4lPoo5h72Xez1kLxABhsn2U3Cf PRaQyqBaAXDXdxRTUrHGBhEFwmmaxXYPf62EZAj1xfnT/I+eryszyHREYx+h6ChvQoOo=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vkcN1-0007o2-EX; Tue, 27 Jan 2026 06:16:11 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vkcMw-0007ns-FQ for linux-f2fs-devel@lists.sourceforge.net; Tue, 27 Jan 2026 06:16:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NJN1laCjfRD0eNeMidqh3OTLLU/QBKHms3bDZYOjD/E=; b=GCXn7W8qg45R9+9bd9NBRHw9pE ShyrqTt8lHNTDOKoiOu1pQDWyCrYeSXyyCKg41cMPfgrAGgOCASNyizyYa3oM00dcXMyZj0A3akLy arqrCT0SPtSc5dfaOIonbUwX4Trxhm2pg7OTcaYp6Hwv9SvFTlfEjE9BCh+D7oHqK3kk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NJN1laCjfRD0eNeMidqh3OTLLU/QBKHms3bDZYOjD/E=; b=GaVXFPYbMTr9xKGU2sihfLyZn2 1Gjfvk1hlTwhkDShkWaejRGl613RT+ThBh7A0twhnNclIUAmBlh16v/eT2HyFx7xQ0pVT+J+H1NgW a0CGXWX0ludyexdtOgn6Vhr+m5o15HasPZHiCGYOIBwTrmc5/sQ7LLjvuidySJBF1pBM=; Received: from verein.lst.de ([213.95.11.211]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vkcMv-0001hd-Ug for linux-f2fs-devel@lists.sourceforge.net; Tue, 27 Jan 2026 06:16:06 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 2F41D227AAE; Tue, 27 Jan 2026 07:15:52 +0100 (CET) Date: Tue, 27 Jan 2026 07:15:51 +0100 From: Christoph Hellwig To: Eric Biggers Message-ID: <20260127061551.GA25522@lst.de> References: <20260126045212.1381843-1-hch@lst.de> <20260126045212.1381843-17-hch@lst.de> <20260126204030.GC30838@quark> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260126204030.GC30838@quark> User-Agent: Mutt/1.5.17 (2007-11-01) X-Headers-End: 1vkcMv-0001hd-Ug Subject: Re: [f2fs-dev] [PATCH 16/16] fsverity: use a hashtable to find the fsverity_info X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fsverity@lists.linux.dev, Christian Brauner , Theodore Ts'o , Andrey Albershteyn , Matthew Wilcox , linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Al Viro , Jaegeuk Kim , David Sterba , Jan Kara , linux-ext4@vger.kernel.org, Christoph Hellwig , linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Mon, Jan 26, 2026 at 12:40:30PM -0800, Eric Biggers wrote: > On Mon, Jan 26, 2026 at 05:51:02AM +0100, Christoph Hellwig wrote: > > The file open path uses rhashtable_lookup_get_insert_fast, > > which can either find an existing object for the hash key or insert a > > new one in a single atomic operation, so that concurrent opens never > > allocate duplicate fsverity_info structure. > > They still do, though. But that's unchanged from before. > ensure_verity_info() frees the one it allocated if it finds that one got > set concurrently. You're right. We allocate them, but never register them. I'll fix that up. > > > Because insertion into the hash table now happens before S_VERITY is set, > > fsverity just becomes a barrier and a flag check and doesn't have to look > > up the fsverity_info at all, so there is only a single lookup per > > ->read_folio or ->readahead invocation. For btrfs there is an additional > > one for each bio completion, while for ext4 and f2fs the fsverity_info > > is stored in the per-I/O context and reused for the completion workqueue. > > btrfs actually still looks up the verity info once per folio. See: > > btrfs_readahead() > -> btrfs_do_readpage() > -> fsverity_get_info() True. I've fixed up btrfs to avoid extra lookups. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel