New readfile() System Call Under Review For Reading Small~Medium Files Faster

Written by Michael Larabel in Linux Kernel on 4 July 2020 at 08:40 PM EDT. 31 Comments
Back in May we reported on work being done for a readfile() system call to read small files more efficiently. Greg Kroah-Hartman has now volleyed those patches for review on the kernel mailing list for this improvement for reading small to medium file sizes on Linux systems.

The proposed readfile system call allows reading small to medium sized files in one shot without having to issue separate open/read/close system calls. The readfile system call just takes a file descriptor, filename, buffer and its size, and any flags. The file is then straight into the buffer without having to worry about any open/close operations. The intended use-case besides just small~medium files is for those user-space applications often reading from procfs/sysfs that are inherently small.

Besides readfile() being simpler, the other intended use-case is for helping in performance due to less system calls. Greg does note that utilizing readfile should help performance, especially due to "syscall overheads go up over time due to various CPU bugs being addressed." A.k.a. Spectre, Meltdown, etc.

The readfile system call review is in this kernel thread. Hopefully it will be reviewed punctually and well to possibly make it into the Linux 5.9 cycle next month.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of 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 automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week