public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC patch 0/5] genirq: add infrastructure for threaded interrupt handlers
@ 2008-10-01 23:02 Thomas Gleixner
  2008-10-01 23:02 ` [RFC patch 1/5] genirq: make irqreturn_t an enum Thomas Gleixner
                   ` (9 more replies)
  0 siblings, 10 replies; 49+ messages in thread
From: Thomas Gleixner @ 2008-10-01 23:02 UTC (permalink / raw)
  To: LKML
  Cc: Linus Torvalds, Andrew Morton, Ingo Molnar, Arjan van de Veen,
	Benjamin Herrenschmidt, Steven Rostedt, Jon Masters,
	Sven Dietrich

This patch series implements support for threaded irq handlers for the
generic IRQ layer.

Threaded interrupt handlers are not only interesting in the preempt-rt
context. Threaded interrupt handlers can help to address common
problems in the interrupt handling code:

 - move long running handlers out of the hard interrupt context

 - avoid complex hardirq -> tasklet/softirq interaction and locking
   problems by integration of this functionality into the threaded
   handler code

 - improved debugability of the kernel: faulty handlers do not take
   down the system.

 - allows prioritizing of the handlers which share an interrupt line

The implementation provides an opt-in mechanism to convert drivers to
the threaded interrupt handler model contrary to the preempt-rt patch
where the threaded handlers are enabled by a brute force switch. The
brute force switch is suboptimal as it does not change the interrupt
handler -> tasklet/softirq interaction problems, but was the only way
which was possible for the limited man power of the preempt-rt
developers.

Converting an interrupt to threaded makes only sense when the handler
code takes advantage of it by integrating tasklet/softirq
functionality and simplifying the locking.

When a driver wants to use threaded interrupt handlers it needs to
provide a quick check handler function, which checks whether the
interrupt was originated from the device or not.

In case it was originated from the device the quick check handler must
disable the interrupt at the device level and return
IRQ_WAKE_THREAD. The generic interrupt handling core then sets the
IRQF_RUNTHREAD in the irqaction of the handler and wakes the
associated thread.

The irqaction is referenced in the threads task_struct so handlers can
check for newly arrived interrupts in action flags. Aside of that the
reference is used to prevent further referencing of the thread in the
interrupt code in the case of segfault to make sure that the system
(minus the now dead interrupt handler) survives and debug information
can be retrieved. In the best case the driver can be restarted, but
dont expect that as a given.

I hope to have a real converted driver (aside of the dummy module used
for testing) ready real soon - as far as bugs/regressions stay out of
my way for a while. :)

Comments, reviews, flames as usual.

Thanks,

	tglx


^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2008-10-21 10:29 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-01 23:02 [RFC patch 0/5] genirq: add infrastructure for threaded interrupt handlers Thomas Gleixner
2008-10-01 23:02 ` [RFC patch 1/5] genirq: make irqreturn_t an enum Thomas Gleixner
2008-10-01 23:02 ` [RFC patch 2/5] genirq: add a quick check handler Thomas Gleixner
2008-10-02  0:47   ` Jon Masters
2008-10-02  5:09     ` Steven Rostedt
2008-10-02 10:51       ` Jon Masters
2008-10-02 22:06         ` Greg KH
2008-10-02  4:52   ` Steven Rostedt
2008-10-03  8:29   ` Christoph Hellwig
2008-10-03 10:37     ` Thomas Gleixner
2008-10-01 23:02 ` [RFC patch 3/5] genirq: add threaded interrupt handler support Thomas Gleixner
2008-10-02  5:01   ` Steven Rostedt
2008-10-01 23:02 ` [RFC patch 4/5] genirq: add a helper to check whether the irq thread should run Thomas Gleixner
2008-10-01 23:02 ` [RFC patch 5/5] genirq: make irq threading robust Thomas Gleixner
2008-10-02  0:52   ` Jon Masters
2008-10-02  5:20     ` Steven Rostedt
2008-10-01 23:23 ` [RFC patch 0/5] genirq: add infrastructure for threaded interrupt handlers Andrew Morton
2008-10-01 23:29   ` Arjan van de Ven
2008-10-01 23:40     ` Andrew Morton
2008-10-01 23:58       ` Thomas Gleixner
2008-10-02  0:40 ` Jon Masters
2008-10-02 22:07   ` Greg KH
2008-10-08 22:18     ` Ingo Oeser
2008-10-02  1:53 ` Daniel Walker
2008-10-02 15:02   ` Steven Rostedt
2008-10-02 15:48     ` Daniel Walker
2008-10-02 18:42       ` Thomas Gleixner
2008-10-02 19:04         ` Daniel Walker
2008-10-02 19:23           ` Steven Rostedt
2008-10-02 19:28           ` Ingo Molnar
2008-10-02 20:09             ` Daniel Walker
2008-10-02 20:14               ` Steven Rostedt
2008-10-02 20:48                 ` Daniel Walker
2008-10-02 21:05                   ` Steven Rostedt
2008-10-02 21:30                     ` Daniel Walker
2008-10-02 22:28                       ` Steven Rostedt
2008-10-02 23:24                         ` Daniel Walker
2008-10-03  0:26                           ` Thomas Gleixner
2008-10-03 14:44                             ` Daniel Walker
2008-10-02 14:46 ` Andi Kleen
2008-10-02 21:31   ` Greg KH
2008-10-02 22:33     ` Arjan van de Ven
2008-10-03  3:25       ` Andi Kleen
2008-10-03  3:48         ` Arjan van de Ven
2008-10-03  4:35           ` Andi Kleen
2008-10-03  3:23     ` Andi Kleen
2008-10-21  1:32 ` [RFC patch] genirq threading for ehci, ohci and uhci USB hosts Sven-Thorsten Dietrich
2008-10-21  2:07   ` Jonathan Woithe
2008-10-21 10:29     ` [RFC patch] genirq threading (v2) for ehci, ohci and uhci USB hosts and ohci1394 Sven-Thorsten Dietrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox