From owner-freebsd-stable@FreeBSD.ORG Thu Mar 23 21:26:40 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 98F7316A424; Thu, 23 Mar 2006 21:26:40 +0000 (UTC) (envelope-from mi+mx@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id C73FB43D46; Thu, 23 Mar 2006 21:26:39 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by aldan.algebra.com (8.13.6/8.13.4) with ESMTP id k2NLQXO3036861 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 23 Mar 2006 16:26:38 -0500 (EST) (envelope-from mi+mx@aldan.algebra.com) Received: from mteterin.us.murex.com (195-11.customer.cloud9.net [168.100.195.11]) by corbulon.video-collage.com (8.13.6/8.13.6) with ESMTP id k2NLQQlL010772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Mar 2006 16:26:27 -0500 (EST) (envelope-from mi+mx@aldan.algebra.com) Received: from mteterin.us.murex.com (mteterin@localhost [127.0.0.1]) by mteterin.us.murex.com (8.13.4/8.13.4) with ESMTP id k2NLQLSC040192; Thu, 23 Mar 2006 16:26:21 -0500 (EST) (envelope-from mi+mx@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by mteterin.us.murex.com (8.13.4/8.13.4/Submit) id k2NLQJBw040191; Thu, 23 Mar 2006 16:26:19 -0500 (EST) (envelope-from mi+mx@aldan.algebra.com) X-Authentication-Warning: mteterin.us.murex.com: mteterin set sender to mi+mx@aldan.algebra.com using -f From: Mikhail Teterin Organization: Virtual Estates, Inc. To: Matthew Dillon Date: Thu, 23 Mar 2006 16:26:18 -0500 User-Agent: KMail/1.8.3 References: <200603211607.30372.mi+mx@aldan.algebra.com> <200603231403.36136.mi+mx@aldan.algebra.com> <200603232048.k2NKm4QL067644@apollo.backplane.com> In-Reply-To: <200603232048.k2NKm4QL067644@apollo.backplane.com> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200603231626.19102.mi+mx@aldan.algebra.com> X-Virus-Scanned: ClamAV devel-20050525/1354/Thu Mar 23 12:49:54 2006 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 Cc: alc@freebsd.org, stable@freebsd.org Subject: Re: Reading via mmap stinks (Re: weird bugs with mmap-ing via NFS) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2006 21:26:40 -0000 ÞÅÔ×ÅÒ 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