From owner-cvs-src@FreeBSD.ORG Tue Oct 19 22:37:10 2004 Return-Path: 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 9B62116A4CE; Tue, 19 Oct 2004 22:37:10 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6468343D31; Tue, 19 Oct 2004 22:37:10 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id i9JMbsPS008284; Tue, 19 Oct 2004 15:37:54 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id i9JMbs0N008283; Tue, 19 Oct 2004 15:37:54 -0700 Date: Tue, 19 Oct 2004 15:37:54 -0700 From: Brooks Davis To: Robert Watson Message-ID: <20041019223754.GA16741@odin.ac.hmc.edu> References: <41759110.6010005@elischer.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: src-committers@FreeBSD.org cc: Andre Oppermann cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Julian Elischer cc: Sam Leffler cc: Max Laier Subject: Re: cvs commit: src/sys/sys protosw.h src/sys/kern uipc_domain.cuipc_socket2.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 19 Oct 2004 22:37:10 -0000 --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 19, 2004 at 06:19:10PM -0400, Robert Watson wrote: >=20 > On Tue, 19 Oct 2004, Julian Elischer wrote: >=20 > > >>Another point: If you really want to keep the possibility to remove a > > >>protocol, you have to introduce some busy counter that pervents remov= al while > > >>the kernel is inside a protocol function. This has to be handled by t= he > > >>protocol itself, but it has to be taken care of somehow. > >=20 > > each protocol array entry could have either a mutex or a refcount or > > both..=20 >=20 > The trick here is to get just enough synchronization to not break, but not > enough to hurt. That's one of the reasons why I feel like the heavier > weight approaches taken elsewhere may not be appropriate here. I guess no > one is talking about loading UDP, but at the same time if we're going to > have generic loadable protocol support, it would be nice to get a pretty > clean API that would meet the requirements of higher volume protocols. As > I mentioned in a previous e-mail, it might almost be desirable to say "no > unloading" and simply avoid the hard problems, since atomic add is easy > whereas atomic remove is hard. One of the things I've been looking at with interfaces is trying to squash the really big races (mostly dummynet) by avoiding holding a pointer to an interface any longer then necessicary. Instead I'm planning to hold interface indexes instead. I'm planning to introduce a "struct ifnet dead_if" to return when the index is no longer valid. It will attempt to have sane no-op values so when the big races are lost it doesn't matter. At least with interface removals, the small races don't seem to actually happen much in practice so ignoring them may well be a better solution then requiring a refcount every time you need to touch an ifp. Once I get ipfw6 working, I'm planning to take a look at this some more. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --YZ5djTAD1cGYuMQK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBdZdCXY6L6fI4GtQRAtrfAJ4xmwfExMtbgdEVcN9Z9j9avj0AQwCfaltj XdWOky32tRp2d6i12ArYYLQ= =r6tn -----END PGP SIGNATURE----- --YZ5djTAD1cGYuMQK--