From owner-freebsd-current@FreeBSD.ORG Thu Sep 2 20:20:45 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6126316A4CE for ; Thu, 2 Sep 2004 20:20:45 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6E3543D41 for ; Thu, 2 Sep 2004 20:20:44 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i82KI5Vm059852; Thu, 2 Sep 2004 16:18:05 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i82KI51s059849; Thu, 2 Sep 2004 16:18:05 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Thu, 2 Sep 2004 16:18:05 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Patrick Guelat In-Reply-To: <20040902211406.I19478@murphy.imp.ch> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE cc: freebsd-current@freebsd.org Subject: Re: Panic in propagate_priority() [5.3-BETA2] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 02 Sep 2004 20:20:45 -0000 On Thu, 2 Sep 2004, Patrick Guelat wrote: > On Thu, 2 Sep 2004, Robert Watson wrote: >=20 > >> exclusive sleep mutex rip r=3D1 (0xc079e70c) locked @ /usr/src53/sys/n= etinet6/raw_ip.c:255 > > > > Ah, indeed, there's an incorrect "lock" instead of "unlock" there. Cou= ld > > you try the attached patch: >=20 > Thanks. Your patch works like a dream. I looked a that line a dozen > times and didn't realize it was a lock instead of an unlock ;-) Great -- I've merged to HEAD and will merge to RELENG_5 in a couple of days once it has settled. > I was just wondering why you're using the same lock in IPv4 and IPv6 and > if this probably may cause problems in ipv6 over ipv4 situations. This was a design choice I inherited from those working on the network stack locking previously, but it actually makes some amount of sense: the IPv4 and IPv6 implementations share a lot of infrastructure, including protocol control blocks lists for most protocols. I.e., UDP, TCP, et al.= =20 This includes raw IP sockets. Since the same structures are use, the same locks must also be used. I agree there are potential layering issues, especially relating to IPv4/IPv6 tunneling, which may already be addressed by queued dispatch (i.e., asynchronous processing of the tunneled packet to avoid both lock orders and general recursion problems). Thanks! Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Principal Research Scientist, McAfee Research >=20 > Tested on RELENG_5 >=20 > -Patrick >=20 > > > > Index: raw_ip6.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > RCS file: /data/fbsd-cvs/ncvs/src/sys/netinet6/raw_ip6.c,v > > retrieving revision 1.45 > > diff -u -r1.45 raw_ip6.c > > --- raw_ip6.c=0912 Aug 2004 18:31:36 -0000=091.45 > > +++ raw_ip6.c=092 Sep 2004 12:55:19 -0000 > > @@ -252,7 +252,7 @@ > > =09=09} > > =09=09ip6stat.ip6s_delivered--; > > =09} > > -=09INP_INFO_RLOCK(&ripcbinfo); > > +=09INP_INFO_RUNLOCK(&ripcbinfo); > > =09return IPPROTO_DONE; > > } > -- > Patrick Gu=E9lat, ImproWare AG Network Services, CH-4133 Pratteln > Mail: Patrick.Guelat@imp.ch - Phone: +41 61 826 93 00 (ext: 13)