From owner-freebsd-current@FreeBSD.ORG Thu Dec 1 16:16:21 2011 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 DED1C1065676 for ; Thu, 1 Dec 2011 16:16:21 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6E7968FC17 for ; Thu, 1 Dec 2011 16:16:21 +0000 (UTC) Received: by eaai12 with SMTP id i12so3303925eaa.13 for ; Thu, 01 Dec 2011 08:16:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :subject:x-enigmail-version:content-type; bh=42/KcZZH9qGKSLlOg1RD1quK2/7Ks1JW4QhGxTISJuo=; b=nyIAzZTspmOkruA6RF4C0IYM6Eq2GyNXXuQejEJiAeF1tnRNt6RhxQcA4+ltRQbX0D bpz0bcgfkEpkyY334KmXZWQ1ZBgKuD3DYHSvMcWv1l64gK7I5pOqO0aFaJNsA22BKpn4 Mhab6Ba/jZKq2Ozxgynzx3Dib60t2LXB4xcO0= Received: by 10.213.108.70 with SMTP id e6mr24722ebp.51.1322754282607; Thu, 01 Dec 2011 07:44:42 -0800 (PST) Received: from [10.20.6.26] (seven.iphion.nl. [217.149.136.129]) by mx.google.com with ESMTPS id 8sm18739898ees.2.2011.12.01.07.44.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Dec 2011 07:44:42 -0800 (PST) Sender: =?UTF-8?Q?Ren=C3=A9_Ladan?= Message-ID: <4ED7A0D8.90801@freebsd.org> Date: Thu, 01 Dec 2011 16:44:24 +0100 From: Rene Ladan Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: current@FreeBSD.ORG X-Enigmail-Version: undefined Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA96EF098D339257E340AB9F6" Cc: Subject: lock order reversals with netmap 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: Thu, 01 Dec 2011 16:16:22 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA96EF098D339257E340AB9F6 Content-Type: multipart/mixed; boundary="------------090809090106060906060408" This is a multi-part message in MIME format. --------------090809090106060906060408 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, on FreeBSD 10.0-CURRENT #7 r228176M: Thu Dec 1 13:56:02 CET 2011 (GENERIC + CAPABILITIES + netmap with head.diff and bge patches applied) I get these lock order reversals when running a netmap-enabled program (details in the attachment) with syscall (54, FreeBSD ELF64, sys_ioctl): Dec 1 16:23:09 acer kernel: exclusive sleep mutex netmap memory allocator lock (netmap memory allocator lock) r =3D 0 (0xfffffe00027d1880= ) locked @ /usr/src/sys/dev/netmap/netmap.c:1484 Dec 1 16:23:09 acer kernel: exclusive sleep mutex bge0 (network driver) r =3D 0 (0xffffff8000768010) locked @ /usr/src/sys/dev/netmap/if_bge_netmap.h:60 The application does not invoke the offending function (netmap_malloc()) itself. Regards, Ren=E9 --=20 http://www.rene-ladan.nl:8080/ GPG fingerprint =3D ADBC ECCD EB5F A6B4 549F 600D 8C9E 647A E564 2BFC (subkeys.pgp.net) --------------090809090106060906060408 Content-Type: text/plain; name="netmap-messages" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="netmap-messages" Dec 1 15:41:20 acer kernel: FreeBSD 10.0-CURRENT #7 r228176M: Thu Dec 1= 13:56:02 CET 2011 Dec 1 15:41:20 acer kernel: real memory =3D 4294967296 (4096 MB) Dec 1 15:41:20 acer kernel: avail memory =3D 4080091136 (3891 MB) Dec 1 15:41:20 acer kernel: 001.000005 netmap_memory_init [1627] netmap_= buffer_base 0xffffff8117eaa000 (offset 679936) Dec 1 15:41:20 acer kernel: 001.000006 netmap_memory_init [1636] Have 12= 9 MB, use 661KB for rings, 65862 buffers at 0xffffff8117eaa000 Dec 1 15:41:20 acer kernel: netmap: loaded module with 129 Mbytes Dec 1 15:41:20 acer kernel: bge0: mem 0xf5100000-0xf510ffff irq 16 at dev= ice 0.0 on pci2 Dec 1 15:41:20 acer kernel: bge0: CHIP ID 0x05784100; ASIC REV 0x5784; C= HIP REV 0x57841; PCI-E Dec 1 15:41:20 acer kernel: miibus0: on bge0 Dec 1 15:41:20 acer kernel: brgphy0: PHY = 1 on miibus0 Dec 1 15:41:20 acer kernel: brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 1= 00baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-m= aster, auto, auto-flow Dec 1 15:41:20 acer kernel: bge0: Ethernet address: 00:26:2d:5e:d8:ee Dec 1 15:41:20 acer kernel: 001.000009 netmap_attach [1243] ok for bge0 Dec 1 16:23:09 acer kernel: 989.882634 netmap_set_ringid [779] ringid bg= e0 set to SW RING Dec 1 16:23:09 acer kernel: uma_zalloc_arg: zone "64" with the following= non-sleepable locks held: Dec 1 16:23:09 acer kernel: exclusive sleep mutex netmap memory allocato= r lock (netmap memory allocator lock) r =3D 0 (0xfffffe00027d1880) locked= @ /usr/src/sys/dev/netmap/netmap.c:1484 Dec 1 16:23:09 acer kernel: exclusive sleep mutex bge0 (network driver) = r =3D 0 (0xffffff8000768010) locked @ /usr/src/sys/dev/netmap/if_bge_netm= ap.h:60 Dec 1 16:23:09 acer kernel: KDB: stack backtrace: Dec 1 16:23:09 acer kernel: db_trace_self_wrapper() at db_trace_self_wra= pper+0x2a Dec 1 16:23:10 acer kernel: kdb_backtrace() at kdb_backtrace+0x37 Dec 1 16:23:10 acer kernel: _witness_debugger() at _witness_debugger+0x2= c Dec 1 16:23:10 acer kernel: witness_warn() at witness_warn+0x2c2 Dec 1 16:23:10 acer kernel: uma_zalloc_arg() at uma_zalloc_arg+0x335 Dec 1 16:23:10 acer kernel: malloc() at malloc+0xbe Dec 1 16:23:10 acer kernel: netmap_malloc() at netmap_malloc+0x86 Dec 1 16:23:10 acer kernel: netmap_ioctl() at netmap_ioctl+0x5bd Dec 1 16:23:10 acer kernel: devfs_ioctl_f() at devfs_ioctl_f+0x7a Dec 1 16:23:10 acer kernel: kern_ioctl() at kern_ioctl+0xcd Dec 1 16:23:10 acer kernel: sys_ioctl() at sys_ioctl+0xfd Dec 1 16:23:10 acer kernel: amd64_syscall() at amd64_syscall+0x3ac Dec 1 16:23:10 acer kernel: Xfast_syscall() at Xfast_syscall+0xf7 Dec 1 16:23:10 acer kernel: --- syscall (54, FreeBSD ELF64, sys_ioctl), = rip =3D 0x8022aef0c, rsp =3D 0x7fffffffd4b8, rbp =3D 0x802bfb100 --- Dec 1 16:23:10 acer kernel: uma_zalloc_arg: zone "64" with the following= non-sleepable locks held: Dec 1 16:23:10 acer kernel: exclusive sleep mutex netmap memory allocato= r lock (netmap memory allocator lock) r =3D 0 (0xfffffe00027d1880) locked= @ /usr/src/sys/dev/netmap/netmap.c:1484 Dec 1 16:23:10 acer kernel: exclusive sleep mutex bge0 (network driver) = r =3D 0 (0xffffff8000768010) locked @ /usr/src/sys/dev/netmap/if_bge_netm= ap.h:60 Dec 1 16:23:10 acer kernel: KDB: stack backtrace: Dec 1 16:23:10 acer kernel: db_trace_self_wrapper() at db_trace_self_wra= pper+0x2a Dec 1 16:23:10 acer kernel: kdb_backtrace() at kdb_backtrace+0x37 Dec 1 16:23:10 acer kernel: _witness_debugger() at _witness_debugger+0x2= c Dec 1 16:23:10 acer kernel: witness_warn() at witness_warn+0x2c2 Dec 1 16:23:10 acer kernel: uma_zalloc_arg() at uma_zalloc_arg+0x335 Dec 1 16:23:10 acer kernel: malloc() at malloc+0xbe Dec 1 16:23:10 acer kernel: netmap_malloc() at netmap_malloc+0x86 Dec 1 16:23:10 acer kernel: netmap_ioctl() at netmap_ioctl+0x817 Dec 1 16:23:10 acer kernel: devfs_ioctl_f() at devfs_ioctl_f+0x7a Dec 1 16:23:10 acer kernel: kern_ioctl() at kern_ioctl+0xcd Dec 1 16:23:10 acer kernel: sys_ioctl() at sys_ioctl+0xfd Dec 1 16:23:10 acer kernel: amd64_syscall() at amd64_syscall+0x3ac Dec 1 16:23:10 acer kernel: Xfast_syscall() at Xfast_syscall+0xf7 Dec 1 16:23:10 acer kernel: --- syscall (54, FreeBSD ELF64, sys_ioctl), = rip =3D 0x8022aef0c, rsp =3D 0x7fffffffd4b8, rbp =3D 0x802bfb100 --- Dec 1 16:23:10 acer kernel: 990.041760 netmap_reset [1403] +++ NR_REINIT= ok on bge0 RX[0] Dec 1 16:23:10 acer kernel: 990.041948 netmap_reset [1384] +++ NR_REINIT= ok on bge0 TX[0] Dec 1 16:23:10 acer kernel: bge0: link state changed to DOWN Dec 1 16:23:10 acer kernel: 990.051589 netmap_dtor [352] deleting last n= etmap instance for bge0 Dec 1 16:23:12 acer kernel: bge0: link state changed to UP --------------090809090106060906060408-- --------------enigA96EF098D339257E340AB9F6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7XoOkACgkQjJ5keuVkK/yfigCgsO5wQ/1y9D5L7dgBoDLzJB+N Hc8AniBuVaHsf10p+5pqq0sTkiPkKx3p =bNYi -----END PGP SIGNATURE----- --------------enigA96EF098D339257E340AB9F6--