<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
>

  <channel rdf:about="http://lwn.net/headlines/302043/">
    <title>LWN: Comments on "Moving interrupts to threads"</title>
    <link>http://lwn.net/Articles/302043/</link>
    <description>
This is a special feed containing comments posted
to the individual LWN article titled &quot;Moving interrupts to threads&quot;.

    </description>

    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>2</syn:updateFrequency>
    <items>
      <rdf:Seq>
	<rdf:li resource="http://lwn.net/Articles/437717/rss" />
	<rdf:li resource="http://lwn.net/Articles/310998/rss" />
	<rdf:li resource="http://lwn.net/Articles/304350/rss" />
	<rdf:li resource="http://lwn.net/Articles/303386/rss" />
	<rdf:li resource="http://lwn.net/Articles/302716/rss" />
	<rdf:li resource="http://lwn.net/Articles/302580/rss" />
	<rdf:li resource="http://lwn.net/Articles/302574/rss" />
	<rdf:li resource="http://lwn.net/Articles/302563/rss" />
	<rdf:li resource="http://lwn.net/Articles/302553/rss" />
	<rdf:li resource="http://lwn.net/Articles/302548/rss" />
	<rdf:li resource="http://lwn.net/Articles/302518/rss" />
	<rdf:li resource="http://lwn.net/Articles/302491/rss" />
	<rdf:li resource="http://lwn.net/Articles/302445/rss" />
	<rdf:li resource="http://lwn.net/Articles/302363/rss" />
      
      </rdf:Seq>
    </items>

  </channel>
    <item rdf:about="http://lwn.net/Articles/437717/rss">
      <title>Why threaded interrupt handlers are important</title>
      <link>http://lwn.net/Articles/437717/rss</link>
      <dc:date>2011-04-10T15:01:33+00:00</dc:date>
      <dc:creator>abacus</dc:creator>
      <description>
      &lt;font class=&quot;QuotedText&quot;&gt;Don't these threaded interrupt handlers have even more overhead than workqueues? Workqueues are at least handled sequentially in the same thread; using threaded interrupt handlers means there are even more context switches.&lt;/font&gt;
&lt;br/&gt;
&lt;br/&gt;
I'm afraid that you have missed a key point about real-time systems. Design of a hard real-time system starts with deciding which threads in the system will run at real-time priority (SCHED_FIFO or SCHED_RR) and also at which priority (1..99). This step involves all threads in the system, including threaded interrupt handlers. By assigning a higher priority to certain application threads than the threaded interrupt handlers it becomes possible to obtain a system with low and bounded event response time. Handling some of the interrupt work via workqueues instead of threaded interrupt handlers would result in a larger event response time.
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/310998/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/310998/rss</link>
      <dc:date>2008-12-12T00:21:01+00:00</dc:date>
      <dc:creator>shishir</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
&quot;The top half executes with interrupts disabled, so it is imperative that it do as little as possible to keep the system responsive.&quot;&lt;br&gt;
&lt;p&gt;
I somehow am confused about this line. Isn't this true only for the interrupts registered with IRQF_DISABLED/SA_INTERRUPT? Any interrupt registered using IRQF_SHARED/SA_SHIRQ can be interrupted by other interrupts.&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/304350/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/304350/rss</link>
      <dc:date>2008-10-22T22:27:37+00:00</dc:date>
      <dc:creator>HalfMoon</dc:creator>
      <description>
      &lt;p&gt;This will be handy for interrupts issued from I2C and SPI chips, too ... their handlers mostly need to run in task context, since they've got to block while their messages get to the head of the I/O queue and also while waiting for the response.  Example:  IRQ comes in, block until the IRQ status mask comes back from the chip.  (Even when that serial bus was idle when the IRQ came in, the handler must block.)

&lt;p&gt;It's not clear how useful it will be for chained handlers though.  As in, an I2C chip may have a few dozen internal IRQ sources, each of which needs to be dispatched as an IRQ in its own right.  Not only will the top level dispatcher need to be a thread (possibly shared by the handlers for those internal sources) ... but all the irq_chip methods to update IRQ masks and trigger modes for those internal IRQ sources will need to run in threads, too...
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/303386/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/303386/rss</link>
      <dc:date>2008-10-16T14:42:56+00:00</dc:date>
      <dc:creator>neli</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
Don't these threaded interrupt handlers have even more overhead than workqueues? Workqueues are at least handled sequentially in the same thread; using threaded interrupt handlers means there are even more context switches.&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302716/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302716/rss</link>
      <dc:date>2008-10-11T16:34:04+00:00</dc:date>
      <dc:creator>MisterIO</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
I always consider the &quot;'this good code' will lead to bad code&quot; argument a &lt;br&gt;
really bad argument. If you consider &quot;this code&quot; to be good and useful, &lt;br&gt;
then you should merge it. If then someone tries to merge &quot;bad code&quot; which &lt;br&gt;
uses some of the features of the &quot;good code&quot;, just don't merge the &quot;bad &lt;br&gt;
code&quot;.&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302580/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302580/rss</link>
      <dc:date>2008-10-10T14:53:45+00:00</dc:date>
      <dc:creator>jake</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
&lt;font class=&quot;QuotedText&quot;&gt;&amp;gt; I don't quite understand, exactly how does threaded interrupt handlers &lt;/font&gt;&lt;br&gt;
&lt;font class=&quot;QuotedText&quot;&gt;&amp;gt; reduce the time needed to be spent with interrupts disabled? Couldn't a &lt;/font&gt;&lt;br&gt;
&lt;font class=&quot;QuotedText&quot;&gt;&amp;gt; traditional interrupt handler also immediately just ack the interrupt and &lt;/font&gt;&lt;br&gt;
&lt;font class=&quot;QuotedText&quot;&gt;&amp;gt; re-enable interrupts?&lt;/font&gt;&lt;br&gt;
&lt;p&gt;
Sorry I wasn't more clear in the article.  Without threaded interrupts, there is no mechanism for the rest of the work to get done without being explicitly arranged for by the top half (i.e. tasklets or workqueues).  This necessitates locking and synchronization between the two pieces.  Workqueues have a fair amount of overhead and tasklets must still run atomically (i.e. no sleeping, etc.) as well.  &lt;br&gt;
&lt;p&gt;
Threaded interrupts provide the mechanism for additional work to be done outside of the top half, more or less automatically. &lt;br&gt;
&lt;p&gt;
Hopefully I didn't botch this explanation as well :)&lt;br&gt;
&lt;p&gt;
jake&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302574/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302574/rss</link>
      <dc:date>2008-10-10T14:05:54+00:00</dc:date>
      <dc:creator>jlokier</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
That's correct.&lt;br&gt;
&lt;p&gt;
Also threaded interrupts can sleep, take locks and allocate memory as normal threads.&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302563/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302563/rss</link>
      <dc:date>2008-10-10T13:21:37+00:00</dc:date>
      <dc:creator>jzbiciak</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
To distill what you just said:  The existing bottom halves aren't actually full kernel threads, and therefore aren't subject to the other scheduling mechanisms you might use to prioritize handling.&lt;br&gt;
&lt;p&gt;
Did I understand you correctly?&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302553/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302553/rss</link>
      <dc:date>2008-10-10T12:55:42+00:00</dc:date>
      <dc:creator>jlokier</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
I think the main _intended_ difference from the old top/bottom-halves is that threaded interrupts are subject to the normal scheduling heuristics.&lt;br&gt;
&lt;p&gt;
So if you have some device which is dominating the machine, like say a network device flooded with tiny packets at line rate, in the old scheme userspace would effectively lock up, and in the new scheme, the network device's handlers will get their fair share of the CPU according to the scheduler.&lt;br&gt;
&lt;p&gt;
(This is not a great example because many of the popular network drivers have another mechanism to limit their effect already.  But the new scheme is more controlled.)&lt;br&gt;
&lt;p&gt;
It also means you can manage the priority of interrupts using thread priorities (RT and non-RT, and &quot;nice&quot;), task control groups, and other things used to manage threads, and they can be dispatched to under-utilised CPUs more efficiently, and interact with thermal and power management.&lt;br&gt;
&lt;p&gt;
The need to have quick_check_handler separate from the main handler seems to be due to shared interrupt lines.  Without quick_check_handler, multiple devices on the same line would need to share the same handler thread, and interfere with each other.&lt;br&gt;
&lt;p&gt;
It's possible to abuse quick_check_handler and write code in the same form as the old top/bottom halves.  There are probably some latency-sensitive devices where it's essential to do something more than just acknowledging and disabling the device interrupt.  However, that's not the intended way of using it, and if a device is latency sensitive, it should probably use a high RT priority on its handler thread instead.  If the thread scheduler is too slow at this, it may be possible to tune this particular path through the scheduler, taking a short cut from irq to task, but retaining the standard scheduling semantics.&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302548/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302548/rss</link>
      <dc:date>2008-10-10T12:10:06+00:00</dc:date>
      <dc:creator>jzbiciak</dc:creator>
      <description>
      &lt;P&gt;Other than my terse reply (which only answers &quot;why can't I reenable interrupts in my top half?&quot;), I must say, after re-reading the article, I too am not clear on what the difference is here.  The current top half looks similar in principle to the&lt;TT&gt; quick_check_handler &lt;/TT&gt;and the current bottom half looks like the&lt;TT&gt; handler &lt;/TT&gt;thread. 
&lt;/P&gt;&lt;P&gt;
Is it just that even more work is pushed out of the top half into the bottom half via&lt;TT&gt; action &lt;/TT&gt;flags in&lt;TT&gt; struct irqaction&lt;/TT&gt;?  I guess I don't know enough kernel internals to appreciate the significance of this change, or why the current top half/bottom half structure couldn't do the same.  Is this just a cheap event queuing construct that gets around the &quot;can't sleep&quot; aspect of interrupt handler top halves?&lt;/P&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302518/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302518/rss</link>
      <dc:date>2008-10-10T04:53:31+00:00</dc:date>
      <dc:creator>jzbiciak</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
No notion of nested top halves?&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302491/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302491/rss</link>
      <dc:date>2008-10-09T21:46:58+00:00</dc:date>
      <dc:creator>magnus</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
I don't quite understand, exactly how does threaded interrupt handlers reduce the time needed to be spent with interrupts disabled? Couldn't a traditional interrupt handler also immediately just ack the interrupt and re-enable interrupts? &lt;br&gt;
&lt;p&gt;
The only reason I can come up with is that it is an API issue, i e interrupts are re-enabled when the handler returns and the call to schedule the bottom half has to be done inside the handler.. &lt;br&gt;
&lt;p&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302445/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302445/rss</link>
      <dc:date>2008-10-09T15:48:42+00:00</dc:date>
      <dc:creator>jengelh</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
The fun thing here is that you can renice the interrupt threads.&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/302363/rss">
      <title>Moving interrupts to threads</title>
      <link>http://lwn.net/Articles/302363/rss</link>
      <dc:date>2008-10-09T01:32:56+00:00</dc:date>
      <dc:creator>bronson</dc:creator>
      <description>
      &lt;div class=&quot;FormattedComment&quot;&gt;
With each kernel release, there are usually one or two features that illustrate how nice it is to not have to worry about ABI/API stability.&lt;br&gt;
&lt;p&gt;
This sounds like a neat idea and well worth the potential code churn.  I look forward to hearing more news as this develops.&lt;br&gt;
&lt;/div&gt;

      
      </description>
    </item>
</rdf:RDF>

