How Linux quietly reads more than you ask for — and why it matters
A developer spent two weeks probing Linux file I/O behavior and found that the kernel does far more than fetch the exact bytes a program requests. When a read starts at byte offset zero, the kernel treats it as a sequential access signal and triggers aggressive readahead, pulling in multiple pages beyond what was asked. The readahead window grows dynamically as sequential reads continue, and memory-mapped file access behaves differently still, fetching up to 32 pages centered on the touched address. The experiment also revealed that the commonly used major-fault counter is blind to ordinary file I/O, making it an unreliable tool for measuring real disk activity. For accurate I/O measurement, per-process read_bytes from /proc or device-level stats from iostat are more reliable indicators.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in