Readfile System Call Revised For Efficiently Reading Small Files

With the single "readfile" system call it would open the given file, read it into a buffer, and close the file rather than needing to make multiple system calls for conventional file input handling. Using readfile could be beneficial in cases of frequently reading a lot of small files, such as parsing of data exposed by the kernel via sysfs.
The readfile patches were revised after finding a potential user and updated again in 2021 but ultimately never being sent to mainline by Greg Kroah-Hartman.
Yesterday Greg re-based the readfile syscall patches against the current Linux 6.0-rc2 state and posted them to driver-core's readfile branch. We'll see if this time is the lucky go around and manages to be submitted for the v6.1 merge window for this more efficient reading of small files on Linux by cutting down on system call overhead.
23 Comments