Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2000 23:28:35 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        current@freebsd.org
Subject:   Re: softupdates still broken! 
Message-ID:  <20000113152835.30EA01CA0@overcee.netplex.com.au>
In-Reply-To: Your message of "Thu, 13 Jan 2000 23:07:39 %2B0800." <20000113150740.002261CD4@overcee.netplex.com.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm wrote:
[..]
> (kgdb) print lk
> $1 = {lkt_spl = 0, lkt_held = 412}
> (kgdb) proc 412
> 
> (kgdb) where
> #0  mi_switch () at ../../kern/kern_synch.c:828
> #1  0xc015e8c5 in tsleep (ident=0xc635d5be, priority=16, wmesg=0xc02c34a0 "ge
    tbuf", timo=0)
>     at ../../kern/kern_synch.c:437
> #2  0xc0225f4b in getdirtybuf (bpp=0xed502e80, waitfor=1) at ../../ufs/ffs/ff
    s_softdep.c:4566
> #3  0xc02255e1 in flush_inodedep_deps (fs=0xc1066000, ino=405404) at ../../uf
    s/ffs/ffs_softdep.c:4104
> #4  0xc0224f73 in softdep_sync_metadata (ap=0xed502f28) at ../../ufs/ffs/ffs_
    softdep.c:3823
> #5  0xc022933c in ffs_fsync (ap=0xed502f28) at ../../ufs/ffs/ffs_vnops.c:249
> #6  0xc018a971 in fsync (p=0xed49e480, uap=0xed502f80) at vnode_if.h:537
> #7  0xc02884be in syscall (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi 
    = 152052608, tf_esi = 0, 
>       tf_ebp = -1077942672, tf_isp = -313511980, tf_ebx = 23, tf_edx = 23, tf
    _ecx = 3, tf_eax = 118, 
>       tf_trapno = 12, tf_err = 2, tf_eip = 684704813, tf_cs = 31, tf_eflags =
     514, tf_esp = -1077942692, 
>       tf_ss = 47}) at ../../i386/i386/trap.c:1055
> #8  0xc027c806 in Xint0x80_syscall ()
> 
> It would seem that getdirtybuf() is sleeping while holding the global
> softupdates 'lk' lock.

Your mileage may vary, but the following seems to work for me, for this
part at least.

Index: sys/contrib/softupdates/ffs_softdep.c
===================================================================
RCS file: /home/ncvs/src/sys/contrib/softupdates/ffs_softdep.c,v
retrieving revision 1.49
diff -u -r1.49 ffs_softdep.c
--- sys/contrib/softupdates/ffs_softdep.c	2000/01/13 07:20:01	1.49
+++ sys/contrib/softupdates/ffs_softdep.c	2000/01/13 15:27:25
@@ -4563,7 +4563,9 @@
 			if (waitfor != MNT_WAIT)
 				return (0);
 			bp->b_xflags |= BX_BKGRDWAIT;
+			FREE_LOCK_INTERLOCKED(&lk);
 			tsleep(&bp->b_xflags, PRIBIO, "getbuf", 0);
+			ACQUIRE_LOCK_INTERLOCKED(&lk);
 			if (bp->b_xflags & BX_BKGRDINPROG)
 				panic("getdirtybuf: still writing");
 			continue;


Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000113152835.30EA01CA0>