Linux kernel-interrupt the lower half

1. The reason why the interrupt processing is divided into two parts

Insert picture description here
The lower half of the implementation mechanism: soft interrupts, tasklets and work queues

2. Soft interrupt mechanism

The interrupt handler (that is, the upper half of the interrupt) before returning, mark its corresponding soft interrupt, and later at the appropriate time, the soft interrupt will be executed

2.1 The realization of soft interrupt
Insert picture description here
2.2 The use of soft interrupt
Insert picture description here
Insert picture description here
Insert picture description here

3. Tasklet mechanism

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

4.ksoftirqd thread

For soft interrupts, the kernel will choose to deal with it at several special occasions. The processing is most common when the interrupt handler returns. The frequency with which soft interrupts are triggered can sometimes be very high (like during a large traffic network communication period). What's worse is that the processing function sometimes triggers repeatedly on its own. In other words, when a soft interrupt is executed, it can re-trigger itself in order to be executed again (in fact, the network subsystem will do this). If the frequency of soft interrupts itself is high, and they have the ability to reset themselves to an executable state, then it will cause the user space process to fail to obtain enough processor time and thus be hungry. Moreover, simply adopting a strategy of not handling the re-triggered soft interrupts immediately is also unacceptable.

solution:
Insert picture description here

Guess you like

Origin blog.csdn.net/chengcheng1024/article/details/114134932