cmp(1) has a bottleneck, but where?

Dieter BSD dieterbsd at
Thu Jan 5 17:46:28 UTC 2012

> Something/somehow it's issuing smaller IOs when using mmap?

On my box, 64K reads.  Using the '-' to avoid mmap it uses

The big difference I found was that the default mmap case isn't
using read-ahead. So it has to wait on the disk every time.  :-(

Using the '-' to avoid mmap it benefits from read-ahead, but the
default of 8 isn't large enough.  Crank up vfs.read_max and it
becomes cpu bound.  (assuming using 2 disks and not limited by
both disks being on the same wimpy controller)

A) Should the default vfs.read_max be increased?

B) Can the mmap case be fixed?  What is the aledged benefit of
using mmap anyway?  All I've even seen are problems.

More information about the freebsd-performance mailing list