Abstract:This paper proposes and implements a demand prefetching algorithm, which uses relaxed sequentiality criteria as well as page and page cache states as reliable sources of information. It can discover and prefetch sequential streams mixed in random accesses. It can also support the interleaved access patterns created by concurrent sequential reads on one file descriptor. Experimental results show that it performs much better than legacy Linux readahead: sequential reading intermixed with random ones are faster by 29%; I/O throughput of interleaved streams could be 4~27 times better, with application visible I/O latencies improved by up to 35 times. This demand prefetching algorithm has been adopted by Linux kernel 2.6.24.