The File Struct Is Smaller In Linux 6.12 - May Help File Heavy Workloads

Written by Michael Larabel in Linux Kernel on 16 September 2024 at 06:30 AM EDT. 15 Comments
LINUX KERNEL
The file structure is one of the most widely-used data structures by Linux kernel drivers. The file struct represents an open file and thus obviously very important and ubiquitous throughout the kernel. With the Linux 6.12 kernel the file struct has been adjusted so it's smaller than before and in turn could help with performance for file-heavy workloads.

Christian Brauner submitted the VFS file improvements for the Linux 6.12 merge window which were already merged to Linux Git this morning by Linus Torvalds in Vienna. Brauner explains in the pull request:
"This is the work to cleanup and shrink struct file significantly. You should've already seen most of the work in here.

Right now, ([focusing] on x86) struct file is 232 bytes. After this series struct file will be 184 bytes aka 3 cacheline and a spare 8 bytes for future extensions at the end of the struct.

With struct file being as ubiquitous as it is this should make a difference for file heavy workloads and allow further optimizations in the future."

file struct


That code has been merged. No benchmark performance numbers were noted on the merge request or in the actual patches of any quantified benefit to file-heavy workloads, but it will be interesting to see if the struct file savings do end up materializing with Linux 6.12.
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