From owner-freebsd-net@FreeBSD.ORG Mon Mar 21 14:17:58 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6876916A4D1 for ; Mon, 21 Mar 2005 14:17:58 +0000 (GMT) Received: from mail21.sea5.speakeasy.net (mail21.sea5.speakeasy.net [69.17.117.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id C209943D39 for ; Mon, 21 Mar 2005 14:17:57 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 22611 invoked from network); 21 Mar 2005 14:17:57 -0000 Received: from server.baldwin.cx ([216.27.160.63]) (envelope-sender )AES256-SHA encrypted SMTP for ; 21 Mar 2005 14:17:57 -0000 Received: from slimer.baldwin.cx (slimer.baldwin.cx [192.168.0.16]) (authenticated bits=0) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id j2LEHTnO045762; Mon, 21 Mar 2005 09:17:48 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Gleb Smirnoff Date: Mon, 21 Mar 2005 09:01:05 -0500 User-Agent: KMail/1.6.2 References: <20050311110234.GA87255@cell.sick.ru> <20050311141450.GF9291@darkness.comp.waw.pl> <20050311142805.GB88801@cell.sick.ru> In-Reply-To: <20050311142805.GB88801@cell.sick.ru> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <200503210901.05833.jhb@FreeBSD.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx cc: dima <_pppp@mail.ru> cc: Pawel Jakub Dawidek cc: Luigi Rizzo cc: ru@FreeBSD.org cc: net@FreeBSD.org cc: rwatson@FreeBSD.org Subject: Re: Giant-free polling [PATCH] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2005 14:17:58 -0000 On Friday 11 March 2005 09:28 am, Gleb Smirnoff wrote: > On Fri, Mar 11, 2005 at 03:14:50PM +0100, Pawel Jakub Dawidek wrote: > P> On Fri, Mar 11, 2005 at 04:55:25PM +0300, dima wrote: > P> +> I thought about using list also, but considered it to bring > P> +> too much overhead to the code. The original idea of handling arrays > P> +> seems to be very elegant. > P> > P> Overhead? Did you run any benchmarks to prove it? > P> I find list-version much more elegant that using an array. > > It is also a small cookie for future. Now we have IFF_POLLING flag and > IFCAP_POLLING, which indicate whether interface support polling and whether > it actually does polling. This is not nice, from my viewpoint. I'd like > to see only IFCAP_POLLING present and turning polling on/off for particular > interface should be done by inserting/removing iface from polling list. > > This will also remove an extra unlocked check of interface flags (?). > > P> I also don't like the idea of calling handler method with two locks > P> held (one sx and one mutex)... > > I agree with Pawel. We have LOR here between sx lock and driver lock: > > normal polling: (get sx shared) -> (get driver mutex) > driver stop: (get driver mutex) -> (get sx exclusive) You can't ever lock an sx(9) lock while holding a mutex. FYI. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org