From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 12:49:33 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B509716A417; Fri, 3 Aug 2007 12:49:32 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 3BA1B13C458; Fri, 3 Aug 2007 12:49:32 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.1/8.14.1) with ESMTP id l73CnUOK002760; Fri, 3 Aug 2007 16:49:30 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Fri, 3 Aug 2007 16:49:30 +0400 (MSD) From: Dmitry Morozovsky To: Pawel Jakub Dawidek In-Reply-To: <20070803102019.GG37984@garage.freebsd.pl> Message-ID: <20070803164108.C569@woozle.rinet.ru> References: <20070802155317.X50347@woozle.rinet.ru> <20070803102019.GG37984@garage.freebsd.pl> X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (woozle.rinet.ru [0.0.0.0]); Fri, 03 Aug 2007 16:49:31 +0400 (MSD) Cc: kib@freebsd.org, current@freebsd.org, howard0su@gmail.com Subject: Re: contemporary -current panic: locking against myself X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Aug 2007 12:49:33 -0000 On Fri, 3 Aug 2007, Pawel Jakub Dawidek wrote: PJD> > FreeBSD/i386 on Athlon X2, HEAD without WITNESS. 4G of RAM. tmpfs used for PJD> > 'make release'. PJD> > PJD> > PJD> > panic: lockmgr: locking against myself PJD> > cpuid = 0 PJD> > KDB: enter: panic PJD> > [thread pid 19396 tid 100245 ] PJD> > Stopped at kdb_enter+0x32: leave PJD> > PJD> > db> tr PJD> > Tracing pid 19396 tid 100245 td 0xce194220 PJD> > kdb_enter(c066f664,0,c066dca9,e92799cc,0,...) at kdb_enter+0x32 PJD> > panic(c066dca9,e92799dc,c0559cc7,e9279ac0,ca2f7770,...) at panic+0x124 PJD> > _lockmgr(ca2f77c8,3002,ca2f77f8,ce194220,c0675afc,...) at _lockmgr+0x401 PJD> > vop_stdlock(e9279a5c,ce194220,3002,ca2f7770,e9279a80,...) at vop_stdlock+0x40 PJD> > VOP_LOCK1_APV(d06417e0,e9279a5c,e9279bc0,0,c8d00330,...) at VOP_LOCK1_APV+0x46 PJD> > _vn_lock(ca2f7770,3002,ce194220,c0675afc,7f3,...) at _vn_lock+0x166 PJD> > vget(ca2f7770,1000,ce194220,0,e9279b98,...) at vget+0x114 PJD> > vm_object_reference(d1c70348,e9279b30,c063f81d,c0c71000,e381d000,...) at PJD> > vm_object_reference+0x12a PJD> > kern_execve(ce194220,e9279c5c,0,28204548,282045d8,e381d000,e381d000,e381d015,e381d4dc,e385d000,3fb24,3,20) PJD> > at kern_execve+0x31a PJD> > execve(ce194220,e9279cfc,c,ce194220,e9279d2c,...) at execve+0x4c PJD> > syscall(e9279d38) at syscall+0x345 PJD> > Xint0x80_syscall() at Xint0x80_syscall+0x20 PJD> > --- syscall (59, FreeBSD ELF32, execve), eip = 0x28146a47, esp = 0xbfbfe4cc, PJD> > ebp = 0xbfbfe4e8 --- PJD> > PJD> > db> show lockedvnods PJD> > Locked vnodes PJD> > PJD> > 0xca2f7770: tag tmpfs, type VREG PJD> > usecount 1, writecount 0, refcount 4 mountedhere 0 PJD> > flags () PJD> > v_object 0xd1c70348 ref 1 pages 19 PJD> > lock type tmpfs: EXCL (count 1) by thread 0xce194220 (pid 19396) with 1 PJD> > pending PJD> > tag VT_TMPFS, tmpfs_node 0xd177f9d4, flags 0x0, links 9 PJD> > mode 0555, owner 0, group 0, size 76648, status 0x0 PJD> > PJD> > It seems there is some locking problem in tmpfs. PJD> > PJD> > What other info should I provide to help resolve the problem? PJD> PJD> Here you can find two patches, which may or may not fix your problem. PJD> The first one is actually only to improve debug. PJD> PJD> This patch adds all vnode flags to the output, because I believe you PJD> have VI_OWEINACT set, but not printed: PJD> PJD> http://people.freebsd.org/~pjd/patches/vfs_subr.c.4.patch PJD> PJD> The problem here is that vm_object_reference() calls vget() without any PJD> lock flag and vget() locks vnode exclusively when the VI_OWEINACT flag PJD> is set. vget() should probably be fixed too, but jeff@ opinion is that PJD> it shouldn't happen in this case, so this may be tmpfs bug. PJD> PJD> The patch below fixes some locking problems in tmpfs: PJD> PJD> http://people.freebsd.org/~pjd/patches/tmpfs.patch PJD> PJD> The problems are: PJD> - tmpfs_root() should honour 'flags' argument, and not always lock the PJD> vnode exclusively, PJD> - tmpfs_lookup() should lock vnode using cnp->cn_lkflags, and not always PJD> do it exclusively, PJD> - in ".." case when we unlock directory vnode to avoid deadlock, we PJD> should relock it using the same type of lock it was locked before and PJD> not always relock it exclusively, PJD> PJD> Note, that this patch wasn't even compiled tested. Well, it at least compiled and booted on i386. Test release run is in progress now, i'll followup with the results. Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------