Among other Linux Virtual File-System (VFS) changes submitted and already merged for Linux 6.15 was a set of minor performance optimizations around VFS file operations.
Among the more exciting Linux 6.15 pull requests sent in by Linux kernel engineer Christian Brauner at Microsoft was the support for block sizes greater than page sizes. Meanwhile the “VFS file” pull request is worth mentioning just for some very minor performance benefits… Of course, we like any and all kernel performance optimizations.
Christian Brauner summed up the VFS file optimization work by kernel developer Mateusz Guzik as:
“This contains performance improvements for struct file’s new refcount mechanism and various other performance work:
– The stock kernel transitioning the file to no refs held penalizes the caller with an extra atomic to block any increments. For cases where the file is highly likely to be going away this is easily avoidable.
Add file_ref_put_close() to better handle the common case where closing a file descriptor also operates on the last reference and build fput_close_sync() and fput_close() on top of it. This brings about 1% performance improvement by eliding one atomic in the common case.
– Predict no error in close() since the vast majority of the time system call returns 0.
– Reduce the work done in fdget_pos() by predicting that the file was found and by explicitly comparing the reference count to one and ignoring the dead zone.”
See this pull request for all the details on those changes now upstreamed in Linux 6.15 Git.