Software Interrupt Locking Scenario
Locking Between User Context and BHs
user context can be interrupted by a BH, CR could be entered from another CPU
spin_lock_bh(), spin_unlock_bh() /*include/linux/spinlock.h*/
Locking Between User Context and Tasklets/Soft IRQs( same )
Locking Between Bottom Halves
same BH: not reentrant globally
Different BHs: if BH as tasklet, lock it
Locking Between Tasklets
same tasklet: not reentrant globally
Different Tasklets: spin_lock(), spin_unlock(), no need for spin_lock_bh()
Locking Between Softirqs
softirq_active(cpu); spin_lock(), spin_unlock()