Date: Mon, 21 Mar 2005 09:01:05 -0500 From: John Baldwin <jhb@FreeBSD.org> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: rwatson@FreeBSD.org Subject: Re: Giant-free polling [PATCH] Message-ID: <200503210901.05833.jhb@FreeBSD.org> In-Reply-To: <20050311142805.GB88801@cell.sick.ru> References: <20050311110234.GA87255@cell.sick.ru> <20050311141450.GF9291@darkness.comp.waw.pl> <20050311142805.GB88801@cell.sick.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503210901.05833.jhb>