From owner-freebsd-current@FreeBSD.ORG Tue Nov 27 16:11:06 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2744116A46B for ; Tue, 27 Nov 2007 16:11:06 +0000 (UTC) (envelope-from freebsd-current@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id A3D0413C474 for ; Tue, 27 Nov 2007 16:11:05 +0000 (UTC) (envelope-from freebsd-current@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ix31R-0003px-4w for freebsd-current@freebsd.org; Tue, 27 Nov 2007 16:10:53 +0000 Received: from mulderlab.f5.com ([205.229.151.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Nov 2007 16:10:53 +0000 Received: from atkin901 by mulderlab.f5.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Nov 2007 16:10:53 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-current@freebsd.org From: Mark Atkinson Date: Tue, 27 Nov 2007 08:10:33 -0800 Lines: 108 Message-ID: References: <4744EBA4.7020209@clearchain.com> <3bbf2fe10711220408t30136430s15fdba0ebcbbfa66@mail.gmail.com> <3bbf2fe10711220427s38561159k4879d0c792d09694@mail.gmail.com> <474B4876.9020209@clearchain.com> <3bbf2fe10711261431s1b1bd697n46d370900d5fe9c0@mail.gmail.com> <2a41acea0711261434u817eb06xe05eba8447afc3ae@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mulderlab.f5.com User-Agent: KNode/0.10.5 Sender: news Subject: Re: em0 panic: mutex em0 not owned 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: Tue, 27 Nov 2007 16:11:06 -0000 Jack Vogel wrote: > On Nov 26, 2007 2:31 PM, Attilio Rao wrote: >> 2007/11/26, Benjamin Close : >> >> > Attilio Rao wrote: >> > > 2007/11/22, Attilio Rao : >> > > >> > >> 2007/11/22, Benjamin Close : >> > >> >> > >>> Hi Folks, >> > >>> With a recent current I'm now getting panics when em0 tries to >> > >>> come up: >> > >>> >> > >>> panic: mutex em0 not owned at ../../../kern/kern_mutex.c:144 >> > >>> >> > >>> _mtx_assert() + 0xdc >> > >>> _callout_stop_safe()+0x5d >> > >>> em_stop() + 0x50 (if_em.c:2546) >> > >>> em_init_locked()+0x47 (if_em.c:1256) >> > >>> em_ioctl()+0x466 >> > >>> ifhwioctl() + 0x75f >> > >>> ifioctl() +0xb0 >> > >>> kern_ioctl() + 0xa3 >> > >>> >> > >>> This is even after atillos, latest patch. >> > >>> >> > >> Yes, this is a race access to callout_stop() in em driver. >> > >> callout_stop() needs to be called with callout-specific lock held >> > >> otherwise you can get a race and this seems not happening. I just >> > >> inserted this assertions in order to catch bugs like these. >> > >> I have no time to double-check it, can you do? >> > >> >> > > >> > > Ok, basically em_stop() both wants to stop core callout and tx >> > > channel callout but it only holds core lock. It needs to hold both in >> > > order to stop both. As I'm not sure about lock ordering there I can't >> > > produce a patch now so the ball is in jfv@ court (CC'ed). >> > > >> > The attached patch fixes the panic at the cost of a lock order >> > reversal: >> >> jfv@ today should have fixed it. >> Please cvsup and try again. >> >> >> Attilio > > Yup, version 1.188 is the fix for this. > > Cheers, > > Jack > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" Is this expected after the fix? acquiring duplicate lock of same type: "network driver" 1st em0 @ /usr/src/sys/dev/em/if_em.c:1018 2nd em0 @ /usr/src/sys/dev/em/if_em.c:1252 KDB: stack backtrace: db_trace_self_wrapper(c0acd130,e6685a60,c07a6d26,c0acf51e,c40328d0,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c0acf51e,c40328d0,c0a9becd,4e4,e6685a48,...) at kdb_backtrace+0x29 witness_checkorder(c40022d8,9,c0a9becd,4e4,38,...) at witness_checkorder+0x6d6 _mtx_lock_flags(c40022d8,0,c0a9becd,4e4,c4031800,...) at _mtx_lock_flags+0xbc em_init_locked(c40022c0,0,c0a9becd,3fa,c40ab400,...) at em_init_locked+0x65 em_ioctl(c4031800,8020690c,c40ab400,c0796b96,a057b1ef,...) at em_ioctl+0xe3 in_ifinit(0,c40ab400,0,0,c0ad68ef,...) at in_ifinit+0x292 in_control(c4300dec,8040691a,c422ea40,c4031800,c42ffcc0,...) at in_control+0xa83 ifioctl(c4300dec,8040691a,c422ea40,c42ffcc0,c42ffcc0,...) at ifioctl+0x333 soo_ioctl(c4297708,8040691a,c422ea40,c3f0d800,c42ffcc0,...) at soo_ioctl+0x3e2 kern_ioctl(c42ffcc0,3,8040691a,c422ea40,0,...) at kern_ioctl+0x253 ioctl(c42ffcc0,e6685cfc,c,c0afca45,c0b7b510,...) at ioctl+0x13f syscall(e6685d38) at syscall+0x2f3 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x2816b213, esp = 0xbfbfe60c, ebp = 0xbfbfe638 --- # em0: Link is up 1000 Mbps Full Duplex # pciconf -v -l | grep ^em -A4 em0@pci0:3:0:0: class=0x020000 card=0x61801462 chip=0x108b8086 rev=0x03 hdr=0x00 vendor = 'Intel Corporation' device = 'PC82573V Intel network controller (PCIE Gigabit Ethernet)' class = network subclass = ethernet em1@pci0:4:0:0: class=0x020000 card=0x61801462 chip=0x108b8086 rev=0x00 hdr=0x00 vendor = 'Intel Corporation' device = 'PC82573V Intel network controller (PCIE Gigabit Ethernet)' class = network subclass = ethernet -- Mark Atkinson atkin901@yahoo.com (!wired)?(coffee++):(wired);