About interrupt handler
hi all,
I'm begin to learn the Kernel and i'm reading <<Linux kernel development>>.It says "This is an important point, always keep in mind that all interrupt handler has interrupted other code(possibly even another interrupt handler on a different line)".What i am not able to understand is how a interrupt handler be interrupted ? DID NOT it uninterrupted?
------------------
best regards?
cheneydeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120222/13ec67b2/attachment.html
Hi cheneydeng,
2012/2/22 cheneydeng <[email protected]>:
Quoted 6 lines
hi all,
? ? ?I'm begin to learn the Kernel and i'm reading <<Linux kernel development>>.It says "This is an important point, always keep in mind that all interrupt handler has interrupted other code(possibly even another interrupt handler on a different line)".What i am not able to understand is how a interrupt handler be interrupted ? DID NOT it uninterrupted?
It depends on the architecture and the interrupt controller being used, and the driver code itself.
Normally, when an interrupt fires, that particular interrupt will be masked and your own handler won't interrupt itself, but you may very well be interrupted by other interrupts.
It is possible to arrange things so that your interrupt handler interrupts itself, although you need to be really careful when doing this as if your interrupt fires too quickly things can escalate out of control pretty quickly.
Signature · 3 lines
Dave Hylands Shuswap, BC, Canada http://www.davehylands.com
Quoted 6 lines
Quoted 5 lines
I'm begin to learn the Kernel and i'm reading <<Linux kernel development>>.It says "This is an important point, always keep in mind that all interrupt handler has interrupted other code(possibly even another interrupt handler on a different line)".What i am not able to understand is how a interrupt handler be interrupted ? DID NOT it uninterrupted?
Quoted 6 lines
It depends on the architecture and the interrupt controller being used, and the driver code itself.
Normally, when an interrupt fires, that particular interrupt will be masked and your own handler won't interrupt itself, but you may very well be interrupted by other interrupts.
Can you please point out some code for explanation? --- KostaZ
Hi Kosta,
Quoted 6 lines · Kosta Zertsekel
Quoted 6 lines
Quoted 5 lines
I'm begin to learn the Kernel and i'm reading <<Linux kernel development>>.It says "This is an important point, always keep in mind that all interrupt handler has interrupted other code(possibly even another interrupt handler on a different line)".What i am not able to understand is how a interrupt handler be interrupted ? DID NOT it uninterrupted?
Quoted 8 lines
Quoted 6 lines
It depends on the architecture and the interrupt controller being used, and the driver code itself.
Normally, when an interrupt fires, that particular interrupt will be masked and your own handler won't interrupt itself, but you may very well be interrupted by other interrupts.
Can you please point out some code for explanation?
Could you be a bit more specific about what example you're looking for?
Signature · 3 lines
Dave Hylands Shuswap, BC, Canada http://www.davehylands.com
HI Kosta,
Quoted 12 lines · Dave Hylands
Hi Kosta,
Quoted 9 lines · Kosta Zertsekel
Quoted 9 lines
Quoted 5 lines
I'm begin to learn the Kernel and i'm reading <<Linux kernel development>>.It says "This is an important point, always keep in mind that all interrupt handler has interrupted other code(possibly even another interrupt handler on a different line)".What i am not able to understand is how a interrupt handler be interrupted ? DID NOT it uninterrupted?
It depends on the architecture and the interrupt controller being used, and the driver code itself.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Normally, when an interrupt fires, that particular interrupt will be masked and your own handler won't interrupt itself, but you may very well be interrupted by other interrupts.
Can you please point out some code for explanation?
Could you be a bit more specific about what example you're looking for?
I also believe that things have changed (since I looked at this in any detail). It seems that interrupts are now run with other interrupts disabled.
See: http://lwn.net/Articles/364583/ and look at the IRQF_DISABLED discussion.
Signature · 3 lines
Dave Hylands Shuswap, BC, Canada http://www.davehylands.com
Quoted 19 lines · Dave Hylands
HI Kosta,
Quoted 16 lines · Dave Hylands
Hi Kosta,
Quoted 13 lines · Kosta Zertsekel
Quoted 12 lines
Quoted 5 lines
I'm begin to learn the Kernel and i'm reading <<Linux kernel development>>.It says "This is an important point, always keep in mind that all interrupt handler has interrupted other code(possibly even another interrupt handler on a different line)".What i am not able to understand is how a interrupt handler be interrupted ? DID NOT it uninterrupted?
It depends on the architecture and the interrupt controller being used, and the driver code itself.
Normally, when an interrupt fires, that particular interrupt will be masked and your own handler won't interrupt itself, but you may very well be interrupted by other interrupts.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Can you please point out some code for explanation?
Could you be a bit more specific about what example you're looking for?
I also believe that things have changed (since I looked at this in any detail). It seems that interrupts are now run with other interrupts disabled.
See: http://lwn.net/Articles/364583/ and look at theIRQF_DISABLEDdiscussion.
Oh, yes, it seems it does as of kernel 3.3.0. But I fail to accept the argument...
What happens for NAPI drivers stalling the kernel - *nobody* can interrupt them...
Is there some reliable IRQ deep dive explanation - I need one just to wrap my mind over the issue?
Thanks,
--- KostaZ
Hi Kosta,
Quoted 29 lines · Kosta Zertsekel
Quoted 19 lines · Dave Hylands
HI Kosta,
Quoted 16 lines · Dave Hylands
Hi Kosta,
Quoted 13 lines · Kosta Zertsekel
Quoted 12 lines
Quoted 5 lines
I'm begin to learn the Kernel and i'm reading <<Linux kernel development>>.It says "This is an important point, always keep in mind that all interrupt handler has interrupted other code(possibly even another interrupt handler on a different line)".What i am not able to understand is how a interrupt handler be interrupted ? DID NOT it uninterrupted?
It depends on the architecture and the interrupt controller being used, and the driver code itself.
Normally, when an interrupt fires, that particular interrupt will be masked and your own handler won't interrupt itself, but you may very well be interrupted by other interrupts.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Can you please point out some code for explanation?
Could you be a bit more specific about what example you're looking for?
I also believe that things have changed (since I looked at this in any detail). It seems that interrupts are now run with other interrupts disabled.
See: http://lwn.net/Articles/364583/ and look at theIRQF_DISABLEDdiscussion.
Quoted 6 lines
Oh, yes, it seems it does as of kernel 3.3.0. But I fail to accept the argument...
What happens for NAPI drivers stalling the kernel - *nobody* can interrupt them...
Is there some reliable IRQ deep dive explanation - I need one just to wrap my mind over the issue?
Well the kernel has the ability to use threaded irqs. This allows IRQs to be given a proirity so you can allow one interrupt to interrupt another or to even allow threads to interrupt interrupts.
http://lwn.net/Articles/302043/
http://www.artist-embedded.org/docs/Events/2009/OSPERT/OSPERT09-Henriques.pdf
http://elinux.org/images/e/ef/InterruptThreads-Slides_Anderson.pdf
Signature · 3 lines
Dave Hylands Shuswap, BC, Canada http://www.davehylands.com