Re: mmap() is slower than read() on SCSI/IDE on 2.0 and 2.1

Stefan Monnier (monnier+lists/linux/kernel/news/@tequila.cs.yale.edu)
15 Dec 1998 13:09:56 -0500


>>>>> "Jamie" == Jamie Lokier <lkd@tantalophile.demon.co.uk> writes:
> Process faults on page 0.
> Kernel reads pages 0..15 into page cache (one cluster).
> Kernel maps page 0 into process.
> Process faults on page 1.
> Kernel maps page 1 into process.
> Process faults on page 2.
> Kernel maps page 2 into process.
> Process faults on page 3.
> Kernel maps page 3 into process.
> Process faults on page 4.
> Kernel maps page 4 into process.
> Process faults on page 5.
> Kernel maps page 5 into process.
> Process faults on page 6.
> Kernel maps page 6 into process.
> Process faults on page 7.
> Kernel maps page 7 into process.
> Process faults on page 8.
> Kernel maps page 8 into process.
> Kernel initiates asynchronous readahead of pages 16..31 (next cluster).

Nice, but *how* ?
Does it just use `map 8 implies prefetch 16-31' ?
If so, what if the application does 1 3 5 7 9 ?
Or what if the application does `1 567 34 90 9486 8' ?
Should the last 8 trigger prefetch of 16-31 ?
Using `read' is like giving an implicit `madvise(SEQUENTIAL)' since it's rarely
used for random (or even stride) access. `mmap' has to be more careful.

Stefan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/