From owner-freebsd-current Sat Mar 16 02:07:40 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id CAA23660 for current-outgoing; Sat, 16 Mar 1996 02:07:40 -0800 (PST) Received: from rf900.physics.usyd.edu.au (rf900.physics.usyd.edu.au [129.78.129.109]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id CAA23654 Sat, 16 Mar 1996 02:07:35 -0800 (PST) Received: (from dawes@localhost) by rf900.physics.usyd.edu.au (8.6.11/8.6.9) id VAA09725; Sat, 16 Mar 1996 21:07:31 +1100 From: David Dawes Message-Id: <199603161007.VAA09725@rf900.physics.usyd.edu.au> Subject: Re: Try this vm_mmap.c -- please To: sos@FreeBSD.org Date: Sat, 16 Mar 1996 21:07:31 +1100 (EST) Cc: dyson@FreeBSD.org, current@FreeBSD.org, mmead@glock.com In-Reply-To: <199603160903.KAA00185@DeepCore.dk> from "sos@FreeBSD.org" at Mar 16, 96 10:03:46 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >> This vm_mmap.c contains what I believe some fixes to the mmap code. Note >> that there were some severe bogons in the code, and one that I cannot >> easily get rid of. Firstly we allow mmaps that don't have either MAP_PRIVATE or >> MAP_SHARED set. This is wrong because logically one is necessary. The >> solution is that I default to MAP_PRIVATE for vnodes and MAP_SHARED for >> devices (video memory.) Also, the old code did not allow for shared >> anonymous mappings, this is very bogus. Eventually, we should enforce >> a MAP_PRIVATE or MAP_SHARED bit being set, but there is code out there >> like XFree that doesn't specify either bit, and since it was originally >> not "wrong", it is a PROBLEM :-(. PLEASE PLEASE give me some feedback on >> this, as my entire life for this weekend is dedicated to fixing this >> problem (not really, but you know what I mean.) :-). > >Sorry, but it still breaks my accelx server :( > >I guess you are in for a looonngg weekend :) Does accelx by any chance use MAP_PRIVATE? The 1.38 version has: if ((flags & (MAP_ANON|MAP_SHARED)) == 0 && (type != OBJT_DEVICE)) { docow = MAP_COPY_ON_WRITE; whereas the new version has: if ((type == OBJT_DEVICE) && (flags & (MAP_PRIVATE|MAP_SHARED)) == 0) flags |= MAP_SHARED; if (flags & MAP_PRIVATE) { docow = MAP_COPY_ON_WRITE; With the 1.38 version MAP_PRIVATE won't cause COW for a device, but it will cause COW for a device with the latest version. David