Date: Sun, 10 Nov 2002 21:01:14 -0800 (PST) From: Matthew Jacob <mjacob@feral.com> To: Jake Burkholder <jake@locore.ca> Cc: "Alan L. Cox" <alc@imimic.com>, jeff@freebsd.org, cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/vm uma_dbg.c Message-ID: <Pine.BSF.4.21.0211102058500.64258-100000@beppo> In-Reply-To: <20021110233436.C85338@locore.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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 <v0=0x0> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0211102058500.64258-100000>