From: kurt.van.dijck@eia.be (Kurt Van Dijck)
To: linux-arm-kernel@lists.infradead.org
Subject: IRQ handler under load - slow response
Date: Thu, 24 Mar 2011 15:45:18 +0100 [thread overview]
Message-ID: <20110324144518.GA27661@e-circ.dyndns.org> (raw)
In-Reply-To: <AANLkTinmQ0seioxSPaj8eqHAwuDpuDSCSmg=BTYHbrkT@mail.gmail.com>
On Thu, Mar 24, 2011 at 12:56:48PM +0100, Arno Steffen wrote:
> 2011/3/14 Kurt Van Dijck <kurt.van.dijck@eia.be>:
> > On Mon, Mar 14, 2011 at 02:26:35PM +0100, Arno Steffen wrote:
> > Euhm, my proposed b) deals in kernel. I think your example is in userspace?
> > Maybe I don't understand your precise setup well.
> >
> > static irqreturn_t GpioIrqHandler (int irq, void *dev_id)
> > {
> > ? ?int s32GpioNumber = 0 ;
> > ? ?s32GpioNumber = irq - IH_GPIO_BASE;
> > ? ?set_bit (s32GpioNumber , (volatile unsigned long *) &gsts32GpioIrqStatus);
> > - ? tasklet_schedule (&GpioTasklet);
> > - ? return IRQ_HANDLED;
> > + ? return IRQ_WAKE_THREAD;
> > }
> >
> > -DECLARE_TASKLET(GpioTasklet, GpioIntrTasklet, 0);
> > static irqreturn_t GpioIrqThread(int irq, void *dev_id)
> > {
> > ? ? ? ?/* do whatever the tasklet was supposed to do */
> > }
> >
>
> Dear Kurt,
> I did as you proposed, but doesn't have the big picture
>
> I think there is a typo in your request_irq change:
> Is this what you mean? What you have suggested is replacing a flag by
> a pointer - this cannot work. I can't see how GpioIrqHandler and
> GpioIrqThread are connected now.
my mistake, I had in mind to replace request_irq with 'requist_threaded_irq'.
sorry for that noise. (I hope you did not loose too much time with that :-) ).
s32Status = request_threaded_irq((IH_GPIO_BASE + s32AppRecvGpioNum),
GpioIrqHandler, GpioIrqThread, 0, "GPIOINTR", NULL);
And then, you can pull your tasklet out of the softirq thread into a seperate
kernel thread (which you can set SCHED_FIFO with sched_setscheduler(2)).
>
> I am not sure this help. The kernel thread might become a higher
> proirity, but what has to be improved is that the IRQ-routine in user
> space is responding faster.
This makes your bottom-halve respond regardless of the other load, due to the
scheduling policy.
This will not yet impact any userspace stuff. Therefore, set the scheduling
policy of you userspace task too.
In fact, the latter (setting scheduling policy of the userspace) is probably
the first step to take. put:
#include <sched.h>
int main(...) {
const struct sched_param sched_param = {
.sched_priority = 50,
};
int ret;
ret = sched_setscheduler(0, SCHED_FIFO, &sched_param);
if (ret < 0)
perror(...);
....
}
into your userspace program.
>
> Does it make sense to send you the hole code? I am afraid that there
> is to much potential for misunderstanding.
This time, it was my wrong info.
I don't feel like digging in code yet, since it comprises very different parts
(kernel & userspace).
> Best regards
> Arno
next prev parent reply other threads:[~2011-03-24 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-09 14:02 IRQ handler under load - slow response Arno Steffen
2011-03-09 15:22 ` Kurt Van Dijck
2011-03-14 13:26 ` Arno Steffen
2011-03-14 14:47 ` Kurt Van Dijck
2011-03-24 11:56 ` Arno Steffen
2011-03-24 14:45 ` Kurt Van Dijck [this message]
2011-03-25 8:46 ` Arno Steffen
2011-03-25 9:53 ` Kurt Van Dijck
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=20110324144518.GA27661@e-circ.dyndns.org \
--to=kurt.van.dijck@eia.be \
--cc=linux-arm-kernel@lists.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;
as well as URLs for NNTP newsgroup(s).