MS_ASYNC with MS_INVALIDATE

Dan Nelson dnelson at allantgroup.com
Mon Mar 29 07:36:58 PST 2004


In the last episode (Mar 29), Peter Jeremy said:
> On Sun, Mar 28, 2004 at 03:02:37PM -0600, Dan Nelson wrote:
> >In the last episode (Mar 27), Mark Terribile said:
> > > A friend asked me to run some Linux source on FreeBSD.  It
> > > simulates a data pool management system he is using, and it
> > > includes a call msync(2) with both the MS_ASYNC and MS_INVALIDATE
> > > flags.  FreeBSD does not allow this. (I tested it on my 4.8
> > > system; I'll have access to a 5.1 system on Monday.) I ran it
> > > without the MS_ASYNC, and got very different results from the
> > > ones he reported on Linux.  I'd like to be able to explain what's
> > > happening.
> 
> My interpretation of the man page suggests that MS_ASYNC should not
> have any effect other than timing unless there are race conditions.

Me too.  No combination of flags to msync() should affect any other
processes view of the data IMHO.  It just affects how soon the blocks
get written to disk.  Now, if you're also accessing this file over NFS,
that's a different matter.

I actually think MS_INVALIDATE might be a no-op on a system with a
merged vm/buffer cache.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list