Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > cf93d8a8acdcc6fe2225039da0502495 > files > 1445

kernel-doc-2.6.32-131.17.1.el6.centos.plus.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Chapter&#160;2.&#160;Rationale</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="Linux generic IRQ handling" /><link rel="up" href="index.html" title="Linux generic IRQ handling" /><link rel="prev" href="ch01.html" title="Chapter&#160;1.&#160;Introduction" /><link rel="next" href="ch03.html" title="Chapter&#160;3.&#160;Known Bugs And Assumptions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;2.&#160;Rationale</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch03.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter&#160;2.&#160;Rationale"><div class="titlepage"><div><div><h2 class="title"><a id="rationale"></a>Chapter&#160;2.&#160;Rationale</h2></div></div></div><p>
	The original implementation of interrupt handling in Linux is using
	the __do_IRQ() super-handler, which is able to deal with every
	type of interrupt logic.
	</p><p>
	Originally, Russell King identified different types of handlers to
	build a quite universal set for the ARM interrupt handler
	implementation in Linux 2.5/2.6. He distinguished between:
	</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Level type</p></li><li class="listitem"><p>Edge type</p></li><li class="listitem"><p>Simple type</p></li></ul></div><p>
	In the SMP world of the __do_IRQ() super-handler another type
	was identified:
	</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Per CPU type</p></li></ul></div><p>
	</p><p>
	This split implementation of highlevel IRQ handlers allows us to
	optimize the flow of the interrupt handling for each specific
	interrupt type. This reduces complexity in that particular codepath
	and allows the optimized handling of a given type.
	</p><p>
	The original general IRQ implementation used hw_interrupt_type
	structures and their -&gt;ack(), -&gt;end() [etc.] callbacks to
	differentiate the flow control in the super-handler. This leads to
	a mix of flow logic and lowlevel hardware logic, and it also leads
	to unnecessary code duplication: for example in i386, there is a
	ioapic_level_irq and a ioapic_edge_irq irq-type which share many
	of the lowlevel details but have different flow handling.
	</p><p>
	A more natural abstraction is the clean separation of the
	'irq flow' and the 'chip details'.
	</p><p>
	Analysing a couple of architecture's IRQ subsystem implementations
	reveals that most of them can use a generic set of 'irq flow'
	methods and only need to add the chip level specific code.
	The separation is also valuable for (sub)architectures
	which need specific quirks in the irq flow itself but not in the
	chip-details - and thus provides a more transparent IRQ subsystem
	design.
	</p><p>
	Each interrupt descriptor is assigned its own highlevel flow
	handler, which is normally one of the generic
	implementations. (This highlevel flow handler implementation also
	makes it simple to provide demultiplexing handlers which can be
	found in embedded platforms on various architectures.)
	</p><p>
	The separation makes the generic interrupt handling layer more
	flexible and extensible. For example, an (sub)architecture can
	use a generic irq-flow implementation for 'level type' interrupts
	and add a (sub)architecture specific 'edge type' implementation.
	</p><p>
	To make the transition to the new model easier and prevent the
	breakage of existing implementations, the __do_IRQ() super-handler
	is still available. This leads to a kind of duality for the time
	being. Over time the new model should be used in more and more
	architectures, as it enables smaller and cleaner IRQ subsystems.
	</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a>&#160;</td><td width="20%" align="center">&#160;</td><td width="40%" align="right">&#160;<a accesskey="n" href="ch03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;1.&#160;Introduction&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;3.&#160;Known Bugs And Assumptions</td></tr></table></div></body></html>