Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jul 1998 18:03:50 -0500
From:      Karl Denninger  <karl@mcs.net>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        green@zone.baldcom.net, andre@pipeline.ch, current@FreeBSD.ORG
Subject:   Re: MMAP problems
Message-ID:  <19980726180350.54337@mcs.net>
In-Reply-To: <199807262220.PAA18776@usr01.primenet.com>; from Terry Lambert on Sun, Jul 26, 1998 at 10:20:26PM %2B0000
References:  <19980725204141.39635@mcs.net> <199807262220.PAA18776@usr01.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 26, 1998 at 10:20:26PM +0000, Terry Lambert wrote:
> > 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.

Uh, hang on a second.

The way Diablo works it extends the file using write(2).  It MMAPs for
READ access in the dnewslink program (among other places).

The comments in the config file claim it needs no msync() as a consequence
of this behavior.  This is intuitively correct, but may be functionally (for
FreeBSD) wrong.

> 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().

--
-- 
Karl Denninger (karl@MCS.Net)| MCSNet - Serving Chicagoland and Wisconsin
http://www.mcs.net/          | T1's from $600 monthly / All Lines K56Flex/DOV
			     | NEW! Corporate ISDN Prices dropped by up to 50%!
Voice: [+1 312 803-MCS1 x219]| EXCLUSIVE NEW FEATURE ON ALL PERSONAL ACCOUNTS
Fax:   [+1 312 803-4929]     | *SPAMBLOCK* Technology now included at no cost

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?19980726180350.54337>