From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 29 17:51:21 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8330E106564A for ; Thu, 29 Jan 2009 17:51:21 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 75FB58FC19 for ; Thu, 29 Jan 2009 17:51:20 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA28367; Thu, 29 Jan 2009 19:51:18 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <4981EC95.1090002@icyb.net.ua> Date: Thu, 29 Jan 2009 19:51:17 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: Rui Paulo References: <49819757.2010002@icyb.net.ua> <8F669786-30A2-458C-8A6B-3272297ADE14@freebsd.org> In-Reply-To: <8F669786-30A2-458C-8A6B-3272297ADE14@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: INTR_FILTER? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2009 17:51:21 -0000 on 29/01/2009 19:17 Rui Paulo said the following: > > On 29 Jan 2009, at 11:47, Andriy Gapon wrote: > >> INTR_FILTER - what does it do? >> It doesn't seem to be documented anywhere, but seems to affect interrupt >> code. > > INTR_FILTER allows you to skip the FILTER+ITHREAD headache. Could you please explain a little bit what is this headache? I thought, similarly to what Ed said, that in filter one could quickly check for a stray interrupt (or shared interrupt from other device) and in ithread one could perform meaningful work. But I also had some doubts about what is legal and what is illegal in ithread. E.g. could I take a non-spin mutex or wait on a condvar? I guess not - because in the case of shared interrupts the same ithread is used to handle everything. > See dev/asmc/asmc.c for an example. Thank you, the example is enlightening. But also one has to look into how "the framework" works (or just know it) to understand why things are done this way but not the other. E.g. why you have to use a taskqueue in non-INTR_FILTER case. BTW, INTR_FILTER seems quite useful. Why, then, it is not the default? -- Andriy Gapon