Linux 7.4 is on track to deliver a surprisingly large performance boost for a fundamental operation: opening files. After more than two years of refinement, a lean patch led by open-source developer Mateusz Guzik is set to eliminate unnecessary work inside the kernel’s Virtual Filesystem Switch (VFS), delivering roughly a 39% increase in file-open throughput in benchmarked workloads.
The optimization targets the do_open() VFS function, which plays a central role when applications open files by pathname. In the current implementation, the kernel ends up handling directory entry (“dentry”) references redundantly during the path-walking process — specifically, it grabs a reference on the terminal dentry in __legitimize_path(), then acquires another in do_dentry_open(), only to drop the initial one later in terminate_walk().
Guzik’s patch — just a few dozen lines of code — removes this duplication by letting do_dentry_open() consume the reference that’s already been held, avoiding two unnecessary reference-count modifications. As the developer explained in the patch notes, which underwent five revisions over the past two years: “Opening a file grabs a reference on the terminal dentry in __legitimize_path(), then another one in do_dentry_open() and finally drops the initial reference in terminate_walk(). That’s 2 modifications which don’t need to be there — do_dentry_open() can consume the already held reference instead.”
Though conceptually simple, the change yields a substantial real-world benefit. Benchmarks run on a 20-core virtual machine using the “will-it-scale” suite — which repeatedly opens the same file in read-only mode — measured a 39% increase in operations per second with the patch applied.
The patch has now reached a formal milestone: it’s queued in the vfs-7.4.lookup Git branch within the VFS.git repository. Being labeled explicitly as “7.4” material signals that it’s slated for submission during the upcoming Linux 7.4 merge window, where it will undergo final review by kernel maintainers before (if accepted) becoming part of the next stable release.
For system administrators and developers working with workloads that open large numbers of files — from web servers and databases to build systems and container runtimes — the optimization could translate into tangible latency and throughput improvements without requiring any application-level changes. The simplicity of the fix also bodes well for its stability and chances of landing in the mainline kernel.
As the Linux 7.4 merge window approaches, the community will be watching to see whether this lean but impactful patch makes the cut — and whether real-world deployments confirm the 39% benchmark gains in production environments.
Source: phoronix
Buy me a Ko-fiSupport this blog ❤️





