Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3168354pxv; Sun, 27 Jun 2021 21:16:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4X1e0LInwLkEBUAiYRWtGNylT3RtsKOU4UN58shKs1alOZiViY7lHtrS+O/llG3o77viK X-Received: by 2002:a05:6638:501:: with SMTP id i1mr7667180jar.126.1624853810454; Sun, 27 Jun 2021 21:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624853810; cv=none; d=google.com; s=arc-20160816; b=bN2Ge+5kHutUPw5TW25RLazppMwVXUz5Mrs+YyKxcDsl9zWUlM5JVZQ5lDaf2SlVOJ Zr5pt4KFs7LBcObuCMwGSRkt2aSYKPLwYUNaujfgJxD3m//PyQRSxmlsPSRBXEN4m9tg SlGNRUQnyOmgpbsstQ/uiNS+L25ErjL8CpZH5N9mAJNYWFUFg92ZXVuIjxG99WiA3luo 5vo/XZmt/FN/WTqYrk0u15IXdMlIO88J86q1kPzW+WIzFBAaAkVKXumUwRkRoW6R1vCl ukZWse/VhTG4GXOdomuw4QbU5vEHvOj85UZoKf1XdSmD+Vh9O/RqjFmL73c8/i2ev8Jx BfgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pBdjn/GKfJFxzEqtokI2u2fNZpVadd5xC93Vxq2rru4=; b=uel4lDtOq+zNTLOKHabSx2OPqriiav8A8PrZaQsVPi3PBgJLawzysroUm+ygNp853l oe5WStsmZHbSpvsAqUZL6nrnmpRwaderk70v/59goEVErIHT4iCsVwI2FusvqSUXu9HE xKzmHc0Da9wZKKVd3Yy/oo7P7LbGSH/87fB/3bY6+wEeagQTvc5/K7lvMiFlRVCoBusQ AhbHTd5XcXwctQ88SbgOdgSgTDbBhJ3nz9SMzjs72eZTMXTDvFaqZk9JCYWRkiSwhl7S DHO4/00Bg9VOK1tDVW1YHAgiCvFmf3h8TCDLPp3wTQZFkef6mMr0kpvIIJQvFQRmlsI7 vZrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si16407152iov.7.2021.06.27.21.16.38; Sun, 27 Jun 2021 21:16:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229910AbhF1ERo (ORCPT + 99 others); Mon, 28 Jun 2021 00:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbhF1ERn (ORCPT ); Mon, 28 Jun 2021 00:17:43 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AEA9C061574; Sun, 27 Jun 2021 21:15:17 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxiep-00D82O-5c; Mon, 28 Jun 2021 04:14:03 +0000 Date: Mon, 28 Jun 2021 04:14:03 +0000 From: Al Viro To: Justin He Cc: Linus Torvalds , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Jonathan Corbet , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "Eric W . Biederman" , "Darrick J. Wong" , "Peter Zijlstra (Intel)" , Ira Weiny , Eric Biggers , "Ahmed S. Darwish" , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-s390 , linux-fsdevel Subject: Re: [PATCH 13/14] d_path: prepend_path() is unlikely to return non-zero Message-ID: References: <20210519004901.3829541-1-viro@zeniv.linux.org.uk> <20210519004901.3829541-13-viro@zeniv.linux.org.uk> 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: linux-kernel@vger.kernel.org On Mon, Jun 28, 2021 at 03:28:19AM +0000, Justin He wrote: > > On which loads? 1 here is "mount/dentry pair is in somebody > > else's namespace or outside of the subtree we are chrooted > > into". IOW, what's calling d_path() on your setup? > > No special loads, merely collecting the results after kernel boots up. > > To narrow down, I tested your branch [1] *without* my '%pD' series: > [1] https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/log/?h=work.d_path > > The result is the same after kernel boots up. IOW, you get 1 in call from d_absolute_path(). And the same commit has - if (prepend_path(path, &root, &b) > 1) + if (unlikely(prepend_path(path, &root, &b) > 1)) there. What's the problem? If you want to check mispredictions, put printks at the statements under those if (unlikely(...)) and see how often do they trigger...