From owner-freebsd-performance@FreeBSD.ORG Tue Jan 3 11:00:43 2012 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 561A11065673 for ; Tue, 3 Jan 2012 11:00:43 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1196F8FC18 for ; Tue, 3 Jan 2012 11:00:42 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so21484877vcb.13 for ; Tue, 03 Jan 2012 03:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=H0aUwlf+fs8k/p1KLnOE+41IYgJTPooWoCqW99VROT4=; b=F+VRLXryrPb10YztQRdJzVIdAsu3h4ulD6LJf0y7D0i0YftyIC6DglX4ocA3do9Czz 6Enzfq2uP9ASJS9SUOr7uTVhbqGLrASfBDTkUr3rTvQSyIAMCYS990weu2cc0IDIUcoP wHkXcROb+rP7O8/QSTzIeatHfclsbihLEoODw= MIME-Version: 1.0 Received: by 10.220.213.200 with SMTP id gx8mr29554548vcb.13.1325588442376; Tue, 03 Jan 2012 03:00:42 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.36.5 with HTTP; Tue, 3 Jan 2012 03:00:42 -0800 (PST) In-Reply-To: <20120103083454.GA22673@zlo.nu> References: <20120103073736.218240@gmx.com> <20120103083454.GA22673@zlo.nu> Date: Tue, 3 Jan 2012 03:00:42 -0800 X-Google-Sender-Auth: Ki6uiJGpOPA0MIy7zAGJmaxvEyg Message-ID: From: Adrian Chadd To: Marc Olzheim Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Garrett Cooper , freebsd-performance@freebsd.org, Dieter BSD Subject: Re: cmp(1) has a bottleneck, but where? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 11:00:43 -0000 On 3 January 2012 00:34, Marc Olzheim wrote: > On Tue, Jan 03, 2012 at 12:21:10AM -0800, Garrett Cooper wrote: >> =A0 =A0 The file is 3.0GB in size. Look at all those page faults though! >> Thanks! >> -Garrett > > From usr.bin/cmp/c_regular.c: > > #define MMAP_CHUNK (8*1024*1024) > ... > for (..) { > =A0 =A0 =A0 =A0mmap() chunk of size MMAP_CHUNK. > =A0 =A0 =A0 =A0compare > =A0 =A0 =A0 =A0munmap()k > } > > That 8 MB chunk size sounds like a bad plan to me. I can imagine > something needed to be done to compare files larger than X GB on a 32bit > system, but 8MB is pretty small... Er, hint: look at the average IO size in the cmp versus cp stats above? Something/somehow it's issuing smaller IOs when using mmap? Adrian