- 论坛徽章:
- 9
|
回复 1# jinxinxin163
你的深信令我恐惧,出现问题应该去定位查找跟因。
内核代码放在这为什么不去看呢?
spinlock.h:175行
#define spin_lock(lock) _spin_lock(lock)
-->spinlock_api_up.h:051行
#define _spin_lock(lock) __LOCK(lock)
-->spinlock_api_up.h:021行
/*
* In the UP-nondebug case there's no real locking going on, so the
* only thing we have to do is to keep the preempt counts and irq
* flags straight, to supress compiler warnings of unused lock
* variables, and to add the proper checker annotations:
*/
#define __LOCK(lock) \
do { preempt_disable(); __acquire(lock); (void)(lock); } while (0)
你的测试用列问题大得去了,那有加着spinlock返回用户态去的。spinlock是用于保护很小的范围的。
|
|