Re: [PATCH] fs: improve codegen in link_path_walk()
From: Christian Brauner
Date: Mon Apr 14 2025 - 06:12:13 EST
On Sat, 12 Apr 2025 13:09:35 +0200, Mateusz Guzik wrote:
> Looking at the asm produced by gcc 13.3 for x86-64:
> 1. may_lookup() usage was not optimized for succeeding, despite the
> routine being inlined and rightfully starting with likely(!err)
> 2. the compiler assumed the path will have an indefinite amount of
> slashes to skip, after which the result will be an empty name
>
> As such:
> 1. predict may_lookup() succeeding
> 2. check for one slash, no explicit predicts. do roll forward with
> skipping more slashes while predicting there is only one
> 3. predict the path to find was not a mere slash
>
> [...]
Applied to the vfs-6.16.misc branch of the vfs/vfs.git tree.
Patches in the vfs-6.16.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.16.misc
[1/1] fs: improve codegen in link_path_walk()
https://git.kernel.org/vfs/vfs/c/80cf41f567f5