Readfile System Call Patches Revisited For Efficiently Reading Small Files
Talked about for over two years now has been a "readfile" system call to efficiently read small files. This should be a win when dealing with small files like those exposed via sysfs while it's taken time to come together and stalled out several times. This week Greg Kroah-Hartman has updated the readfile patches leading to hope that this new syscall might finally be on a path for mainlining.
The readfile system call is rather simple and intended to simply open the given file, read it into the buffer, and close the file -- all within that single call rather than handling each of those steps separately. The intent is to use the readfile system call if frequently reading "tiny" to "small" files like those exposed under sysfs, procfs, etc.
The single system call approach should be more efficient with less syscall overhead, particularly if frequently reading to many small files.
As of Friday, Greg KH has re-based the readfile syscall patch, self tests, and related documentation on his driver-core.git's "readfile" branch.
As of writing the patches haven't yet worked their way to Greg's driver-core-next branch, but seeing the freshly updated readfile branch gives hope once again this simple system call may finally land after 2+ years of talk.
The readfile system call is rather simple and intended to simply open the given file, read it into the buffer, and close the file -- all within that single call rather than handling each of those steps separately. The intent is to use the readfile system call if frequently reading "tiny" to "small" files like those exposed under sysfs, procfs, etc.
The single system call approach should be more efficient with less syscall overhead, particularly if frequently reading to many small files.
As of Friday, Greg KH has re-based the readfile syscall patch, self tests, and related documentation on his driver-core.git's "readfile" branch.
As of writing the patches haven't yet worked their way to Greg's driver-core-next branch, but seeing the freshly updated readfile branch gives hope once again this simple system call may finally land after 2+ years of talk.
15 Comments