Understanding the Linux Kernel Framework--Interrupt Nesting

The linux2.4.0 kernel interrupts nested processing, and the possibility analysis is as follows:

1. The same interrupt line: Can it be nested, depending on whether the ack sends a shielded interrupt line signal to the hardware?
Nestable interrupts:
Scenario: [cpu0 A process i ii] [cpu1 B process], execute i first and then execute ii. If there is iii, the same is true.
The two interrupts (i and ii) are assigned to the same core cpu0 by the interrupt controller for processing. At this time, the stack space used is both A's
i and ii interrupt nested processing uses edge-triggered mode, that is, i is processed in the interruptable environment handle_IRQ_event and does not return , ii interrupts to enter the do_IRQ process, and finds that i is not completed at this time (simple understanding), and returns immediately without handle_IRQ_event processing, and the same is true for multiple nesting. When returning to i interrupt processing, it is judged whether the current interrupt line has pending, because the pending person ii in this scenario, in order to ensure that all interrupts have the opportunity to be processed, it will trigger traversal processing again, and ii can be processed.

Scenario: [cpu0 A process i] [cpu1 B process ii]
The two interrupts (i and ii) are respectively allocated by the interrupt controller to cpu0 cpu1 for processing. At this time, each uses the stack space of the hit process, and there is no interrupt nesting at this time.

Non-nested interrupt:
When entering do_IRQ, ack shields the interrupt line, so that interrupts on the same interrupt line cannot be nested.
Scenario: [cpu0 A process i ii] [cpu1 B process]
strictly serialized processing
Scenario : [cpu0 A process i] [cpu1 B process ii]
processing equivalent to nestable interrupt scenarios: [cpu0 A process i] [ cpu1 B process ii]

2. Mixed interrupt lines: Different interrupt lines can be interrupted and nested.
If the same line can be nested:
Scenario: [cpu0 A process i ii iii] [cpu1 B process], where: i ii iii are on the same line.
i interrupt first, then ii interrupt nesting, i and iii interrupt nesting,
iii can edge-trigger the processing of the local cpu0 ii (returned directly without processing).
Scenario: [cpu0 A process i ii iii] [cpu1 B process iiii], where: i ii iiii are on the same line.
i interrupt first, then ii interrupt nesting, i and iii interrupt nesting,
iiii can edge-trigger the processing of the opposite end cpu0 ii (returned directly without processing).

If the same line cannot be nested:
Scenario: [cpu0 A process i ii iii] [cpu1 B process iiii], where: i iii iiii same line
i first interrupt, then ii interrupt nesting, ii and iii interrupt nesting, and finally interrupt.
iiii can edge-trigger the processing of iii (returned directly without processing).
It doesn't matter if the edge triggers the interrupt of the local cpu

linux2.4.0 vs linux2.6.37 (in fact, it is basically the same as above 2.6)
1>, the latter only allows nested interrupts of different lines, when an interrupt from the same interrupt line is detected, it will send ack to shield the interrupt line, the former If it is the same interrupt line or different interrupt lines, interrupt nesting is allowed. Leads to the problem: If there is a 256 interrupt number, for the latter, the extreme case will be interrupted and nested 255 times, while the former will be infinite.
2>, the former interrupt processing occupies the stack space of the hit process, the latter has a stack environment switching action during interrupt processing, and has an independent interrupt stack. Problem: Stack overflow occurs in the former when there are many interrupts.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324606375&siteId=291194637