Re: [PATCH 13/14] d_path: prepend_path() is unlikely to return non-zero

From
Al Viro <viro@zeniv.linux.org.uk>
Date
2021-06-28 04:15:20
Also in
linux-fsdevel, linux-s390, lkml
Reply to
Justin He, 2021-06-28
On Mon, Jun 28, 2021 at 03:28:19AM +0000, Justin He wrote:
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_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...
Thread (72 messages) 72 messages, 8 authors, last reply 2021-07-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help