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

Jay Nordwick (nordwick@scam.XCF.Berkeley.EDU)
Tue, 15 Dec 1998 17:07:21 -0800


>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 ?

This is not really a problem, I don't think.
A simple heuristic *could* be: when X pages have been
accessed in the cluster in increasing order (or
even just mostly increaing order, or decreasing order,
etc...)

>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.

If madvise() was used, then mmap() would not have to be more careful. Even
then why can't the same heuristic be used for mmap(). But then we
are talking about kepping a fault history to determine what to guess is
next and I don't think that anybody is against that.

> Stefan

-jay

-
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/