From owner-freebsd-net@FreeBSD.ORG Mon Feb 8 02:10:04 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2229D106566B for ; Mon, 8 Feb 2010 02:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 120068FC13 for ; Mon, 8 Feb 2010 02:10:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o182A3Ca084371 for ; Mon, 8 Feb 2010 02:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o182A30H084370; Mon, 8 Feb 2010 02:10:03 GMT (envelope-from gnats) Date: Mon, 8 Feb 2010 02:10:03 GMT Message-Id: <201002080210.o182A30H084370@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Max Laier Cc: Subject: Re: kern/143622: [pfil] [patch] unlock pfil lock while calling firewall hooks X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Max Laier List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 02:10:04 -0000 The following reply was made to PR kern/143622; it has been noted by GNATS. From: Max Laier To: bug-followup@freebsd.org, gleb.kurtsou@gmail.com Cc: Subject: Re: kern/143622: [pfil] [patch] unlock pfil lock while calling firewall hooks Date: Mon, 8 Feb 2010 02:55:41 +0100 Please no. The rmlock is extremely lightweight (PCPU) in contrast to taking and dropping the reference (atomic ops). In addition, the read lock does not mandate any locking model on the firewall and allows recursion, as well. Furthermore, there are many more locks that might be held from up/down the stack - pfil consumer must not sleep (regardless of the pfil lock) and should avoid recursion as much as possible. Changing the pfil lock will not change that ... nor does does changing any other locks in the stack ... it's just the way it is with a layered design. Regards, Max