Priorities of IRQ handlers
Hello everyone,
I'm running 2.6.22.1-rt9 on x86.
CONFIG_PREEMPT_RT=yCONFIG_PREEMPT=yCONFIG_PREEMPT_SOFTIRQS=yCONFIG_PREEMPT_HARDIRQS=yCONFIG_PREEMPT_BKL=y
# CONFIG_CLASSIC_RCU is not setCONFIG_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.
Quoted 9 lines · John Sigler
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...)
Quoted 7 lines
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.
Quoted 4 lines
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
Hello Steven,
Quoted 15 lines · Steven Rostedt
Quoted 13 lines · John Sigler
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.)
Quoted 6 lines
Quoted 3 lines
I've written a short program that calls
sched_setscheduler(pid, SCHED_FIFO, ¶m);
with the appropriate pid, which I look up using ps -efLook 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.
Quoted 6 lines
Quoted 3 lines
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.
Quoted 33 lines · John Sigler
Hello Steven,
Quoted 15 lines · Steven Rostedt
Quoted 13 lines · John Sigler
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.)
Quoted 6 lines
Quoted 3 lines
I've written a short program that calls
sched_setscheduler(pid, SCHED_FIFO, ¶m);
with the appropriate pid, which I look up using ps -efLook 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
Quoted 6 lines
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'
Quoted 11 lines
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/interruptsto 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.
Quoted 17 lines
Quoted 7 lines
Quoted 4 lines
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
kr
Em Wed, Nov 28, 2007 at 08:12:24AM -0600, K.R. Foley escreveu:
Quoted 37 lines
Quoted 36 lines · John Sigler
Hello Steven,
Quoted 15 lines · Steven Rostedt
Quoted 13 lines · John Sigler
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.)
Quoted 6 lines
Quoted 3 lines
I've written a short program that calls
sched_setscheduler(pid, SCHED_FIFO, ¶m);
with the appropriate pid, which I look up using ps -efLook 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.gzHowever, I had already solved that part of the problem with a program of my own.
Quoted 6 lines
Quoted 3 lines
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?
Quoted 4 lines
Quoted 4 lines
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
Quoted 37 lines · K.R. Foley
Quoted 36 lines · John Sigler
Hello Steven,
Quoted 15 lines · Steven Rostedt
Quoted 13 lines · John Sigler
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.)
Quoted 6 lines
Quoted 3 lines
I've written a short program that calls
sched_setscheduler(pid, SCHED_FIFO, ¶m);
with the appropriate pid, which I look up using ps -efLook 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.gzHowever, I had already solved that part of the problem with a program of my own.
Quoted 8 lines
Quoted 3 lines
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'Quoted 1 line
Keep in mind that if you are on a shared IRQ line, you will be boosting the priority of other interrupts as well.
Sven
Quoted 4 lines · John Sigler
Quoted 2 lines
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