Along with other VFS pull requests for Linux 6.14 to introduce STATX_DIO_READ_ALIGN, adding a new mountinfo program, VirtualBox guest support for ARM64 VMs, and faster /proc/kcore reading, another VFS pull for this new kernel brings a minor performance optimization.
As part of the “VFS misc” pull request that’s been merged for Linux 6.14, there is now support for caching symlink lengths within inodes. Mateusz Guzik who authored this optimization explained in the patch:
“When utilized it dodges strlen() in vfs_readlink(), giving about 1.5% speed up when issuing readlink on /initrd.img on ext4.
Filesystems opt in by calling inode_set_cached_link() when creating an inode.
The size is stored in what used to be a 4-byte hole. If necessary the field can be made smaller and converted into a union with something not used with symlinks.”
Christian Brauner with the VFS misc pull request reiterated the 1.5% speed-up when issuing readlink on /initrd.img atop an EXT4 file-system thanks to this symlink length caching within inodes. This optimization is merged as part of the VFS misc changes for Linux 6.14.