From owner-cvs-all Sun Nov 10 21: 1:21 2002 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 5A5FA37B401; Sun, 10 Nov 2002 21:01:19 -0800 (PST) Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8233D43E3B; Sun, 10 Nov 2002 21:01:18 -0800 (PST) (envelope-from mjacob@feral.com) Received: from mailhost.feral.com (mjacob@mailhost.feral.com [192.67.166.1]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id gAB51EZ64350; Sun, 10 Nov 2002 21:01:14 -0800 (PST) (envelope-from mjacob@feral.com) Date: Sun, 10 Nov 2002 21:01:14 -0800 (PST) From: Matthew Jacob X-Sender: mjacob@beppo Reply-To: mjacob@feral.com To: Jake Burkholder Cc: "Alan L. Cox" , jeff@freebsd.org, cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/vm uma_dbg.c In-Reply-To: <20021110233436.C85338@locore.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 > > This would be my suggestion: > > Index: sys/vm/uma_core.c > =================================================================== > RCS file: /home/ncvs/src/sys/vm/uma_core.c,v > retrieving revision 1.41 > diff -u -r1.41 uma_core.c > --- sys/vm/uma_core.c 1 Nov 2002 01:01:27 -0000 1.41 > +++ sys/vm/uma_core.c 11 Nov 2002 04:11:38 -0000 > @@ -1348,7 +1348,9 @@ > ("uma_zalloc: Bucket pointer mangled.")); > cache->uc_allocs++; > #ifdef INVARIANTS > + ZONE_LOCK(zone); > uma_dbg_alloc(zone, NULL, item); > + ZONE_UNLOCK(zone); > #endif > CPU_UNLOCK(zone, cpu); > if (zone->uz_ctor) > @@ -1698,10 +1700,12 @@ > ("uma_zfree: Freeing to non free bucket index.")); > bucket->ub_bucket[bucket->ub_ptr] = item; > #ifdef INVARIANTS > + ZONE_LOCK(zone); > if (zone->uz_flags & UMA_ZFLAG_MALLOC) > uma_dbg_free(zone, udata, item); > else > uma_dbg_free(zone, NULL, item); > + ZONE_UNLOCK(zone); > #endif > CPU_UNLOCK(zone, cpu); > return; > > uma_dbg_* are called with the zone lock held everywhere else, and the > us_freelist is used with the zone lock held everywhere else as well. > slab_zalloc is working on a newly created slab that doesn't have any > other references, so it doesn't need to be locked until its added to > the zone. > And that'd be a no: Mounting root from ufs:/dev/da2a recursed on non-recursive lock (sleep mutex) NAMEI @ ../../../vm/uma_dbg.c:202 first acquired @ ../../../vm/uma_core.c:1351 panic: recurse cpuid = 2; panic Stopped at Debugger+0x34: zapnot v0,#0xf,v0 db> t Debugger() at Debugger+0x34 panic() at panic+0x1a4 witness_lock() at witness_lock+0x3fc _mtx_lock_flags() at _mtx_lock_flags+0xc4 uma_dbg_getslab() at uma_dbg_getslab+0xe4 uma_dbg_alloc() at uma_dbg_alloc+0x30 uma_zalloc_arg() at uma_zalloc_arg+0x130 namei() at namei+0xa4 kern_mkdir() at kern_mkdir+0x70 start_init() at start_init+0x1a0 fork_exit() at fork_exit+0xe0 exception_return() at exception_return --- root of call graph --- I guess getting rid of the ZONE_LOCK in uma_dbg_getslab is also needed :-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message