How Linux readahead works, and the two ways to change it
Most of the time, when we read a file, we do not think much about what happens underneath. You ask for some bytes, you get some bytes. But when getting data off the disk efficiently is at the core of what your application does, what happens underneath starts to matter a great deal, and two identical read() calls can differ enormously in what they cost. So in this post we are going to look at one of the Linux kernel’s optimizations for reading files: readahead.