Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Mar 1996 06:06:26 -0800
From:      David Greenman <davidg@Root.COM>
To:        "Jordan K. Hubbard" <jkh@time.cdrom.com>
Cc:        David Dawes <dawes@rf900.physics.usyd.edu.au>, sos@FreeBSD.org, dyson@FreeBSD.org, current@FreeBSD.org, mmead@Glock.COM
Subject:   Re: Try this vm_mmap.c -- please 
Message-ID:  <199603161406.GAA07890@Root.COM>
In-Reply-To: Your message of "Sat, 16 Mar 1996 04:36:29 PST." <244.826979789@time.cdrom.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>> Does accelx by any chance use MAP_PRIVATE?
>
>Bingo!
>
>Between David's comment here and John's own comment in the latest
>vm_mmap.c he sent out which says:
>
>	 * On device mmaps we default to map shared -- makes the most
>	 * sense in this case.  Does MAP_PRIVATE even make sense on
>	 * devices mmaps???
>
>I made the following change:
>
>	if ((type == OBJT_DEVICE)) {
>		if (flags & (MAP_PRIVATE|MAP_SHARED) == 0)
>		    flags |= MAP_SHARED;
>		else if (flags & MAP_PRIVATE)
>		    flags &= ~MAP_PRIVATE;
>	}

   Could be written as:

	/*
	 * Force device mappings to be shared.
	 */
	if (type == OBJT_DEVICE) {
		flags &= ~MAP_PRIVATE;
		flags |= MAP_SHARED;
	}

>Which turns MAP_PRIVATE *off* for device objects.  My Xaccel 1.2 now
>works perfectly!  Yay!

   Yes, as John and I have discussed, it really doesn't make any sense to
allow COW (MAP_PRIVATE) mappings of devices. I think forcing them shared
is reasonable.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project



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