Linux Work Culminating On A "READFILE" Syscall For Reading Small Files Efficiently
Written by Michael Larabel in Linux Storage on 24 May 2020 at 06:00 PM EDT. 33 Comments
LINUX STORAGE --
Stemming from recent kernel discussions over a hypothetical new system call for reading small files more efficiently, Greg Kroah-Hartman has been working on the readfile() system call and it's looking like it is taking shape well enough to premiere soon in a new mainline kernel release.

Today Greg created the driver-core/readfile Git branch with his few patches implementing this new system call. This "tiny" system call is intended for quickly reading small files, such as the often single/few word files exposed on sysfs, procfs, etc. With this single system call it will open the file, read it into a buffer, and close the file.

Yes, it's taken until 2020 for such a simple system call focused on reading small files and to do so very efficiently compared to first having to make a call to open the file, and then read it with a second call, etc. This READFILE system call thus has less overhead particularly for those that may be frequently reading many small files.

There is this test file showing the sample usage of this syscall.

The READFILE call isn't yet in driver-core-next, but we'll see if it manages to land in there in time for the Linux 5.8 kernel with its merge window opening soon or if it will be left open for discussion and volleyed into a later kernel release.
Related News
About The Author
Author picture

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 or contacted via MichaelLarabel.com.

Popular News This Week