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

next in thread | previous in thread | raw e-mail | index | archive | help
ÞÅÔ×ÅÒ 23 ÂÅÒÅÚÅÎØ 2006 15:48, Matthew Dillon ÷É ÎÁÐÉÓÁÌÉ:
> š š Well, I don't know about FreeBSD, but both grep cases work just fine on
> š š DragonFly.

Yes, they both do work fine, but time gives very different stats for each. In 
my experiments, the total CPU time is noticably less with mmap, but the 
elapsed time is (much) greater. Here are results from FreeBSD-6.1/amd64 -- 
notice the large number of page faults, because the system does not try to 
preload file in the mmap case as it does in the read case:

	time fgrep meowmeowmeow /home/oh.0.dump
	2.167u 7.739s 1:25.21 11.6%     70+3701k 23663+0io 6pf+0w
	time fgrep --mmap  meowmeowmeow /home/oh.0.dump
	1.552u 7.109s 2:46.03 5.2%      18+1031k 156+0io 106327pf+0w

Use a big enough file to bust the memory caching (oh.0.dump above is 2.9Gb), 
I'm sure, you will have no problems reproducing this result.

> š š I can't test mzip.c because I don't see the compression 
> š š library you are calling (maybe that's a FreeBSD thing).

The program uses -lz and -lbz2 -- both are parts of FreeBSD since before the 
unfortunate fork of DF. The following should work for you:

	make -f bsd.prog.mk LDADD="-lz -lbz2" PROG=mzip mzip

Yours,

	-mi



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