linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, mingo@elte.hu, rostedt@goodmis.org,
	jonathan@jonmasters.org
Subject: Re: [patch 4/4] genirq: add support for threaded interrupt handlers
Date: Fri, 27 Feb 2009 09:05:10 +0100	[thread overview]
Message-ID: <1235721910.4948.1321.camel@laptop> (raw)
In-Reply-To: <20090226234800.4977fca5.akpm@linux-foundation.org>

On Thu, 2009-02-26 at 23:48 -0800, Andrew Morton wrote:

> > > I was actually kinda surprised by the patch - it needs moderate changes
> > > to each driver.  I'd have thought that it would be possible to arrange for
> > > _all_ drivers to have their interrupt handlers automagically called from
> > > process context with no driver changes.
> > > 
> > > Did anyone ever try that?  I think they did...
> > 
> > Yes, current preempt-rt does exactly that, as mentioned in the
> > changelog. That same changelog also mentions why this isn't such a hot
> > idea:
> > 
> > 
> > "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."
> > 
> > 
> > So the idea is that we want people to re-think and change their
> > interrupt routines to take advantage of the benefits of threaded
> > interrupts and avoid the endless context switching between threaded
> > interrupts handler, softirq/tasklet/workqueue contexts, which preempt-rt
> > now has.
> > 
> > The only way to avoid that is by pushing all softirq/tasklet/worklet
> > code into the threaded handler, and the only way to do that is by
> > reworking the drivers.
> > 
> > Since there are too many drivers to count on our few hands, we need an
> > opt-in, so that we can gradually migrate towards this scheme.
> 
> OK, fair enough, good decision.
> 
> What is the plan (if any) for integrating threaded interrupt handlers
> with softirqs?  I guess things will "just work" at present, and
> threaded softirqs happen in a later patch?

Thing is, stuff that now needs softirq could be directly done in the
threaded handler, ergo softirq usage should decline (and hopefully
disappear all together - famous last words).

We only use softirq/workqueues/tasklets because we need a preemptible
environment, which the traditional irq handler didn't provide. With
threaded interrupts we do have that.

> I'd have thought that the softirq latency could get quite a bit worse
> with this proposed threaded-irq patch?

Due to the propagation of wakeups? irq wakes up thread, thread wakes up
softirq, etc?

Yes it would, another good reason to simply use the threaded handler to
do whatever the softirq used to do, no?

> I suppose we could just run the softirq handlers directly after running
> the irq handler, from the IRQ thread.  Rather than having to poke
> softirqd all the time?

One could I suppose, except that softirqs are per-cpu and threaded
interrupts are not, so they don't map that well. We played around with
this on preempt-rt for a while, but it kept on breaking stuff.

Its all a lot more tracktable when you get to change the driver, as you
have more information.

> Thwap me if this was all in whatever-changelog-that-was as well ;)

Hehe, no you got some good points this time around ;-)

> Also...
> 
> Given that this threaded-irq code appears to be new and not very tested
> in -rt, I think it would be a good idea to convert some popular drivers
> (e1000/e1000e) so that the core code gets a good thrashing before we
> merge it.

Right, Thomas did the EHCI usb driver, the network driver you propose is
a tad hard since it relies on the whole network stack softirq stuff.
Re-working the whole net-stack to make use of threaded handlers is a
massive undertaking -- although I seem to remember someone doing it a
few years back and seeing a general performance improvement, Thomas
still got a link to that work?

But yes, it would be prudent to convert a few frequently used driver to
this model before merging I suppose.


  reply	other threads:[~2009-02-27  8:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-26 13:28 [patch 0/4] genirq: add infrastructure for threaded interrupt handlers V2 Thomas Gleixner
2009-02-26 13:28 ` [patch 1/4] genirq: make irqreturn_t an enum Thomas Gleixner
2009-03-25 19:51   ` Geert Uytterhoeven
2009-02-26 13:28 ` [patch 2/4] genirq: use kzalloc instead of explicit zero initialization Thomas Gleixner
2009-02-26 13:28 ` [patch 3/4] genirq: add a quick check handler Thomas Gleixner
2009-02-26 23:03   ` Andrew Morton
2009-02-26 23:11     ` Thomas Gleixner
2009-02-28 22:24   ` Christoph Hellwig
2009-03-01  9:44     ` Thomas Gleixner
2009-03-05 19:59     ` Sven-Thorsten Dietrich
2009-03-17  7:54       ` Christoph Hellwig
2009-03-17 15:29         ` Steven Rostedt
2009-02-26 13:28 ` [patch 4/4] genirq: add support for threaded interrupt handlers Thomas Gleixner
2009-02-26 23:32   ` Andrew Morton
2009-02-27  5:27     ` Arjan van de Ven
2009-02-27  5:45       ` Andrew Morton
2009-02-27  7:18         ` Peter Zijlstra
2009-02-27  7:48           ` Andrew Morton
2009-02-27  8:05             ` Peter Zijlstra [this message]
2009-02-27  8:15               ` Andrew Morton
2009-02-27 15:06               ` Arjan van de Ven
2009-02-27 15:30                 ` Steven Rostedt
2009-02-28 13:46                   ` Stefan Richter
2009-03-02 13:21                     ` Peter Zijlstra
2009-02-28 17:13             ` Andi Kleen
2009-02-27 16:43     ` Thomas Gleixner
2009-02-26 15:26 ` [patch 0/4] genirq: add infrastructure for threaded interrupt handlers V2 Jon Masters
2009-03-05 20:03   ` Sven-Thorsten Dietrich
2009-02-28 22:10 ` Christoph Hellwig
2009-03-01  9:43   ` Thomas Gleixner
2009-03-05  8:40 ` [ANNOUNCE] USB genirq " Sven-Thorsten Dietrich

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=1235721910.4948.1321.camel@laptop \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.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;
as well as URLs for NNTP newsgroup(s).