Spinlock 代码及故障模型分析
代码流程 spinlock 上锁的代码流程:
1# include/linux/spinlock.h 2spin_lock 3 raw_spin_lock 4 # ifdef CONFIG_INLINE_SPIN_LOCK 5 # include/linux/spinlock_api_smp.h 6 # else 7 # kernel/locking/spinlock.c 8 _raw_spin_lock 9 # include/linux/spinlock_api_smp.h 10 __raw_spin_lock 11 preempt_disable() 12 spin_acquire(...) 可见,上锁时 spinlock 是 …