System calls
Review:
Interrupt 只能嵌套两次
Bottomhalf (in linux)
Interrupt handling Philosophy
- Do as little as possible
- Defer non-critical actions till later
Interrupt handlers have no process context - cannot sleep
Top and bottom halves
Top-half: do minimum work and return (ISR)
Do it now!
Bottom-half: deferred processing
Do it later!
Softirqs
Statically allocated
Limited number
Can be executed simultaneously on multiple CPUs
Re-entrant
Do its own locking
Rescheduling
Softirq 的 handler 可能自己去设一个 softirq
Solution: quota + ksoftirqd
Tasklets
Softirq is static: cannot add a new type of softirq
Can be created and destroyed dynamically
Trouble: hard to get right; careful about sleeping
Work queues
Have a process context
Always run by kernel threads