From owner-cvs-all@FreeBSD.ORG Sun Mar 7 17:31:18 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62A6A16A4CE; Sun, 7 Mar 2004 17:31:18 -0800 (PST) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FCB843D2F; Sun, 7 Mar 2004 17:31:18 -0800 (PST) (envelope-from peter@evilpete.dyndns.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id DFD402A905; Sun, 7 Mar 2004 17:31:17 -0800 (PST) (envelope-from peter@overcee.wemm.org) Received: from overcee.wemm.org (unknown [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id 9E0F42C1AF; Sun, 7 Mar 2004 17:31:17 -0800 (PST) (envelope-from peter@overcee.wemm.org) Received: from overcee.wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (8.12.11/8.12.10) with ESMTP id i281VFUe004401; Sun, 7 Mar 2004 17:31:15 -0800 (PST) (envelope-from peter@overcee.wemm.org) Received: from localhost (localhost [[UNIX: localhost]]) by overcee.wemm.org (8.12.11/8.12.10/Submit) id i281VEwg004400; Sun, 7 Mar 2004 17:31:14 -0800 (PST) (envelope-from peter) From: Peter Wemm To: Alan Cox Date: Sun, 7 Mar 2004 17:31:14 -0800 User-Agent: KMail/1.6 References: <200403080027.i280RXIC041557@repoman.freebsd.org> <20040308005242.GG21071@cs.rice.edu> In-Reply-To: <20040308005242.GG21071@cs.rice.edu> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200403071731.14880.peter@wemm.org> cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Peter Wemm Subject: Re: cvs commit: src/sys/i386/i386 vm_machdep.c 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, 08 Mar 2004 01:31:18 -0000 On Sunday 07 March 2004 04:52 pm, Alan Cox wrote: > On Sun, Mar 07, 2004 at 04:27:33PM -0800, Peter Wemm wrote: > > peter 2004/03/07 16:27:33 PST > > > > FreeBSD src repository > > > > Modified files: > > sys/i386/i386 vm_machdep.c > > Log: > > Other parts of the tree do not protect calls to kmem_free() with > > Giant, so remove it from here. The most notable examples include > > vm_mmap(). This removes one more Giant event from exit(2). > > > > Revision Changes Path > > 1.226 +0 -2 src/sys/i386/i386/vm_machdep.c > > Whether this is safe depends on whether the underlying pages need to > be unwired. An explanation can be found in uma_large_free(). > Unwiring dips into the pmap, acquiring Giant before doing so. The > consequences would be a LOR, but not a race. Speakling of which, Kris pasted a LOR involving this very code.. 1st 0xc07d9d40 UMA lock (UMA lock) @ vm/uma_core.c:1213 2nd 0xc07a0540 Giant (Giant) @ vm/uma_core.c:2061 void uma_large_free(uma_slab_t slab) { vsetobj((vm_offset_t)slab->us_data, kmem_object); /* * XXX: We get a lock order reversal if we don't have Giant: * vm_map_remove (locks system map) -> vm_map_delete -> * vm_map_entry_unwire -> vm_fault_unwire -> mtx_lock(&Giant) */ if (!mtx_owned(&Giant)) { 2061>> mtx_lock(&Giant); page_free(slab->us_data, slab->us_size, slab->us_flags); mtx_unlock(&Giant); } else page_free(slab->us_data, slab->us_size, slab->us_flags); uma_zfree_internal(slabzone, slab, NULL, 0); } I'm guessing it came from a uma_reclaim().. Meanwhile, would it be an idea to back out the Giant removal around the kmem_free() in vm_machdep.c? Its a rarely executed code path. I wish there was a way to keep notes about this in the source. Trying to figure out the quirks of this stuff is painful. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5