From owner-cvs-src@FreeBSD.ORG Tue Dec 28 03:41:13 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 B845716A4CE; Tue, 28 Dec 2004 03:41:13 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2EBE343D4C; Tue, 28 Dec 2004 03:41:13 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from [192.168.254.11] (junior-wifi.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id iBS3heaC010817; Mon, 27 Dec 2004 20:43:40 -0700 (MST) (envelope-from scottl@freebsd.org) Message-ID: <41D0D580.7090207@freebsd.org> Date: Mon, 27 Dec 2004 20:39:44 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040929 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Darren Reed References: <20041226165927.GA18879@hub.freebsd.org> <20041226182537.GB20920@hub.freebsd.org> <20041226.222435.52824948.imp@bsdimp.com> <20041227054931.GC20920@hub.freebsd.org> <20041227204846.GC15591@noel.cs.rice.edu> <20041228031707.GA38011@hub.freebsd.org> In-Reply-To: <20041228031707.GA38011@hub.freebsd.org> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: src-committers@freebsd.org cc: cvs-src@freebsd.org cc: Alan Cox cc: cvs-all@freebsd.org cc: darrenr@freebsd.org cc: bzeeb-lists@lists.zabbadoz.net cc: "M. Warner Losh" Subject: Re: cvs commit: src/sys/contrib/ipfilter/netinet ip_auth.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, 28 Dec 2004 03:41:14 -0000 Darren Reed wrote: > On Mon, Dec 27, 2004 at 02:48:46PM -0600, Alan Cox wrote: > >>Darren, >> >>Based upon a quick look at the above URL, I would say that the problem >>is that you are acquiring an sx lock after a mutex is held. > > > Yes, that is what I thought the problem was too. > > >>That is not allowed. > > > Well, it should be. > > >>More generally, an sx lock is termed a "sleepable" lock >>and a mutex is not; all desired sleepable locks must be acquired >>before any non-sleepable locks are acquired. Witness enforces this >>prohibition, but perhaps causes confusion by calling it a reversal. > > > What can I say that I haven't already ? > This is a nonsense rule and I'm quite happy that it isn't enforced at > all. The assumption by someone that all of these scenarios lead to > deadlocks is false. > > I imagine it is part of why things like the IFNET_*LOCK macros use mtx > rather than sx. On systems where the interface list is of non-trivial > size, I imagine this would have a measurable impact. > > Perhaps the most stupid realisation from this has been that IPFilter > code gets called with a UDP mutex of some sort held. Like WTF ? > > Darren The locking APIs have existed in FreeBSD 5.x for 4 years. They are documented in manual pages, web pages, and publically available USENIX papers. Just because you don't agree that sx locks should be sleepable doesn't mean that your opinion is valid. Also, there is already another network filter package that is locked, locked correctly, and performs well. You are not treading into new waters here. We can debate the observation that you hold that there is a UDP lock held, but calling it outright stupid doesn't help your case. Scott