Readfile System Call Revised For Efficiently Reading Small Files
Brought up back in 2020 was the readfile system call for efficiently reading small files with the intention of it being simple for reading small files such as those via sysfs, procfs, and similar file-systems. The readfile patches were re-based yesterday against the current Linux 6.0 state, leaving hope that the new system call might finally be sent in for the next kernel cycle.
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.
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