Date: Mon, 9 Aug 2004 16:03:33 -0400 From: Brian Fundakowski Feldman <green@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm_kern.c vm_map.c vm_map.h Message-ID: <20040809200333.GD14657@green.homeunix.org> In-Reply-To: <200408091952.i79JqT4B076245@repoman.freebsd.org> References: <200408091952.i79JqT4B076245@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 09, 2004 at 07:52:29PM +0000, Brian Feldman wrote: > green 2004-08-09 19:52:29 UTC > > FreeBSD src repository > > Modified files: > sys/vm vm_kern.c vm_map.c vm_map.h > Log: > Revamp VM map wiring. > > * Allow no-fault wiring/unwiring to succeed for consistency; > however, the wired count remains at zero, so it's a special case. > > * Fix issues inside vm_map_wire() and vm_map_unwire() where the > exact state of user wiring (one or zero) and system wiring > (zero or more) could be confused; for example, system unwiring > could succeed in removing a user wire, instead of being an > error. > > * Require all mappings to be unwired before they are deleted. > When VM space is still wired upon deletion, it will be waited > upon for the following unwire. This makes vslock(9) work > rather than allowing kernel-locked memory to be deleted > out from underneath of its consumer as it would before. Tor Egge and Alan Cox have each fundamentally agreed to different parts of these changes, but I never got a concensus in review. Alan pointed out that it's somewhat bogus to make all no-fault system mappings transparently succeed for wiring and unwiring, but I erred on the side of consistency, that if memory was freed using kmem_free(), it was assumed to be either wired or no-fault. That assumption can be pushed back upward into kmem_free() or the callers without making things too messy. There are additional changes I have locally in the VM area that I think are important or useful. VM wiring can create a whole- system deadlock that unlike other low-memory deadlocks, cannot be broken out of because of vm_waitpfault(). Also, as it is demonstrated by the new version of ntpd, VM wiring cannot cope with VM area which has PROT_NONE protection; it is not hard to modify, as Alan suggests, pmap to support the idea of wired but inaccessible pages, but I have only done this for i386. One would wonder why ntpd wants to have any PROT_NONE mappings, but those mappings should not necessarily preclude mlockall(2). -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040809200333.GD14657>