From owner-cvs-all Tue Dec 31 13:21:23 2002 Delivered-To: cvs-all@freebsd.org Received: from green.bikeshed.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 67B7637B405; Tue, 31 Dec 2002 13:21:21 -0800 (PST) Received: from green.bikeshed.org (3dcin0f4uhrfnqk3@green.bikeshed.org [10.0.0.1] (may be forged)) by green.bikeshed.org (8.12.6/8.12.6) with ESMTP id gBVLLKim013670; Tue, 31 Dec 2002 16:21:20 -0500 (EST) (envelope-from green@green.bikeshed.org) Received: from localhost (green@localhost) by green.bikeshed.org (8.12.6/8.12.6/Submit) with ESMTP id gBVLLKNX013666; Tue, 31 Dec 2002 16:21:20 -0500 (EST) Message-Id: <200212312121.gBVLLKNX013666@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Nate Lawson Cc: Alan Cox , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm_map.c vm_map.h In-Reply-To: Your message of "Tue, 31 Dec 2002 13:16:19 PST." From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 31 Dec 2002 16:21:20 -0500 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Nate Lawson wrote: > On Tue, 31 Dec 2002, Alan Cox wrote: > > Modified files: > > sys/vm vm_map.c vm_map.h > > Log: > > Implement a variant locking scheme for vm maps: Access to system maps > > is now synchronized by a mutex, whereas access to user maps is still > > synchronized by a lockmgr()-based lock. > > > > Revision Changes Path > > 1.278 +38 -16 src/sys/vm/vm_map.c > > 1.94 +1 -0 src/sys/vm/vm_map.h > > > > + _mtx_lock_flags(&map->system_mtx, 0, file, line); > > + else { > > + error = lockmgr(&map->lock, LK_EXCLUSIVE, NULL, curthread); > > + KASSERT(error == 0, ("%s: failed to get lock", __func__)); > > + } > > [...] > > - lockmgr(&map->lock, LK_RELEASE, NULL, curthread); > > + if (map->system_map) > > + _mtx_unlock_flags(&map->system_mtx, 0, file, line); > > + else > > + lockmgr(&map->lock, LK_RELEASE, NULL, curthread); > > } > > > > void > > Please use the non-underscore, exported mtx_* routines. The macros expand > to the same thing unless you're doing something strange w/ file and line > (but I don't see that in your patch). They're in-line functions, so the file and line numbers are entirely useless if you don't pass them in directly, and used the macros. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org <> bfeldman@tislabs.com \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message