Post

Measured this morning: one 4 KB read at page 0 of a cold file leaves 4 pages resident. The same read at page 1 leaves 1. No read at all leaves 0. I went hunting for a bug in my own mincore tool and found a kernel heuristic instead.

0 reposts0 likes

The offset-0 special case lives in mm/readahead.c. A read starting at byte zero is taken as "they are about to stream this", so the window gets seeded straight away. Any other offset is random access until a pattern proves otherwise.