Best disk caching method (and PGSQL performance)

Terry Lambert tlambert2 at mindspring.com
Wed Sep 10 01:36:43 PDT 2003


Jeff Roberson wrote:
> On Fri, 5 Sep 2003, Terry Lambert wrote:
> > And as the comments point out, it lacks the introspection to
> > know dirty pages from clean ones, so all pages that are in
> > core and associated with the object are written, not just
> > the dirty ones.  Avoid this, if possible.
> 
> This is not accurate at all.  Please see vfs_subr.c's vop_stdfsync().  We
> walk the dirty block head and flush those buffers that are dirty.

Sorry, you're absolutely right!

It's msync which sucks because it ignores the start address and
length arguments, not fsync.  The reason fsync sucks is that it
lacks start location and end arguments.  So you end up writing
out everything with both of them, even when all you want is to
write one page of a 1G file.

-- Terry


More information about the freebsd-performance mailing list