RE: [PATCH 13/14] d_path: prepend_path() is unlikely to return non-zero
From: Justin He <hidden>
Date: 2021-06-28 04:36:49
Also in:
linux-fsdevel, linux-s390, lkml
Hi Al
-----Original Message----- From: Al Viro <redacted> On Behalf Of Al Viro Sent: Monday, June 28, 2021 12:14 PM To: Justin He <redacted> Cc: Linus Torvalds <torvalds@linux-foundation.org>; Petr Mladek [off-list ref]; Steven Rostedt [off-list ref]; Sergey Senozhatsky [off-list ref]; Andy Shevchenko [off-list ref]; Rasmus Villemoes [off-list ref]; Jonathan Corbet [off-list ref]; Heiko Carstens [off-list ref]; Vasily Gorbik [off-list ref]; Christian Borntraeger [off-list ref]; Eric W . Biederman [off-list ref]; Darrick J. Wong [off-list ref]; Peter Zijlstra (Intel) [off-list ref]; Ira Weiny [off-list ref]; Eric Biggers [off-list ref]; Ahmed S. Darwish [off-list ref]; open list:DOCUMENTATION <linux- doc@vger.kernel.org>; Linux Kernel Mailing List <linux- kernel@vger.kernel.org>; linux-s390 [off-list ref]; linux- fsdevel [off-list ref] Subject: Re: [PATCH 13/14] d_path: prepend_path() is unlikely to return non-zero On Mon, Jun 28, 2021 at 03:28:19AM +0000, Justin He wrote:quoted
quoted
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_ pathquoted
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?
Ah, sorry for the mistake. -- Cheers, Justin (Jia He)
If you want to check mispredictions, put printks at the statements under those if (unlikely(...)) and see how often do they trigger...
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.