1. Interrupts and exceptions
2. Top and bottom concepts
3. Reentry and sharing of interrupt handlers
4. Interrupt Context
The interrupt context cannot call the sleep function, because the kernel scheduling is scheduled in the unit of process. Once the interrupt handler sleeps, the scheduler schedules other processes to run, it cannot be rescheduled back to this interrupt handler to continue execution
as an interrupt handler When the program is executing, the interrupt line is shielded on all processors to prevent receiving another new same interrupt on the same interrupt line.
But this interrupt handler may be interrupted by other interrupt lines
5. Interrupt handling mechanism
If need_resched (re-schedule is required) is set, and the kernel is returning to user space (that is, the user program is interrupted), then schedule is called; if the kernel is returning to kernel space (that is, the kernel itself is interrupted), then only in preempt_count Schedule is called when it is 0, otherwise it is not safe to preempt the kernel. If there is no suspended work after calling schedule, then the original register is restored, and the kernel is restored to the point where it was interrupted.
6. View the interrupt command
cat /proc/interrupts