Re: mmap() versus read()

Hans Reiser (reiser@ricochet.net)
Sun, 08 Mar 1998 13:39:22 -0800


I disagree. If you page fault more than once, so as to establish a
pattern of sequentiality, you are already losing compared to madvise().
Don't think of just the large and the small files, remember the medium
sized ones. The cost of the first seek is so high, and the cost of
reading additional blocks is so low, that for files that are not an
order of magnitude larger than what you would read-ahead without an
advisory, the advisory is informative. This is not to say that I think
implementing an madvise() is a priority, merely that I think it should
not be dismissed so casually from the list of things to do given
infinite programmers to do them.

Hans

Chris Evans wrote:
>
> On Sun, 8 Mar 1998, Erik Corry wrote:
>
> > Take a look at madvise for Solaris. You can say for a
> > mmaped area that you are going to read sequentially (do
> > lots of readahead), read randomly (do no readahead at all),
> > that you are going to need an area soon, or that you are
> > (probably) not going to need the area at all any more.
>
> I see no reason for an madvise() -- the kernel should be able to monitor
> faults and if they are sequential, decided for _itself_ that lots of
> readahead is a good idea. Calling madvise() is still incurring the
> overhead of a system call too.
>
> Chris
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu