public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Alan Cox" <alan@lxorguk.ukuu.org.uk>,
	"David Brownell" <dbrownell@users.sourceforge.net>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Ingo Molnar" <mingo@elte.hu>, "Nicolas Pitre" <nico@marvell.com>,
	"Eric Miao" <eric.y.miao@gmail.com>,
	"John Stultz" <johnstul@us.ibm.com>,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	"Remy Bohmer" <linux@bohmer.net>,
	"Hugh Dickins" <hugh.dickins@tiscali.co.uk>,
	"Andrea Gallo" <andrea.gallo@stericsson.com>,
	"Jamie Lokier" <jamie@shareable.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: Get rid of IRQF_DISABLED - (was [PATCH] genirq: warn about IRQF_SHARED|IRQF_DISABLED)
Date: Mon, 30 Nov 2009 15:03:00 +0100	[thread overview]
Message-ID: <1259589780.26472.18.camel@laptop> (raw)
In-Reply-To: <alpine.LFD.2.00.0911301225110.24119@localhost.localdomain>

On Mon, 2009-11-30 at 14:54 +0100, Thomas Gleixner wrote:
> On Mon, 30 Nov 2009, Uwe Kleine-König wrote:
> > For shared irqs IRQF_DISABLED is only guaranteed for the first handler.
> > So only warn starting at the second registration.
> > 
> > The warning is moved to __setup_irq having the additional benefit of
> > catching actions registered using setup_irq not only register_irq.
> > 
> > This doesn't fix the cases where setup order is wrong but it should
> > report the broken cases more reliably.
> 
> The whole IRQF_DISABLED trickery is questionable and I'm pretty
> unhappy about the warning in general.
> 
> While it is true that there is no guarantee of IRQF_DISABLED on shared
> interrupts (at least not for the secondary handlers) we really need to
> think about the reason why we want to run interrupt handlers with
> interrupts enabled at all.
> 
> The separation of interrupt handlers which run with interrupts
> disabled/enabled goes all the way back to Linux 1.0, which had two
> interrupt handling modes:
> 
> 1) handlers installed with SA_INTERRUPT ran atomically with interrupts
>    disabled.
> 
> 2) handlers installed without SA_INTERRUPT ran with interrupts enabled
>    as they did more complex stuff like signal handling in the kernel.
> 
> The interrupt which was always run with interrupts disabled was the
> timer interrupt because some of the "slower" interrupt handlers were
> relying on jiffies being updated, which is only possible when they run
> with interrupts enabled and no such handler can interrupt the timer
> interrupt.
> 
> In the 2.1.x timeframe the discussion about shared interrupt handlers
> and the treatment of SA_INTERRUPT (today IRQF_DISABLED) was resolved
> by changing the code to what we have right now. If you read back in
> the archives you will find the same arguments as we have seen in this
> thread and a boatload of different solutions to that.
> 
> The real question is why we want to run an interrupt handler with
> interrupts enabled at all. There are two reaons AFAICT:
> 
> 1) interrupt handler relies on jiffies being updated:
> 
>    I don't think that this is the case anymore and if we still have
>    code which does it is probably historic crap which is unused for
>    quite a time.
> 
> 2) interrupt handler runs a long time:
> 
>    I'm sure we still have some of those especially in the
>    archaelogical corners of drivers/* and in the creative space of the
>    embedded "oh, I don't know why but it works" departement. That's
>    code which needs to be fixed anyway.
> 
> The correct solution IMNSHO is to get rid of IRQF_DISABLED and run
> interrupt handlers always with interrupts disabled and require them
> not to reenable interrupts themself.
> 
> Thoughts ?

I'm all for removing that brain damage:

  http://lkml.org/lkml/2009/3/2/33

We should convert the broken hardware PIO and 3com interrupt things to
threaded interrupts, and simply mandate all IRQ handlers run short and
with IRQs disabled.

Except I guess that will upset some of the IRQ priority folks, like
power, where they (iirc) have a stack per irq prio level.

But its not like the core kernel knows about these nesting rules and can
actually track any of that muck.


  reply	other threads:[~2009-11-30 14:03 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20091127195857.GB28193@n2100.arm.linux.org.uk>
2009-11-27 21:10 ` [PATCH] warn about shared irqs requesting IRQF_DISABLED registered with setup_irq Uwe Kleine-König
2009-11-27 22:18   ` Thomas Gleixner
2009-11-28 20:03     ` Uwe Kleine-König
2009-11-28 21:50       ` Thomas Gleixner
2009-11-28 22:13         ` David Brownell
2009-11-29  2:31         ` Jamie Lokier
2009-11-29 10:26           ` Uwe Kleine-König
2009-11-29 15:18             ` Jamie Lokier
2009-11-29 15:27               ` Russell King - ARM Linux
2009-11-30 20:39                 ` Jamie Lokier
2009-11-30  9:28               ` Uwe Kleine-König
2009-11-30  9:54               ` Thomas Gleixner
2009-11-28 22:09       ` David Brownell
2009-11-30 10:47   ` [PATCH] genirq: warn about IRQF_SHARED|IRQF_DISABLED at the right place Uwe Kleine-König
2009-11-30 13:54     ` Get rid of IRQF_DISABLED - (was [PATCH] genirq: warn about IRQF_SHARED|IRQF_DISABLED) Thomas Gleixner
2009-11-30 14:03       ` Peter Zijlstra [this message]
2009-11-30 14:24         ` Thomas Gleixner
2009-11-30 14:47           ` Alan Cox
2009-11-30 15:01             ` Russell King - ARM Linux
2009-11-30 15:32               ` Alan Cox
2009-11-30 15:43                 ` Russell King - ARM Linux
2009-11-30 20:15               ` Andrew Victor
2009-11-30 20:53               ` David Brownell
2009-11-30 20:38             ` David Brownell
2009-12-01  1:42               ` Andy Walls
2009-11-30 19:59           ` Benjamin Herrenschmidt
2009-11-30 21:31             ` Thomas Gleixner
2009-11-30 21:42               ` Benjamin Herrenschmidt
2009-11-30 21:54                 ` Thomas Gleixner
2009-11-30 14:37       ` Russell King - ARM Linux
2009-11-30 14:39         ` Russell King - ARM Linux
2009-11-30 17:48           ` Thomas Gleixner
2009-11-30 14:51         ` Alan Cox
2009-11-30 21:59           ` Thomas Gleixner
2009-11-30 23:30             ` Alan Cox
2009-11-30 15:38         ` Nicolas Pitre
2009-11-30 17:46         ` Thomas Gleixner
2009-11-30 19:51       ` Uwe Kleine-König
2009-11-30 21:23         ` Thomas Gleixner
2009-11-30 20:21     ` [PATCH] genirq: warn about IRQF_SHARED|IRQF_DISABLED at the right place David Brownell
2009-11-30 20:27       ` Uwe Kleine-König
2010-01-12 15:42     ` [RESEND PATCH] " Uwe Kleine-König

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=1259589780.26472.18.camel@laptop \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andrea.gallo@stericsson.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=eric.y.miao@gmail.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=jamie@shareable.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@bohmer.net \
    --cc=mingo@elte.hu \
    --cc=nico@marvell.com \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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