Dev

Linux 7.4 Speeds Read-Only File Opens by 39%

A VFS do_open rework proposed for Linux 7.4 cuts duplicate references to boost read-only opens by 39% in testing.

7 min read Reviewed & edited by the SINGULISM Editorial Team

Linux 7.4 Speeds Read-Only File Opens by 39%
Photo by Ilija Boshkov on Unsplash

A rework proposed for Linux 7.4, the next version of the Linux kernel, speeds up file opening for read access. It eliminates redundant work in do_open handling in the virtual filesystem layer. Reporting by Michael Larabel at Phoronix says operations per second rose 39% in a read-only open test on the same file. Despite being a change on the scale of about three dozen lines, the effect is significant. It has now been picked up into an official VFS subsystem branch. It is expected to be included in a stable release by the end of 2026.

Changes to Open Handling That Remove

Duplicate References

The rework aims to make file opening with pathname lookup more efficient. At its center is the do_open function in the VFS layer. This function handles part of the lookup that maps path components to inodes. Developer Mateusz Guzik has led the improvements for more than two years. In the current implementation, reference acquisition on the terminal directory entry was duplicated. A directory entry, called a dentry, is the structure that holds the mapping between a path and an inode.

Before the fix, the flow takes a reference on the terminal dentry in __legitimize_path(). The subsequent do_dentry_open() takes another reference. Finally, terminate_walk() drops the initial reference. This round-trip of acquisition and release was an operation with no substantive meaning. In the revised version, do_dentry_open() consumes the reference already held. The design eliminates two extra reference-count operations.

Guzik illustrated the duplication in his description of the fix.

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.

Reference counting is prone to contention in concurrent environments. Reducing count updates leads to fewer lock acquisitions and relaxed barriers. While the instruction count is small, its impact on wait time under parallelism cannot be ignored. Although it looks like a simple cleanup, it can be seen as directly reducing load in the core path.

Test Results in a 20-Core Virtual Environment

Performance was verified with the will-it-scale open test. The condition was opening the same file read-only on a 20-core virtual machine. As a result, operations per second increased by 39%. This is a figure from a microbenchmark that repeatedly executes opens in succession. It does not mean that overall real-world processing becomes 39% faster. Still, the difference could show up in workloads where the open path contributes heavily.

Repeated read-only opens occur frequently in script execution and configuration management. On container platforms, large numbers of shared resources are opened at startup. Language runtimes also repeat many lookups and opens at startup. Logging and search infrastructure also make heavy use of opens on the read side. In such uses, shortening the in-kernel path could have a cumulative effect. The relief of reference-count contention is especially effective on machines with many cores.

What is surprising about this result is the simplicity of the remedy. It involves no advanced algorithm or data-structure change. It only reorganizes how the reference is passed. Even so, an improvement of nearly 40% was confirmed. It is a case that shows residual processing that had been overlooked for years. Whether the microbenchmark optimization will reproduce in real use is an area that needs further verification.

Implementation Status Toward Integration via VFS

This optimization did not come together overnight. It went through more than two years of検討 discussion and five revisions. Safety under concurrency and handling of reference lifetimes were apparently points of debate. Guaranteeing the lifetime of the terminal entry and consistency with end-of-walk handling are important. With a scheme that consumes the reference, mistaken frees and double frees must be avoided. Clarification of reference ownership, including error paths, is required.

The fix is said to be on the scale of about three dozen lines. With a limited scope of change, it falls into a category that is easier to review and test. It is now placed in the vfs-7.4.lookup branch of VFS.git. Its position as material for 7.4 has become clear. Submission to the mainline during a future merge window is expected. If progress is smooth, it is on track to reach a stable release by the end of 2026.

In Linux development, stable releases are set after selection and testing in merge windows. For performance fixes, unlike feature additions, the absence of regressions is emphasized. In addition to microbenchmarks, stability confirmation under real loads is essential. Inclusion in the branch should reasonably be seen as a sign that it has entered that process. Users will also need to watch distributors’ backport policies.

Stable Supply and Ripple Effects on Operations

Faster read opens could affect the responsiveness of the entire stack. That is because it relates to user-process startup time and script-processing latency. In high-density container setups, contention in open handling tends to become visible. In read-centric workloads, the cumulative effect may become measurable. On the other hand, in uses dominated by writes and transfers, the contribution will be limited. In many cases, the speed of the storage device itself sets the ceiling.

Improved base performance underpins the experience at the application layer. This site covered the move toward on-device intelligence in Apple Intelligence Gets Underway, Siri AI Revamp Coming in iOS 27. Expansion of application features depends heavily on I/O efficiency behind the scenes. Stable read handling is also important in operating posting infrastructure, as shown by X Revamps Revenue Sharing as Original Content Rewards, Launching Sept. 8. The same applies to operations-management infrastructure such as in Rippling Announces AI Spend Tracking Tool AI Spend Console. It is natural to see cutting residual processing in the kernel core as contributing to greater reliability in these layers.

Operators should track the 7.4 merge status and distributors’ support matrices. The 39% microbenchmark figure should not be factored directly into capacity planning. It is necessary to understand open frequency and core counts in your own workloads. For systems with many read opens, it is worth checking changes in latency distribution after the update. For systems where the effect is limited, prioritizing other bottlenecks is the reasonable call.

Editorial Opinion

Looking at the short-term impact, the focus in the next three to six months will be on adoption during the 7.4 merge window. If adopted, regression checks will proceed through testing releases from each distributor. On read-intensive infrastructure, remeasurement in test environments will likely pick up. Immediate effects large enough to change capacity-planning assumptions will be limited.

From a long-term perspective, review of residual processing in the VFS layer will likely spread. Reference-passing cleanups like this one could be applied to other system calls. As container density increases, the cumulative value of microscopic fixes will grow. Reducing contention inside the kernel will also spill over into better power efficiency.

Questions from the editors follow. The 39% figure is a result under specific conditions, and is its reproducibility under real loads not yet unverified? Is safety preserved for write opens and special filesystems as well? As for why it remained for two years, were there no issues with test coverage or ownership conventions? Sharing of real measurements by users will inform future judgments.

References

Frequently Asked Questions

Why was a speedup as large as 39% achieved?
Because it eliminated duplicate reference acquisition and release on the terminal dentry. Reference-count updates cause contention in multi-core environments. In a read-only open test on a 20-core virtual machine, the effect of that reduction showed up in operations per second. It is the result of reorganizing ownership, not of changing algorithms.
When will it become available?
It has been included in the vfs-7.4.lookup branch of VFS.git and is treated as material for 7.4. Submission to the mainline in a future merge window is expected. If progress is smooth, it is expected to be included in a stable release by the end of 2026. For distributor timelines, check announcements from each provider.
What kinds of workloads benefit most?
Workloads that repeatedly open the same resources read-only benefit most. These include resource lookup at startup, script processing, and high-density container setups. In uses dominated by transfers or writes, the contribution is limited. It is advisable to measure your own open frequency before judging the benefit of the update.
Source: Phoronix

Comments

← Back to Home