From: "Michael Frank" <mhf@linuxmail.org>
To: "Jesse Pollard" <jesse@cats-chateau.net>,
"Matt Mackall" <mpm@selenic.com>,
"Grover, Andrew" <andrew.grover@intel.com>
Cc: "Helge Hafting" <helgehaf@aitel.hist.no>, linux-kernel@vger.kernel.org
Subject: Re: Why no interrupt priorities?
Date: Sun, 29 Feb 2004 17:43:26 +0800 [thread overview]
Message-ID: <opr34laob64evsfm@smtp.pacific.net.th> (raw)
In-Reply-To: <04022714534500.12104@tabby>
On Fri, 27 Feb 2004 14:53:45 -0600, Jesse Pollard <jesse@cats-chateau.net> wrote:
> On Friday 27 February 2004 13:19, Michael Frank wrote:
>> On Fri, 27 Feb 2004 12:55:55 -0600, Matt Mackall <mpm@selenic.com> wrote:
>> > On Fri, Feb 27, 2004 at 09:44:44AM -0800, Grover, Andrew wrote:
>> >> > From: Helge Hafting [mailto:helgehaf@aitel.hist.no]
>> >> >
>> >> > Grover, Andrew wrote:
>> >> > > Is the assumption that hardirq handlers are superfast also
>> >> >
>> >> > the reason
>> >> >
>> >> > > why Linux calls all handlers on a shared interrupt, even if
>> >> >
>> >> > the first
>> >> >
>> >> > > handler reports it was for its device?
>> >> >
>> >> > No, it is the other way around. hardirq handlers have to be superfast
>> >> > because linux usually _have to_ call all the handlers of a shared irq.
>> >> >
>> >> > The fact that one device did indeed have an interrupt for us
>> >> > doesn't mean
>> >> > that the others didn't. So all of them have to be checked to be safe.
>> >>
>> >> If a device later in the handler chain is also interrupting, then the
>> >> interrupt will immediately trigger again. The irq line will remain
>> >> asserted until nobody is asserting it.
>> >>
>> >> If the LAST guy in the chain is the one with the interrupt, then you
>> >> basically get today's ISR "call each handler" behavior, but it should be
>> >> possible to in some cases to get less time spent in do_IRQ.
>> >
>> > Let's imagine you have n sources simultaneously interrupting on a
>> > given descriptor. Check the first, it's happening, acknowledge it,
>> > exit, notice interrupt still asserted, check the first, nope, check
>> > the second, yep, exit, etc. By the time we've made it to the nth ISR,
>> > we've banged on the first one n times, the second n-1 times, etc. In
>> > other words, early chain termination has an O(n^2) worst case.
>>
>> With level triggered you can just walk the chain, exit at the end of the
>> first cycle and should the IRQ still be asserted you just incur the
>> overhead of exit and reentry of the ISR.
>>
>> Even with edge, I would not check alwasy from the beginning of the chain...
>
> You should... after all that first entry in the chain has the highest priority
>
Please also consider that physcial IRQ's are in practice assigned "semi randomly".
In a way IRQ priorities in general purpose computing applications are irrelevant :)
Lets say you have a bunch of devices demand service, all have to be serviced but
is either not significant which gets done first or the practival IRQ priorities
are "less than optimal":
Keyboard IRQ1 Well buffered
NIC1 IRQ10 Buffered
NIC2 IRQ10 Buffered
USB IRQ11 Buffered
serial port IRQ3 Small FIFO (assuming '550)
serial port IRQ4 "-"
Here, serial ports would would be most critical, however the priorities of IRQ3
and IRQ4 are below priorities of IRQ10 and IRQ11...
IMO, the best practical approach is to keep efficiency by walking the chain only
once. If the chain is longer, it may be worthwhile to check the IRQ and exit
walking the chain if it is inactive.
Priorities in chains would make sense only in specialized applications under
controlled circumstances wrt IRQ and linking devices into chain at the priority
desired.
Regards
Michael
next prev parent reply other threads:[~2004-02-29 9:43 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-27 17:44 Why no interrupt priorities? Grover, Andrew
2004-02-27 18:15 ` Chris Friesen
2004-02-27 18:42 ` Richard B. Johnson
2004-02-27 19:42 ` Michael Frank
2004-02-27 19:11 ` Michael Frank
2004-02-27 18:55 ` Matt Mackall
2004-02-27 19:09 ` Tim Hockin
2004-02-27 20:29 ` Matt Mackall
2004-02-27 19:19 ` Michael Frank
2004-02-27 20:53 ` Jesse Pollard
2004-02-29 9:43 ` Michael Frank [this message]
2004-03-01 16:57 ` Jesse Pollard
2004-03-01 17:35 ` Michael Frank
2004-03-02 15:25 ` Jesse Pollard
-- strict thread matches above, loose matches on Subject: below --
2004-02-27 11:37 Etienne Lorrain
2004-02-27 13:24 ` Michael Frank
[not found] <mailman.1077822002.21081.linux-kernel2news@redhat.com>
2004-02-27 8:00 ` Pete Zaitcev
2004-02-27 1:36 Grover, Andrew
2004-02-27 3:02 ` Randy.Dunlap
2004-02-29 8:32 ` Michael Frank
2004-02-29 8:36 ` Arjan van de Ven
2004-02-29 9:52 ` Michael Frank
2004-02-27 5:32 ` Benjamin Herrenschmidt
2004-02-27 6:26 ` Michael Frank
2004-02-27 6:46 ` Benjamin Herrenschmidt
2004-02-27 9:05 ` Russell King
2004-02-27 13:31 ` Michael Frank
2004-02-27 13:45 ` Richard B. Johnson
2004-02-27 13:50 ` Russell King
2004-02-27 14:51 ` Michael Frank
2004-02-27 7:25 ` Arjan van de Ven
2004-02-27 10:15 ` Helge Hafting
2004-02-27 18:32 ` Mike Fedyk
2004-02-26 23:47 Albert Cahalan
2004-02-26 19:05 Tim Bird
2004-02-26 19:39 ` Richard B. Johnson
2004-02-26 21:02 ` Tim Bird
2004-02-26 21:30 ` Arjan van de Ven
2004-02-26 22:21 ` Mark Gross
2004-02-27 7:14 ` Arjan van de Ven
2004-02-27 11:27 ` Ingo Oeser
2004-02-27 11:52 ` Arjan van de Ven
2004-02-27 13:23 ` Richard B. Johnson
2004-02-27 12:04 ` Christoph Hellwig
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=opr34laob64evsfm@smtp.pacific.net.th \
--to=mhf@linuxmail.org \
--cc=andrew.grover@intel.com \
--cc=helgehaf@aitel.hist.no \
--cc=jesse@cats-chateau.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
/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