From owner-cvs-src@FreeBSD.ORG Wed Jun 21 09:13:42 2006 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 855A816A481; Wed, 21 Jun 2006 09:13:42 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34F8543D64; Wed, 21 Jun 2006 09:13:34 +0000 (GMT) (envelope-from max@love2party.net) Received: from [88.64.183.148] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis), id 0MKwpI-1FsymD060U-00017W; Wed, 21 Jun 2006 11:13:33 +0200 From: Max Laier Organization: FreeBSD To: Maxim Konovalov Date: Wed, 21 Jun 2006 11:13:22 +0200 User-Agent: KMail/1.9.1 References: <200606210602.k5L62Zor029243@repoman.freebsd.org> <20060621120212.D93005@mp2.macomnet.net> In-Reply-To: <20060621120212.D93005@mp2.macomnet.net> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2667997.84cDmJOyTc"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200606211113.31621.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: cvs-src@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/net if.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jun 2006 09:13:42 -0000 --nextPart2667997.84cDmJOyTc Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 21 June 2006 10:06, Maxim Konovalov wrote: > On Wed, 21 Jun 2006, 06:02-0000, Gleb Smirnoff wrote: > > glebius 2006-06-21 06:02:35 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/net if.c > > Log: > > - First initialize ifnet, and then insert it into global > > list. > > - First remove from global list, then start destroying. > > > > PR: kern/97679 > > Submitted by: Alex Lyashkov > > Reviewed by: rwatson, brooks > > FWIW, even with Yar's recent commit to if_vlan.c it still panics. I > told Alex about that. A testcase below. Run it for several minutes. > > #11 0xc05e1a4a in calltrap () at /usr/src/sys/i386/i386/exception.s:138 > #12 0xc05608cb in in6ifa_ifpwithaddr (ifp=3D0xdeadc0de, addr=3D0xc39b5218) > at /usr/src/sys/netinet6/in6.c:1862 > #13 0xc055e81d in in6_control (so=3D0xc2bbda60, cmd=3D0xc1206949, > data=3D0xc39b5200 "vlan2349", ifp=3D0xc3973000, > td=3D0xc39b5210) at /usr/src/sys/netinet6/in6.c:459 > #14 0xc052c43c in ifioctl (so=3D0xc2bbda60, cmd=3D0xc1206949, > data=3D0xc39b5200 "vlan2349", td=3D0xc2afd870) > at /usr/src/sys/net/if.c:1530 > #15 0xc04efb47 in soo_ioctl (fp=3D0xdeadc0de, cmd=3D0xc1206949, > data=3D0xc39b5200, active_cred=3D0xc2e64700, td=3D0xc2afd870) > at /usr/src/sys/kern/sys_socket.c:214 > #16 0xc04ea810 in ioctl (td=3D0xc2afd870, uap=3D0xd56a7d04) at file.h:265 Yes, we simply keep too many implicit references to ifnets. The real seque= nce=20 for interface destruction should be: =46irst mark unusable, wait long enough[*], remove from global list***s***,= wait=20 long enough[*], free. Note that there is more than one global list an ifnet takes part in. There= is=20 the index2ifp table, there are address lists in inet[6] etc. etc. ... I tri= ed=20 to tackle this once and figured it was a minefield. It is one of the=20 problematic cases where we have *way* more reads than writes(=3Dchanges) an= d=20 nobody cared to introduce locking as we usually don't see the race effects. [*] Unfortunately we don't know what long enough is as we don't do referenc= e=20 counting for ifnets (and we shouldn't as it would be a massive performance= =20 hit). Waiting for as long a possible or at least for "a very long time"=20 would be a good start though. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2667997.84cDmJOyTc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQBEmQ27XyyEoT62BG0RAuSNAJ9T860ecON1YzMxUq0Onqr3WiNSngCePihj u0tmDHLStwNGYK9jZ6MBk28= =Gpfz -----END PGP SIGNATURE----- --nextPart2667997.84cDmJOyTc--