Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp330599lqp; Tue, 11 Jun 2024 06:06:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2ZlAl2soT45vsngnAwAFRYsKDhLONehf28KMsl1JBxp894BAjpQPJ5Gul5ixbmWVLO6wPeAHf4gGyD0DQMsefnsfZJs0V5QymgIfV7A== X-Google-Smtp-Source: AGHT+IEHtWhwIdbFZGXj0qmxHa78zTJwq7JwNnFkOelphgRx43sGCJiixFe05vr9CpgnwiqsItd2 X-Received: by 2002:a05:6870:8a21:b0:254:bac9:4ad with SMTP id 586e51a60fabf-254ecf3a74fmr1210243fac.22.1718111185601; Tue, 11 Jun 2024 06:06:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718111185; cv=pass; d=google.com; s=arc-20160816; b=whq0MkMDTrqht1keHJF915W942CRGRlkX8/3XD/UcRHqVwRJRyf4hX6TqLyH+iMKIr B9IzYTUh+wf/9AD8VcwskuvcqfK4iPelGi3hMDyYrOJ6TmJh5EDKfisaIjhLIio6VGvK VNEqpAzzPc5lgNJ+MkuLaK30aZ35RLojESgxTZwRRR5FLFJXiJsSW+sHubnBf+7pA48E TFTWIXHKSEkH1J0yZPVWv0VULJR6uilgMB6s14kfzuIyC0S25+Q4cQZup4u/tojdrQ7S RNMHh+2xcBN6h8iz0jlxq9pC6cc4tK5VN38G+S++yOiGVynFy71c4kqIm0jLlsJoCDQ6 5/PA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3+fkyY7Pu/Tf+D9NsFqaYwdUVnv7+SGz2Uajx2Qo2VI=; fh=YMKZkgah60Fuq764lgvp5AaPPPjmAoV6CaFnId2yoLc=; b=sI4LtlvmOrlwCURHDO7PQIC+3yWnXd07W9Ehst2DyprAUAaWIbT5nPLlo5TLZecmiw SFL3HFXzqviTCF5vlRDNrxH138tsviaFN/vY+2biQCMhcLdETFpt4B1z+/M3IF1ZRYs5 omcCD7MYqTgxt4Ztn4hMj5UYCJZDYznAUv232MBFW+07NSoeTX74al36jgUI8HNClLcS rjM1dA5bJKMgsqgPAeI3dceBE/oRZLtDS4qSoIpuTXlRIDQnWMYCuR8d0OSZvOAl5fE4 NIqZ29yi0MVioRFSxJSakdXHt0WB7/DvVqTZvgjAy+0GfRKyr5tyCosSih0nVCqvczH5 VFpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OsdymXZt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209900-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209900-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 586e51a60fabf-254747134ffsi3212197fac.41.2024.06.11.06.06.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 06:06:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209900-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OsdymXZt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209900-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209900-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2337D286428 for ; Tue, 11 Jun 2024 13:05:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E41CF17C9EE; Tue, 11 Jun 2024 13:04:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OsdymXZt" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 103FA1E49E; Tue, 11 Jun 2024 13:04:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718111098; cv=none; b=YjraRxFMcgggJj86r5nFKqMfhEtx8h9dd9uAhNEZ1CqpPNgFiep5TGJowrDLIgy2DEpgDTbGXIHYzWcVoHvuNNxpmX35zUehngEFA4FJaJLhL538FVlfibCIhe8DFoYVO77AGakCBrokdBGRjMOaivFOSpHeV+5kkcmahUDJioU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718111098; c=relaxed/simple; bh=76BCTRyqFXDeGfhknZZgHm1a0wKEQG9KA+oh14PJzi8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PsHu/dOUrlGw8DCEEwAhscdOL0SxME/4Szy083nCkCAfOUthBZ40A/4uy/41UW6bDkLaY+9wfTIuyvl1JJ+hgBv6oC0KukrQrYqWlnJrdwrPRy+z4yarBuhtxzAipQQif9YqDcyKZhwlK0aCu1VYnWT3Qv8+zpBclnNRU2ZT19g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OsdymXZt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF9F6C2BD10; Tue, 11 Jun 2024 13:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718111097; bh=76BCTRyqFXDeGfhknZZgHm1a0wKEQG9KA+oh14PJzi8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OsdymXZt/rgPWQil0J70ydCqqc4BUfDkyOiH0PZO8IBJze8JxeV9kBZMlKOs1z7JL gZrMB5AM6bzTjfKkaUUy2DL1nlRuHS1TmLjqs/V5V6dRTlqdxgseupMMUHdBEMWKa1 4q8JmBsIYBO7J2T3n610ZSFCuaNM37uoZc1fUUcA6zrnZMdZknEocA6yYyWPIwkfMt WsXrbIoqcgOO6kd/dUM1purmaWM4nxG1IWwUh4fEnlBAHeZPOJdWz8lmGigRdfh4gz JUCU7QEWW4npBt351PbZdHDM1/gKliz+apBN0b8M2NlcYLQ0vWOCU0J9yBotEenCNz cv1YTZxs7dF5A== Date: Tue, 11 Jun 2024 15:04:52 +0200 From: Christian Brauner To: Mateusz Guzik Cc: Jan Kara , viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, josef@toxicpanda.com, hch@infradead.org Subject: Re: [PATCH v3 1/2] vfs: add rcu-based find_inode variants for iget ops Message-ID: <20240611-zwirn-zielbereich-9457b18177de@brauner> References: <20240611101633.507101-1-mjguzik@gmail.com> <20240611101633.507101-2-mjguzik@gmail.com> <20240611105011.ofuqtmtdjddskbrt@quack3> <2aoxtcshqzrrqfvjs2xger5omq2fjkfifhkdjzvscrtybisca7@eoisrrcki2vw> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2aoxtcshqzrrqfvjs2xger5omq2fjkfifhkdjzvscrtybisca7@eoisrrcki2vw> On Tue, Jun 11, 2024 at 01:40:37PM +0200, Mateusz Guzik wrote: > On Tue, Jun 11, 2024 at 12:50:11PM +0200, Jan Kara wrote: > > On Tue 11-06-24 12:16:31, Mateusz Guzik wrote: > > > +/** > > > + * ilookup5 - search for an inode in the inode cache > > ^^^ ilookup5_rcu > > > > fixed in my branch > > > > + * @sb: super block of file system to search > > > + * @hashval: hash value (usually inode number) to search for > > > + * @test: callback used for comparisons between inodes > > > + * @data: opaque data pointer to pass to @test > > > + * > > > + * This is equivalent to ilookup5, except the @test callback must > > > + * tolerate the inode not being stable, including being mid-teardown. > > > + */ > > ... > > > +struct inode *ilookup5_nowait_rcu(struct super_block *sb, unsigned long hashval, > > > + int (*test)(struct inode *, void *), void *data); > > > > I'd prefer wrapping the above so that it fits into 80 columns. > > > > the last comma is precisely at 80, but i can wrap it if you insist > > > Otherwise feel free to add: > > > > Reviewed-by: Jan Kara > > > > thanks > > I'm going to wait for more feedback, tweak the commit message to stress > that this goes from 2 hash lock acquires to 1, maybe fix some typos and > submit a v4. > > past that if people want something faster they are welcome to implement > or carry it over the finish line themselves. I'm generally fine with this but I would think that we shouldn't add all these helpers without any users. I'm not trying to make this a chicken and egg problem though. Let's get the blessing from Josef to convert btrfs to that *_rcu variant and then we can add that helper. Additional helpers can follow as needed? @Jan, thoughts?