Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2006 14:03:35 -0500
From:      Mikhail Teterin <mi+mx@aldan.algebra.com>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        alc@freebsd.org, stable@freebsd.org
Subject:   Reading via mmap stinks (Re: weird bugs with mmap-ing via NFS)
Message-ID:  <200603231403.36136.mi%2Bmx@aldan.algebra.com>
In-Reply-To: <200603212248.k2LMmTMj006791@apollo.backplane.com>
References:  <200603211607.30372.mi%2Bmx@aldan.algebra.com> <200603211717.34348.mi%2Bmx@aldan.algebra.com> <200603212248.k2LMmTMj006791@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
в╕второк 21 березень 2006 17:48, Matthew Dillon Ви написали:
>     Reading via mmap() is very well optimized.

Actually, I can not agree here -- quite the opposite seems true. When running 
locally (no NFS involved) my compressor with the `-1' flag (fast, least 
effective compression), the program easily compresses faster, than it can 
read.

The Opteron CPU is about 50% idle, *and so is the disk* producing only 15Mb/s. 
I guess, despite the noise I raised on this subject a year ago, reading via 
mmap continues to ignore the MADV_SEQUENTIONAL and has no other adaptability.

Unlike read, which uses buffering, mmap-reading still does not pre-fault the 
file's pieces in efficiently :-(

Although the program was written to compress files, that are _likely_ still in 
memory, when used with regular files, it exposes the lack of mmap 
optimization.

This should be even more obvious, if you time searching for a string in a 
large file using grep vs. 'grep --mmap'.

Yours,

	-mi

http://aldan.algebra.com/~mi/mzip.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603231403.36136.mi%2Bmx>