mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@eu.citrix.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"JBeulich@novell.com" <JBeulich@novell.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: RE: [PATCH v2 2/2] x86: don't unmask disabled irqs when migrating them
Date: Fri, 6 May 2011 15:04:57 +0100	[thread overview]
Message-ID: <1304690697.26692.176.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1105061505010.3005@ionos>

On Fri, 2011-05-06 at 14:24 +0100, Thomas Gleixner wrote:
> On Fri, 6 May 2011, Tian, Kevin wrote:
> > > From: Thomas Gleixner
> > > Sent: Friday, May 06, 2011 6:00 PM
> > > 
> > > On Fri, 6 May 2011, Tian, Kevin wrote:
> > > > x86: don't unmask disabled irqs when migrating them
> > > >
> > > > it doesn't make sense to mask/unmask a disabled irq when migrating it
> > > > from offlined cpu to another, because it's not expected to handle any
> > > > instance of it. Current mask/set_affinity/unmask steps may trigger
> > > > unexpected instance on disabled irq which then simply bug on when
> > > > there is no handler for it. One failing example is observed in Xen.
> > > > Xen pvops
> > > 
> > > So there is no handler, why the heck is there an irq action?
> > > 
> > > 	  if (!irq_has_action(irq) ....
> > > 	     	continue;
> > > 
> > > Should have caught an uninitialized interrupt. If Xen abuses interrupts that way,
> > > then it rightfully explodes. And we do not fix it by magic somewhere else.
> > 
> > sorry that my bad description here. there does be a dummy handler registered
> > on such irqs which simply throws out a BUG_ON when hit. I should just say such 
> > injection is not expected instead of no handler. :-)
> 
> So can please someone point me to that particular incarnation of
> nonsense and provide a reasonable explanation for this abuse?
> 
> What is the point of an interrupt, which is permanently disabled, has
> a handler with a BUG() inside and an irqaction assigned ?
> 
> What's the purpose of this? Why is the irqaction there in the first
> place? To be called by some other weird means than by the irq
> handling code?

The Xen PV spinlock code (arch/x86/xen/spinlock.c) allocates an IRQ
(per-cpu lock_kicker_irq). I think it is there purely in order to have
the associated underlying evtchn to use as the thing to poll (Xen has an
evtchn poll hypercall, see xen_poll_irq()) on the slow path and kick on
release. There is never any need to call a handler for that evtchn --
just notifying the evtchn is enough to wake the poller.

The irq is setup using request_irq(). Is there a different API to
register an IRQ without attaching a handler/action to it? (I can't think
why such a thing would exist).

I'm not really sure why these can't just be an evtchn without an
associated IRQ since it doesn't really have any interrupt-like
semantics. Perhaps just a general desire to keep event channels
abstracted into the core Xen event subsystem with IRQs as the public
facing API? Jeremy?

Ian.

> > > The only conditional which is interesting is the unmask path and that's a simple
> > > optimization and not a correctness problem.
> > > 
> > 
> > So what's your suggestion based on my updated information? Is there any
> > interface I may take to differentiate above exception with normal case? Basically
> > in Xen usage we want such irqs permanently disabled at the chip level. Or
> > could we only do mask/unmask for irqs which are unmasked atm if as you said
> > it's just an optimization step? :-)
> 
> No we can make the unmask conditional on !irqd_irq_disabled() because
> that's not violating any of the semantics. The interrupt would be
> masked anyway when it arrives and the handler code sees that it is
> lazy disabled. I mean real handler code, not the Xen abomination.
> 
> The only valid reason why I'd apply that patch is that it avoids a
> potential extra interrupt, but not to prevent screwed up handlers from
> exploding.
> 
> Thanks,
> 
> 	tglx



  reply	other threads:[~2011-05-06 14:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06  6:43 Tian, Kevin
2011-05-06  9:59 ` Thomas Gleixner
2011-05-06 12:54   ` Tian, Kevin
2011-05-06 13:14     ` [Xen-devel] " Tian, Kevin
2011-05-06 13:24     ` Thomas Gleixner
2011-05-06 14:04       ` Ian Campbell [this message]
2011-05-08  1:44         ` Jeremy Fitzhardinge
2011-05-09  0:44           ` Tian, Kevin
2011-05-09  1:45             ` Jeremy Fitzhardinge
2011-05-06 14:28     ` Stefano Stabellini
2011-05-06 21:43       ` Tian, Kevin
2011-05-09  2:11       ` Tian, Kevin
2011-05-09 12:02         ` Stefano Stabellini
2011-05-09 12:36           ` Thomas Gleixner
2011-05-10  3:24             ` Tian, Kevin
2011-05-18 23:49               ` Tian, Kevin
2011-05-19 12:08                 ` Stefano Stabellini
2011-05-19 16:18                   ` [Xen-devel] " Konrad Rzeszutek Wilk
2011-08-29  4:15 ` [regression] Ideapad S10-3 does not wake up from suspend (Re: [PATCH v2 2/2] x86: don't unmask disabled irqs when migrating them) Jonathan Nieder
2011-08-31  1:04   ` Dave Hansen
2011-08-31  8:22     ` Jonathan Nieder
2011-09-02  3:01       ` Serge E. Hallyn
2011-09-01  6:24   ` Tian, Kevin
2012-05-12 23:13     ` [regression] Ideapad S10-3 does not wake up from suspend Jonathan Nieder
2012-05-13  1:22       ` Lars Boegild Thomsen
2012-07-15 23:24         ` Jonathan Nieder
2012-04-15 14:06   ` Jonathan Nieder
2012-04-16 18:05     ` Robert Scott
2012-04-17  2:04       ` Jonathan Nieder
2012-04-18 10:03         ` Lars Boegild Thomsen
2012-04-22 16:34           ` [Xen-devel] " Pasi Kärkkäinen
2012-04-21 13:14         ` Robert Scott
2012-05-06 12:44         ` Robert Scott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304690697.26692.176.camel@zakaz.uk.xensource.com \
    --to=ian.campbell@eu.citrix.com \
    --cc=JBeulich@novell.com \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®