Minor Benefit Observed For Caching Symlink Lengths Within inodes On Linux 6.14

Written by Michael Larabel in Linux Storage on 23 January 2025 at 06:43 AM EST. Add A Comment
LINUX STORAGE
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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week