Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jan 2012 03:00:42 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Marc Olzheim <marcolz@stack.nl>
Cc:        Garrett Cooper <yanegomi@gmail.com>, freebsd-performance@freebsd.org, Dieter BSD <dieterbsd@engineer.com>
Subject:   Re: cmp(1) has a bottleneck, but where?
Message-ID:  <CAJ-Vmo=JL8Kqu2uw-t1eKWUhdZx6CgP%2BPSiGgt91WV9WAs3idg@mail.gmail.com>
In-Reply-To: <20120103083454.GA22673@zlo.nu>
References:  <20120103073736.218240@gmx.com> <CAGH67wQXuMasyc9BE8M9fHsQv6d2zdRxDQ2ekX4whjHJFyqZyg@mail.gmail.com> <20120103083454.GA22673@zlo.nu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3 January 2012 00:34, Marc Olzheim <marcolz@stack.nl> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=JL8Kqu2uw-t1eKWUhdZx6CgP%2BPSiGgt91WV9WAs3idg>