Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jul 1998 22:20:26 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        karl@mcs.net (Karl Denninger)
Cc:        green@zone.baldcom.net, andre@pipeline.ch, current@FreeBSD.ORG
Subject:   Re: MMAP problems
Message-ID:  <199807262220.PAA18776@usr01.primenet.com>
In-Reply-To: <19980725204141.39635@mcs.net> from "Karl Denninger" at Jul 25, 98 08:41:41 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Msync is *NOT* called anywhere in the code that I can find.  However, this
> code is reported to work on a lot of other platforms/systems, and on *SOME*
> versions of FreeBSD without trouble.
> 
> It is definitely broken on -current, although not "badly"; the problem
> happens infrequently, but often enough to piss me off.  The real problem is
> that I don't know what the bad sequence of calls is, and therefore, I have
> to consider mmap() and friends (including the SYSVSHM implementation, which
> uses it) unusable.
> 
> This is a *bad* thing over all, and something that the FreeBSD folks really
> need to consider doing something about - not having usable and reliable 
> mmap/SHM capability basically destroys FreeBSD as a DBMS or news server
> if you care about minor things like data integrity.

If you are extending an mmap'ed file, then you are expected to call
msync().  Period.

This can be "fixed" in the FreeBSD VM code if there is a page attribute
bit available to do the job.

There are situations on non-unified VM and buffer caches, where if
you don't merely extend, but you change existing data, that the
non-UVM systems will fail to update the VM image of the buffer cache
contents, *unless* you call msync().


Basically, any time you are accessing a file via system calls for I/O
and read/write faults for I/O at the same time, expect to face race
conditions requiring the use of msync().


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807262220.PAA18776>