From owner-cvs-src@FreeBSD.ORG Sun Jul 3 00:59:31 2005 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 73C5216A7DA; Sun, 3 Jul 2005 00:57:03 +0000 (GMT) (envelope-from ps@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5746D44E71; Sun, 3 Jul 2005 00:36:22 +0000 (GMT) (envelope-from ps@mu.org) Received: by elvis.mu.org (Postfix, from userid 1000) id 4FFE56D085; Sat, 2 Jul 2005 17:36:06 -0700 (PDT) X-Original-To: ps@mu.org Delivered-To: ps@mu.org Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by elvis.mu.org (Postfix) with ESMTP id 8CFB95C9C5 for ; Mon, 27 Dec 2004 19:41:23 -0800 (PST) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 5A18356E82 for ; Tue, 28 Dec 2004 03:41:23 +0000 (GMT) (envelope-from owner-src-committers@FreeBSD.org) Received: by hub.freebsd.org (Postfix) id 698F216A533; Tue, 28 Dec 2004 03:41:18 +0000 (GMT) Delivered-To: ps@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 538) id 9220116A4D0; Tue, 28 Dec 2004 03:41:15 +0000 (GMT) Delivered-To: src-committers@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> 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 Sender: owner-src-committers@FreeBSD.org Precedence: bulk X-Loop: FreeBSD.ORG X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on elvis.mu.org X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Level: Cc: src-committers@freebsd.org, cvs-src@freebsd.org, Alan Cox , cvs-all@freebsd.org, darrenr@freebsd.org, bzeeb-lists@lists.zabbadoz.net, "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.5 List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 03 Jul 2005 00:59:33 -0000 X-Original-Date: Mon, 27 Dec 2004 20:39:44 -0700 X-List-Received-Date: Sun, 03 Jul 2005 00:59:33 -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