From owner-freebsd-stable@FreeBSD.ORG Sat Mar 25 23:47:08 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 0889016A41F; Sat, 25 Mar 2006 23:47:08 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail23.syd.optusnet.com.au (mail23.syd.optusnet.com.au [211.29.133.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A33043D4C; Sat, 25 Mar 2006 23:46:59 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail23.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k2PNkhkg025658 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 26 Mar 2006 10:46:43 +1100 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.4/8.13.4) with ESMTP id k2PNkgqm000872; Sun, 26 Mar 2006 10:46:42 +1100 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.4/8.13.4/Submit) id k2PNkfs1000871; Sun, 26 Mar 2006 10:46:41 +1100 (EST) (envelope-from peter) Date: Sun, 26 Mar 2006 10:46:41 +1100 From: Peter Jeremy To: Mikhail Teterin Message-ID: <20060325234641.GA770@turion.vk2pj.dyndns.org> References: <200603232352.k2NNqPS8018729@gate.bitblocks.com> <200603241518.01027.mi+mx@aldan.algebra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200603241518.01027.mi+mx@aldan.algebra.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 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: Sat, 25 Mar 2006 23:47:08 -0000 On Fri, 2006-Mar-24 15:18:00 -0500, Mikhail Teterin wrote: >On the machine, where both mzip and the disk run at only 50%, the disk is a >plain SATA drive (mzip's state goes from "RUN" to "vnread" and back). ... > 18 users Load 0.46 0.53 0.60 24 ??? 15:15 > >Mem:KB REAL VIRTUAL VN PAGER SWAP PAGER > Tot Share Tot Share Free in out in out >Act 1833864 5880 27758552 45268 92216 count 240 >All 1881188 5992 1432466k 52864 pages 3413 > Interrupts >Proc:r p d s w Csw Trp Sys Int Sof Flt cow 2252 total > 1 2101 1605 2025 197 422 2 2018 251432 wire irq1: atkb > 506156 act irq6: fdc0 > 3.0%Sys 0.0%Intr 45.2%User 0.0%Nice 51.9%Idl 1038216 inact irq15: ata >| | | | | | | | | | 89252 cache irq17: fwo >=>>>>>>>>>>>>>>>>>>>>>>> 2964 free irq20: nve > daefr irq21: ohc >Namei Name-cache Dir-cache prcfr 241 irq22: ehc > Calls hits % hits % 951 react 11 irq25: em0 > pdwak irq29: amr > 618 zfod pdpgs 2000 cpu0: time >Disks ad4 amrd0 ofod intrn >KB/t 56.79 0.00 %slo-z 200816 buf >tps 241 0 5143 tfree 8 dirtybuf >MB/s 13.38 0.00 100000 desiredvnodes >% busy 47 0 34717 numvnodes > 24991 freevnodes OK. I _can_ see something like this when I try to compress a big file using either your program or gzip. In my case, both the disk % busy and system idle vary widely but there's typicaly 50-60% disk utilisation and 30-40% CPU idle. However, systat is reporting 23-25MB/sec (whereas dd peaks at ~30MB/sec) so the time to gzip the datafile isn't that much different to the time to just read it. My guess is that the read-ahead algorithms are working but aren't doing enough re-ahead to cope with "read a bit, do some cpu-intensive processing and repeat" at 25MB/sec so you're winding up with a degree of serialisation where the I/O and compressing aren't overlapped. I'm not sure how tunable the read-ahead is. -- Peter Jeremy