Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753593Ab0LQKXt (ORCPT ); Fri, 17 Dec 2010 05:23:49 -0500 Received: from www.tglx.de ([62.245.132.106]:50938 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753495Ab0LQKXr (ORCPT ); Fri, 17 Dec 2010 05:23:47 -0500 Date: Fri, 17 Dec 2010 11:23:25 +0100 (CET) From: Thomas Gleixner To: Jan Kiszka cc: Avi Kivity , Marcelo Tosatti , linux-kernel@vger.kernel.org, kvm , Tom Lyon , Alex Williamson , "Michael S. Tsirkin" , Jan Kiszka Subject: Re: [PATCH v3 2/4] genirq: Inform handler about line sharing state In-Reply-To: <4D0B1CD9.5060601@web.de> Message-ID: References: <4D0A75E3.3090900@web.de> <4D0B1CD9.5060601@web.de> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1960 Lines: 45 On Fri, 17 Dec 2010, Jan Kiszka wrote: > Am 16.12.2010 21:26, Jan Kiszka wrote: > > Am 16.12.2010 14:13, Thomas Gleixner wrote: > >> On Mon, 13 Dec 2010, Jan Kiszka wrote: > >>> + if (old_action && (old_action->flags & IRQF_ADAPTIVE) && > >>> + !(desc->irq_data.drv_status & IRQS_SHARED)) { > >>> + /* > >>> + * Signal the old handler that is has to switch to shareable > >>> + * handling mode. Disable the line to avoid any conflict with > >>> + * a real IRQ. > >>> + */ > >>> + disable_irq(irq); > >> > >> This is weird, really. I thought you wanted to avoid waiting for the > >> threaded handler to finish if it's on the fly. So this should be > >> disable_irq_nosync() or did you change your mind ? > > > > No, I did not. I wanted to avoid that we set MAKE_SHAREABLE while there > > might be another IRQ in flight. The handler that is called due to a real > > IRQ might misinterpret MAKE_SHAREABLE as "there is no real event" and > > perform the wrong steps (at least the current implementation for KVM would). > > Actually, the requirement we have to fulfill here is to avoid that the > hardirq handler sees !SHARED while the threaded one reads "SHARED". To > achieve this without disabling the line, I'm still searching for a way > to couple the sharing state of associated hard and threaded handler runs > - but I think there is no reliable association, is there? Unfortunately not. So the only way to solve that is disabling the interrupt which makes sure that all handlers have completed. OTOH, if we have to disable anyway, then we could simply keep it disabled across the installation of a new handler. That would make the notification business go away, wouldn't it ? Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/