简介
内核中断的下半部分提供了好几种机制。
- 软中断
- tasklet
- 小任务机制
软中断
内核实现了10种软中断。
Linux-4.9.88/include/linux/interrupt.h
enum
{
HI_SOFTIRQ=0,
TIMER_SOFTIRQ,
NET_TX_SOFTIRQ,
NET_RX_SOFTIRQ,
BLOCK_SOFTIRQ,
IRQ_POLL_SOFTIRQ,
TASKLET_SOFTIRQ,
SCHED_SOFTIRQ,
HRTIMER_SOFTIRQ, /* Unused, but kept as tools rely on the
numbering. Sigh! */
RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
NR_SOFTIRQS
};
tasklet
小任务机制是I/O驱动程序中的实现可延迟函数的首选。