On Mon, Mar 22, 2010 at 18:08, Paul Eggert <[email protected]> wrote:
> Paolo Bonzini <[email protected]> writes:
>
>> mmap is a bad idea for sequentially accessed file because it will cause
>> a page fault for every read page.
>
> That would not be true if grep used posix_madvise with the
> POSIX_MADV_SEQUENTIAL option, right?  Shouldn't this should be tried out
> before removing the use of mmap?

I tried that on git (which switched from mmap to read recently too) a
couple of weeks ago, and it didn't help at all.  The kernel is simply
not fast enough at avoiding page faults so you really get one page
fault for every 4k you read (albeit minor ones).  If it even tries.

Paolo


Reply via email to