cvs commit: src/sys/vm vm_kern.c vm_map.c vm_map.h
Brian Fundakowski Feldman
green at FreeBSD.org
Mon Aug 9 13:03:35 PDT 2004
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 at FreeBSD.org \ The Power to Serve! \
Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\
More information about the cvs-src
mailing list