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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5250C19F2A for ; Thu, 11 Aug 2022 22:44:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235762AbiHKWoP (ORCPT ); Thu, 11 Aug 2022 18:44:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbiHKWoN (ORCPT ); Thu, 11 Aug 2022 18:44:13 -0400 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 4E9069C8F8; Thu, 11 Aug 2022 15:44:11 -0700 (PDT) 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=41VaQhN6jBu2TRCoY2HPGKTvHCVOHtR6Uu0laLQNqvY=; b=s1WMml9knuBcXv2L4QTpJfeMZm Q2fGkpv5fvDNKiuf7f+xhuB9isZYfr3rvm8eStkpQ52kASGe5XCJygLUImwE0sSVw2wSLSp3IV0PX B3u4DUtIKE8lbEYFo4HCvUOg2MANjWkwq5aqoBlf1UChWMSEKgVkWmwEGXM6qfv6n5FWeSh/UNP9R 8evvo4f9WmsBaH2NiXUwTkzLUTJteKgbr9Jz/zh7Y20aqZkrn4y8Drg5PKIyvI7QEVHnxUFwJPkkV PgwgGxe/330DJbSBD0qzo6He2OUcLN6QkefaIhlZ7/sQvgd8bj/S12UnQq3MqpgaDwKwhsRe59Yok 10gwlvVA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oMGuO-003Zay-7O; Thu, 11 Aug 2022 22:44:08 +0000 Date: Thu, 11 Aug 2022 23:44:08 +0100 From: Al Viro To: Linus Torvalds Cc: Jeff Layton , Ilya Dryomov , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew Wilcox Subject: Re: [GIT PULL] Ceph updates for 5.20-rc1 Message-ID: References: <20220811152446.281723-1-idryomov@gmail.com> <5d0b0367a5e28ec5b1f3b995c7792ff9a5cbcbd4.camel@kernel.org> <72a93a2c8910c3615bba7c093c66c18b1a6a2696.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org On Thu, Aug 11, 2022 at 03:22:38PM -0700, Linus Torvalds wrote: > On Thu, Aug 11, 2022 at 3:04 PM Al Viro wrote: > > > > FWIW, I wonder if we should do > > if (READ_ONCE(dentry->d_parent) != parent) > > continue; > > before grabbing ->d_lock (and repeat the check after grabbing it, > > It kind of makes sense. We already do that d_name.hash check outside > of the lock, so we already have that "we might race with a rename" > situation. > > That said, I do think __d_lookup_rcu() is the more important of the two. > > Here's a recreation of that patch I mentioned where the OP_COMPARE is > moved out of the loop. Just for fun, look at how much better the code > generation is for the common case when you don't have the call messing > up the clobbered registers etc. > > Entirely untested, and I might have messed something up, but I suspect > this is a much bigger deal than whether d_same_name() is inlined or > not in the non-RCU path. Looks sane at the first pass, but right now I'm really half-asleep - 5 hours of sleep tonight, and about the same yesterday ;-/ I'll try to grab at least an hour or two and reread it once I'm more or less awake...