Date: Sat, 16 Mar 1996 21:07:31 +1100 (EST) From: David Dawes <dawes@rf900.physics.usyd.edu.au> To: sos@FreeBSD.org Cc: dyson@FreeBSD.org, current@FreeBSD.org, mmead@glock.com Subject: Re: Try this vm_mmap.c -- please Message-ID: <199603161007.VAA09725@rf900.physics.usyd.edu.au> In-Reply-To: <199603160903.KAA00185@DeepCore.dk> from "sos@FreeBSD.org" at Mar 16, 96 10:03:46 am
next in thread | previous in thread | raw e-mail | index | archive | help
>> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603161007.VAA09725>
