From owner-cvs-all@FreeBSD.ORG Mon Aug 9 20:03:35 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 40ADC16A4CE; Mon, 9 Aug 2004 20:03:35 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i79K3Y1v078074; Mon, 9 Aug 2004 16:03:34 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id i79K3Yrb078073; Mon, 9 Aug 2004 16:03:34 -0400 (EDT) (envelope-from green) Date: Mon, 9 Aug 2004 16:03:33 -0400 From: Brian Fundakowski Feldman To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Message-ID: <20040809200333.GD14657@green.homeunix.org> References: <200408091952.i79JqT4B076245@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200408091952.i79JqT4B076245@repoman.freebsd.org> User-Agent: Mutt/1.5.6i Subject: Re: cvs commit: src/sys/vm vm_kern.c vm_map.c vm_map.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2004 20:03:35 -0000 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. \,,,,,,,,,,,,,,,,,,,,,,\