* Priorities of IRQ handlers
@ 2007-11-26 15:31 John Sigler
2007-11-27 16:26 ` Steven Rostedt
0 siblings, 1 reply; 7+ messages in thread
From: John Sigler @ 2007-11-26 15:31 UTC (permalink / raw)
To: linux-rt-users
Hello everyone,
I'm running 2.6.22.1-rt9 on x86.
CONFIG_PREEMPT_RT=y
CONFIG_PREEMPT=y
CONFIG_PREEMPT_SOFTIRQS=y
CONFIG_PREEMPT_HARDIRQS=y
CONFIG_PREEMPT_BKL=y
# CONFIG_CLASSIC_RCU is not set
CONFIG_PREEMPT_RCU=y
I need to change the priorities of several soft and hard IRQ handlers.
Namely,
o reduce the prio of "softirq-timer" handler to 10
o reduce the prio of IRQ14 and IRQ15 handlers to 20
(my flash drives do not support DMA BTW...)
o boost the prio of my I/O boards' IRQ handlers to 60
(there can be 1 or 2 boards, the driver is a kernel module
which is loaded after the system has booted.)
I've written a short program that calls
sched_setscheduler(pid, SCHED_FIFO, ¶m);
with the appropriate pid, which I look up using ps -ef
I need to automate the process of tweaking priorities.
Can someone offer advice and / or pointers?
Regards.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Priorities of IRQ handlers
2007-11-26 15:31 Priorities of IRQ handlers John Sigler
@ 2007-11-27 16:26 ` Steven Rostedt
2007-11-28 11:05 ` John Sigler
0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2007-11-27 16:26 UTC (permalink / raw)
To: John Sigler; +Cc: linux-rt-users
On Mon, 26 Nov 2007, John Sigler wrote:
> I need to change the priorities of several soft and hard IRQ handlers.
>
> Namely,
>
> o reduce the prio of "softirq-timer" handler to 10
>
> o reduce the prio of IRQ14 and IRQ15 handlers to 20
> (my flash drives do not support DMA BTW...)
>
> o boost the prio of my I/O boards' IRQ handlers to 60
> (there can be 1 or 2 boards, the driver is a kernel module
> which is loaded after the system has booted.)
>
> I've written a short program that calls
> sched_setscheduler(pid, SCHED_FIFO, ¶m);
> with the appropriate pid, which I look up using ps -ef
Look for the program "chrt". It does this for you. This program is
avaliable in all major distrobutions of Linux.
>
> I need to automate the process of tweaking priorities.
>
> Can someone offer advice and / or pointers?
Perhaps look at one of the Start up scripts, and add the chrt command
there.
-- Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Priorities of IRQ handlers
2007-11-27 16:26 ` Steven Rostedt
@ 2007-11-28 11:05 ` John Sigler
2007-11-28 14:12 ` K.R. Foley
2007-11-30 11:26 ` Dominique Michel
0 siblings, 2 replies; 7+ messages in thread
From: John Sigler @ 2007-11-28 11:05 UTC (permalink / raw)
To: Steven Rostedt; +Cc: linux-rt-users
Hello Steven,
Steven Rostedt wrote:
> John Sigler wrote:
>
>> I need to change the priorities of several soft and hard IRQ handlers.
>>
>> Namely,
>>
>> o reduce the prio of "softirq-timer" handler to 10
>>
>> o reduce the prio of IRQ14 and IRQ15 handlers to 20
>> (my flash drives do not support DMA BTW...)
>>
>> o boost the prio of my I/O boards' IRQ handlers to 60
>> (there can be 1 or 2 boards, the driver is a kernel module
>> which is loaded after the system has booted.)
>>
>> I've written a short program that calls
>> sched_setscheduler(pid, SCHED_FIFO, ¶m);
>> with the appropriate pid, which I look up using ps -ef
>
> Look for the program "chrt". It does this for you. This program is
> available in all major distributions of Linux.
Thanks for the tip.
For the record, I found schedutils on Robert Love's page:
http://rlove.org/
http://rlove.org/misc/schedutils-1.5.0.tar.gz
However, I had already solved that part of the problem with a
program of my own.
My real problem is: the IRQ handlers for the I/O boards are
only instantiated when the kernel module is inserted. How do
I /reliably/ determine their pid?
e.g. on one system, the IRQ handler for my I/O board is IRQ5
with pid 745. On another system, it's IRQ20 with pid 808.
On a third system they're IRQ20 and IRQ21 with pid 239 and 240.
The only solution I see is to examine /proc/interrupts to find the
IRQ handler(s) then ps to lookup their pid, but that feels like a
dirty hack.
These interrupt handlers are all spawned by kthreadd. I thought
there would be some way to ask kthreadd to tweak the priorities.
>> I need to automate the process of tweaking priorities.
>>
>> Can someone offer advice and / or pointers?
>
> Perhaps look at one of the startup scripts, and add the chrt
> command there.
Which startup scripts?
Regards.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Priorities of IRQ handlers
2007-11-28 11:05 ` John Sigler
@ 2007-11-28 14:12 ` K.R. Foley
2007-11-28 15:02 ` Arnaldo Carvalho de Melo
2007-11-28 21:38 ` Sven-Thorsten Dietrich
2007-11-30 11:26 ` Dominique Michel
1 sibling, 2 replies; 7+ messages in thread
From: K.R. Foley @ 2007-11-28 14:12 UTC (permalink / raw)
To: John Sigler; +Cc: Steven Rostedt, linux-rt-users
John Sigler wrote:
> Hello Steven,
>
> Steven Rostedt wrote:
>
>> John Sigler wrote:
>>
>>> I need to change the priorities of several soft and hard IRQ handlers.
>>>
>>> Namely,
>>>
>>> o reduce the prio of "softirq-timer" handler to 10
>>>
>>> o reduce the prio of IRQ14 and IRQ15 handlers to 20
>>> (my flash drives do not support DMA BTW...)
>>>
>>> o boost the prio of my I/O boards' IRQ handlers to 60
>>> (there can be 1 or 2 boards, the driver is a kernel module
>>> which is loaded after the system has booted.)
>>>
>>> I've written a short program that calls
>>> sched_setscheduler(pid, SCHED_FIFO, ¶m);
>>> with the appropriate pid, which I look up using ps -ef
>>
>> Look for the program "chrt". It does this for you. This program is
>> available in all major distributions of Linux.
>
> Thanks for the tip.
>
> For the record, I found schedutils on Robert Love's page:
>
> http://rlove.org/
> http://rlove.org/misc/schedutils-1.5.0.tar.gz
>
> However, I had already solved that part of the problem with a
> program of my own.
>
> My real problem is: the IRQ handlers for the I/O boards are
> only instantiated when the kernel module is inserted. How do
> I /reliably/ determine their pid?
What about something like:
chrt -f -p 99 `/sbin/pidof 'IRQ 8'`
>
> e.g. on one system, the IRQ handler for my I/O board is IRQ5
> with pid 745. On another system, it's IRQ20 with pid 808.
> On a third system they're IRQ20 and IRQ21 with pid 239 and 240.
>
> The only solution I see is to examine /proc/interrupts to find the
> IRQ handler(s) then ps to lookup their pid, but that feels like a
> dirty hack.
>
> These interrupt handlers are all spawned by kthreadd. I thought
> there would be some way to ask kthreadd to tweak the priorities.
I have created patches to do this in the past. However, because you are
setting different threads to different priorities it probably makes more
sense to do this from user space. Much more flexible.
>
>>> I need to automate the process of tweaking priorities.
>>>
>>> Can someone offer advice and / or pointers?
>>
>> Perhaps look at one of the startup scripts, and add the chrt
>> command there.
>
> Which startup scripts?
>
> Regards.
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-rt-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
kr
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Priorities of IRQ handlers
2007-11-28 14:12 ` K.R. Foley
@ 2007-11-28 15:02 ` Arnaldo Carvalho de Melo
2007-11-28 21:38 ` Sven-Thorsten Dietrich
1 sibling, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2007-11-28 15:02 UTC (permalink / raw)
To: K.R. Foley; +Cc: John Sigler, Steven Rostedt, linux-rt-users
Em Wed, Nov 28, 2007 at 08:12:24AM -0600, K.R. Foley escreveu:
> John Sigler wrote:
> > Hello Steven,
> >
> > Steven Rostedt wrote:
> >
> >> John Sigler wrote:
> >>
> >>> I need to change the priorities of several soft and hard IRQ handlers.
> >>>
> >>> Namely,
> >>>
> >>> o reduce the prio of "softirq-timer" handler to 10
> >>>
> >>> o reduce the prio of IRQ14 and IRQ15 handlers to 20
> >>> (my flash drives do not support DMA BTW...)
> >>>
> >>> o boost the prio of my I/O boards' IRQ handlers to 60
> >>> (there can be 1 or 2 boards, the driver is a kernel module
> >>> which is loaded after the system has booted.)
> >>>
> >>> I've written a short program that calls
> >>> sched_setscheduler(pid, SCHED_FIFO, ¶m);
> >>> with the appropriate pid, which I look up using ps -ef
> >>
> >> Look for the program "chrt". It does this for you. This program is
> >> available in all major distributions of Linux.
> >
> > Thanks for the tip.
> >
> > For the record, I found schedutils on Robert Love's page:
> >
> > http://rlove.org/
> > http://rlove.org/misc/schedutils-1.5.0.tar.gz
> >
> > However, I had already solved that part of the problem with a
> > program of my own.
> >
> > My real problem is: the IRQ handlers for the I/O boards are
> > only instantiated when the kernel module is inserted. How do
> > I /reliably/ determine their pid?
>
> What about something like:
> chrt -f -p 99 `/sbin/pidof 'IRQ 8'`
If he knows that IRQ 8 is associated with his device, that is ok,
but how to map device -> IRQ in the first place?
> >
> > e.g. on one system, the IRQ handler for my I/O board is IRQ5
> > with pid 745. On another system, it's IRQ20 with pid 808.
> > On a third system they're IRQ20 and IRQ21 with pid 239 and 240.
See?
Perhaps he could use a kernel command line where he would tell that
for the string used in request_irq the kthread priority should be N.
IIRC there was somebody trying to write a patch to support this at some
point in this list...
- Arnaldo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Priorities of IRQ handlers
2007-11-28 14:12 ` K.R. Foley
2007-11-28 15:02 ` Arnaldo Carvalho de Melo
@ 2007-11-28 21:38 ` Sven-Thorsten Dietrich
1 sibling, 0 replies; 7+ messages in thread
From: Sven-Thorsten Dietrich @ 2007-11-28 21:38 UTC (permalink / raw)
To: K.R. Foley; +Cc: John Sigler, Steven Rostedt, linux-rt-users
On Wed, 2007-11-28 at 08:12 -0600, K.R. Foley wrote:
> John Sigler wrote:
> > Hello Steven,
> >
> > Steven Rostedt wrote:
> >
> >> John Sigler wrote:
> >>
> >>> I need to change the priorities of several soft and hard IRQ handlers.
> >>>
> >>> Namely,
> >>>
> >>> o reduce the prio of "softirq-timer" handler to 10
> >>>
> >>> o reduce the prio of IRQ14 and IRQ15 handlers to 20
> >>> (my flash drives do not support DMA BTW...)
> >>>
> >>> o boost the prio of my I/O boards' IRQ handlers to 60
> >>> (there can be 1 or 2 boards, the driver is a kernel module
> >>> which is loaded after the system has booted.)
> >>>
> >>> I've written a short program that calls
> >>> sched_setscheduler(pid, SCHED_FIFO, ¶m);
> >>> with the appropriate pid, which I look up using ps -ef
> >>
> >> Look for the program "chrt". It does this for you. This program is
> >> available in all major distributions of Linux.
> >
> > Thanks for the tip.
> >
> > For the record, I found schedutils on Robert Love's page:
> >
> > http://rlove.org/
> > http://rlove.org/misc/schedutils-1.5.0.tar.gz
> >
> > However, I had already solved that part of the problem with a
> > program of my own.
> >
> > My real problem is: the IRQ handlers for the I/O boards are
> > only instantiated when the kernel module is inserted. How do
> > I /reliably/ determine their pid?
>
> What about something like:
> chrt -f -p 99 `/sbin/pidof 'IRQ 8'`
>
> >
Keep in mind that if you are on a shared IRQ line, you will be boosting
the priority of other interrupts as well.
Sven
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Priorities of IRQ handlers
2007-11-28 11:05 ` John Sigler
2007-11-28 14:12 ` K.R. Foley
@ 2007-11-30 11:26 ` Dominique Michel
1 sibling, 0 replies; 7+ messages in thread
From: Dominique Michel @ 2007-11-30 11:26 UTC (permalink / raw)
To: John Sigler; +Cc: linux-rt-users
Le Wed, 28 Nov 2007 12:05:26 +0100,
John Sigler <linux.kernel@free.fr> a écrit :
> > Perhaps look at one of the startup scripts, and add the chrt
> > command there.
>
> Which startup scripts?
You can look at the rtirq package: http://www.rncbc.org/jack/
Most of (all?) the multimedia linux distribution include it.
Cheers,
Dominique
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-11-30 11:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-26 15:31 Priorities of IRQ handlers John Sigler
2007-11-27 16:26 ` Steven Rostedt
2007-11-28 11:05 ` John Sigler
2007-11-28 14:12 ` K.R. Foley
2007-11-28 15:02 ` Arnaldo Carvalho de Melo
2007-11-28 21:38 ` Sven-Thorsten Dietrich
2007-11-30 11:26 ` Dominique Michel
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).