bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] grep: remove --mmap


From: Paolo Bonzini
Subject: Re: [PATCH v2] grep: remove --mmap
Date: Mon, 22 Mar 2010 18:26:28 +0100

On Mon, Mar 22, 2010 at 18:08, Paul Eggert <address@hidden> wrote:
> Paolo Bonzini <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]