Skip to contentSkip to conversation

xenomai preempting interrupt handler ?

Xenomai-core Steven Scholz 2 participants 8 messages Mar 8, 2007

lore
Share & tools
lore
#0 lore raw

Hi all,

using an oscilloscope I found that the AT91RM9200 spends up to 300µs in the interrupt handler for ethernet controller.

Now I wonder if this interrupt handler will be preempted by Xenomai if there is a high priority, periodic real time task? Thus will the duration of the ethernet interrupt handler add the the worst case latency?

Thanks.

Signature · 1 line
Steven
#1 lore raw
Quoted 7 lines · Steven Scholz

Hi all,

using an oscilloscope I found that the AT91RM9200 spends up to 300µs in the interrupt handler for ethernet controller.

Now I wonder if this interrupt handler will be preempted by Xenomai if there is a high priority, periodic real time task?

Hw interrupts are forcibly enabled before entering any Linux IRQ handler, exactely to prevent the issue you described (e.g. fiddling with an IDE controller in PIO mode also gives funky latency results unless the latter is true), so the answer is yes.

Quoted 3 lines

Thus will the duration of the
ethernet interrupt handler add the the worst case latency?

Not from Linux IRQ handlers; you may want to check this using the tracer. If hw interrupts are masked there, then it's a blatant bug.

Quoted 2 lines

Thanks.

Signature · 1 line
Philippe.
#2 lore raw

Philippe,

Quoted 10 lines
Quoted 5 lines

using an oscilloscope I found that the AT91RM9200 spends up to 300µs in the interrupt handler for ethernet controller.

Now I wonder if this interrupt handler will be preempted by Xenomai if there is a high priority, periodic real time task?

Hw interrupts are forcibly enabled before entering any Linux IRQ handler, exactely to prevent the issue you described (e.g. fiddling with an IDE controller in PIO mode also gives funky latency results unless the latter is true), so the answer is yes.

Thanks.

Quoted 5 lines
Quoted 2 lines

Thus will the duration of the
ethernet interrupt handler add the the worst case latency?

Not from Linux IRQ handlers; you may want to check this using the tracer. If hw interrupts are masked there, then it's a blatant bug.

How could I check this using the tracer? Small hint please?

Steven

#3 lore raw
Quoted 14 lines · Steven Scholz

Philippe,

Quoted 10 lines
Quoted 5 lines

using an oscilloscope I found that the AT91RM9200 spends up to 300µs in the interrupt handler for ethernet controller.

Now I wonder if this interrupt handler will be preempted by Xenomai if there is a high priority, periodic real time task?

Hw interrupts are forcibly enabled before entering any Linux IRQ handler, exactely to prevent the issue you described (e.g. fiddling with an IDE controller in PIO mode also gives funky latency results unless the latter is true), so the answer is yes.

Thanks.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Thus will the duration of the
ethernet interrupt handler add the the worst case latency?

Not from Linux IRQ handlers; you may want to check this using the tracer. If hw interrupts are masked there, then it's a blatant bug.

How could I check this using the tracer? Small hint please?

http://www.xenomai.org/index.php/I-pipe:Tracer

Quoted 2 lines

Steven

Signature · 1 line
Philippe.
#4 lore raw
Quoted 14 lines · Philippe Gerum
Quoted 13 lines · Steven Scholz

Philippe,

Quoted 9 lines
Quoted 5 lines

using an oscilloscope I found that the AT91RM9200 spends up to 300µs in the interrupt handler for ethernet controller.

Now I wonder if this interrupt handler will be preempted by Xenomai if there is a high priority, periodic real time task?

Hw interrupts are forcibly enabled before entering any Linux IRQ handler, exactely to prevent the issue you described (e.g. fiddling with an IDE controller in PIO mode also gives funky latency results unless the latter is true), so the answer is yes.

Thanks.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Thus will the duration of the
ethernet interrupt handler add the the worst case latency?

Not from Linux IRQ handlers; you may want to check this using the tracer. If hw interrupts are masked there, then it's a blatant bug.

How could I check this using the tracer? Small hint please?

http://www.xenomai.org/index.php/I-pipe:Tracer

I know this. But I was asking how I could use it to check the above problem.

Is "Trace IRQs-off times CONFIG_IPIPE_TRACE_IRQSOFF ... Instrument each disable and re-enable of hardware IRQs. This allows to identify the longest path in a system with IRQs disabled." the important stuff?

--
Steven

#5 lore raw
Quoted 21 lines · Steven Scholz
Quoted 20 lines · Philippe Gerum
Quoted 18 lines · Steven Scholz

Philippe,

Quoted 9 lines
Quoted 5 lines

using an oscilloscope I found that the AT91RM9200 spends up to 300µs in the interrupt handler for ethernet controller.

Now I wonder if this interrupt handler will be preempted by Xenomai if there is a high priority, periodic real time task?

Hw interrupts are forcibly enabled before entering any Linux IRQ handler, exactely to prevent the issue you described (e.g. fiddling with an IDE controller in PIO mode also gives funky latency results unless the latter is true), so the answer is yes.

Thanks.

Quoted 4 lines
Quoted 2 lines

Thus will the duration of the
ethernet interrupt handler add the the worst case latency?

Not from Linux IRQ handlers; you may want to check this using the tracer. If hw interrupts are masked there, then it's a blatant bug.

How could I check this using the tracer? Small hint please?

Quoted 7 lines
Quoted 1 line

http://www.xenomai.org/index.php/I-pipe:Tracer

I know this. But I was asking how I could use it to check the above problem.

Is "Trace IRQs-off times CONFIG_IPIPE_TRACE_IRQSOFF ... Instrument each disable and re-enable of hardware IRQs. This allows to identify the longest path in a system with IRQs disabled." the important stuff?

Yes. If the "IRQ off" marker appears when running the Linux ethernet IRQ handler, then we have a problem.

Quoted 3 lines

--
Steven

Signature · 1 line
Philippe.
#6 lore raw
In reply to Philippe Gerum

Philippe,

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Thus will the duration of the
ethernet interrupt handler add the the worst case latency?

Not from Linux IRQ handlers; you may want to check this using the tracer. If hw interrupts are masked there, then it's a blatant bug.

How could I check this using the tracer? Small hint please?

http://www.xenomai.org/index.php/I-pipe:Tracer

"Traces can be generated in many ways. One happens automatically when CONFIG_IPIPE_TRACE_IRQSOFF is enabled."

What exactly does that mean? That one trace is generated during boot?

"Another way is to invoke the testsuite, namely latency or irqbench with the option -f to trigger a freeze on each new maximum latency."

What exactly does "trigger a freeze" mean?

Steven

#7 lore raw
Quoted 6 lines · Steven Scholz

Philippe,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Thus will the duration of the
ethernet interrupt handler add the the worst case latency?

Not from Linux IRQ handlers; you may want to check this using the tracer. If hw interrupts are masked there, then it's a blatant bug.

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

How could I check this using the tracer? Small hint please?

http://www.xenomai.org/index.php/I-pipe:Tracer

"Traces can be generated in many ways. One happens automatically when CONFIG_IPIPE_TRACE_IRQSOFF is enabled."

What exactly does that mean? That one trace is generated during boot?

That means that several sources of trace points exist, one of them being controlled by the IRQSOFF switch. MCOUNT cause a trace to be emitted upon each function entry, and so on.

Quoted 5 lines

"Another way is to invoke the testsuite, namely latency or irqbench with the option -f to trigger a freeze on each new maximum latency."

What exactly does "trigger a freeze" mean?

A snapshot of the current trace log, kept from being overwritten in a separate memory upon freeze, that you can access
through /proc/ipipe/trace/frozen.

Quoted 2 lines

Steven

Signature · 1 line
Philippe.