Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jun 2004 18:52:08 -0400
From:      Mikhail Teterin <mi+kde@aldan.algebra.com>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        current@freebsd.org
Subject:   Re: read vs. mmap (or io vs. page faults)
Message-ID:  <200406201852.08030@aldan>
In-Reply-To: <200406201835.i5KIZBeJ026532@apollo.backplane.com>
References:  <200406200343.03920@aldan> <200406201835.i5KIZBeJ026532@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 20 June 2004 02:35 pm, you wrote:
=
= :I this how things are supposed to be, or will mmap() become more
= :efficient eventually? Thanks!
= :
= :	-mi

=     It's hard to say.  mmap() could certainly be made more efficient, e.g.
=     by faulting in more pages at a time to reduce the actual fault rate.
=     But it's fairly difficult to beat a read copy into a small buffer.

Well, that's the thing -- by mmap-ing the whole file at once (and by
madvise-ing with MADV_SEQUENTIONAL), I thought, I told, the kernel
everything it needed to know to make the best decision. Why can't
page-faulting code do a better job using all this knowledge, than the
poor read, which only knows about the partial read in question?

I find it so disappointing, that it can, probably, be considered a bug.
I'll try this code on Linux and Solaris. If mmap is better there (as it
really ought to be), we have a problem, IMHO. Thanks!

	-mi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406201852.08030>