Interrupt handler
会复用当前被中断task
的kernel stack
,它并不是一个真正的task
,也不拥有task_struct
。因此一旦被调度出去,就无法再被调度回来继续执行。所以interrupt handler
不允许被抢占。
参考资料:
Why can’t you sleep in an interrupt handler in the Linux kernel? Is this true of all OS kernels?;
Why kernel code/thread executing in interrupt context cannot sleep?;
Are there any difference between “kernel preemption” and “interrupt”?;
Why can not processes switch in atomic context?。