Linux Work Culminating On A "READFILE" Syscall For Reading Small Files Efficiently
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.