From: Thomas Gleixner <tglx@linutronix.de>
To: Jaccon Bastiaansen <jaccon.bastiaansen@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-rt-users <linux-rt-users@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: Threaded interrupt handling question in RT kernel
Date: Tue, 16 Aug 2011 17:31:50 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1108161729130.2807@ionos> (raw)
In-Reply-To: <CAGzjT4eGV-KLFNuE2F8ehYCEdi7DT8wo_tYbkUQHPxjuArHc2Q@mail.gmail.com>
On Tue, 16 Aug 2011, Jaccon Bastiaansen wrote:
> Hello Thomas, Peter
>
> We have a question about threaded interrupt handling:
>
> By default, when using threaded interrupt handlers, the IRQ is
> disabled in hard IRQ context and enabled again after all threaded
> interrupt handlers connected to that IRQ have run. In this way, high
> priority interrupt handlers can be delayed until the lowest priority
> interrupt handler thread has run. Therefore it seems that it's not
> useful to have a separate thread for each interrupt handler (what's
> the use of being able to set interrupt handler thread priorities when
> you still have to wait for the one with the lowest priority).
That's correct, but RT just makes use of the general facility which is
designed to have a separate thread for each device.
> So we think that we should use the request_threaded_irq() function.
You can do that for a specific driver, but we cannot do that in RT for
every driver in the kernel.
> The task of the handler that is executed in hard IRQ context is to
> check whether the device that it controls is generating an interrupt
> and if it does, deactivate the IRQ output of the device and wakeup the
> interrupt handler thread by returning IRQ_WAKE_THREAD. By deactivating
> the IRQ output, another device connected to the same IRQ can activate
> the IRQ again before the interrupt handler thread of the first device
> has run. This guarantees that a high priority threaded interrupt
> handler of a device on a shared IRQ can run before a low priority
> threaded interrupt handler of a device on the same IRQ has run. So
> when using threaded interrupt handlers for devices on a shared IRQ,
> make sure that all drivers have used request_threaded_irq().
> Otherwise, high priority threaded interrupt handlers can be delayed by
> low priority threaded interrupt handlers.
>
> Is all this correct or do we miss something?
That's how it's designed to work.
Thanks,
tglx
prev parent reply other threads:[~2011-08-16 15:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-16 14:28 Threaded interrupt handling question in RT kernel Jaccon Bastiaansen
2011-08-16 15:31 ` Thomas Gleixner [this message]
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=alpine.LFD.2.02.1108161729130.2807@ionos \
--to=tglx@linutronix.de \
--cc=jaccon.bastiaansen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=peterz@infradead.org \
/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