From owner-freebsd-current Sun Jul 26 16:04:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA24147 for freebsd-current-outgoing; Sun, 26 Jul 1998 16:04:22 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from Kitten.mcs.com (Kitten.mcs.com [192.160.127.90]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA24141 for ; Sun, 26 Jul 1998 16:04:20 -0700 (PDT) (envelope-from karl@Mars.mcs.net) Received: from Mars.mcs.net (karl@Mars.mcs.net [192.160.127.85]) by Kitten.mcs.com (8.8.7/8.8.2) with ESMTP id SAA01355; Sun, 26 Jul 1998 18:03:50 -0500 (CDT) Received: (from karl@localhost) by Mars.mcs.net (8.8.7/8.8.2) id SAA14631; Sun, 26 Jul 1998 18:03:50 -0500 (CDT) Message-ID: <19980726180350.54337@mcs.net> Date: Sun, 26 Jul 1998 18:03:50 -0500 From: Karl Denninger To: Terry Lambert Cc: green@zone.baldcom.net, andre@pipeline.ch, current@FreeBSD.ORG Subject: Re: MMAP problems References: <19980725204141.39635@mcs.net> <199807262220.PAA18776@usr01.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84 In-Reply-To: <199807262220.PAA18776@usr01.primenet.com>; from Terry Lambert on Sun, Jul 26, 1998 at 10:20:26PM +0000 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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