2010年12月21日 星期二

BUG: scheduling while atomic

"Scheduling while atomic" means that a thread has called schedule() during an operation which is supposed to be atomic (ie uninterrupted).


printk(KERN_ERR "BUG: scheduling while atomic: %s/%d/0x%08x\n",  prev->comm, prev->pid, preempt_count());

ex.
spin_lock_irqsave(&sysLock, flags);
msleep(100);

spin_lock_irqsave -> preempt_disable -> inc_preempt_count [current_thread_info()->preempt_count = 1 ]
msleep -> schedule -> preempt_disable -> inc_preempt_count [current_thread_info()->preempt_count = 2 ]
msleep -> schedule -> schedule_debug -> in_atomic_preempt_off
[ in_atomic_preempt_off checks if (preempt_count != 1) then printk "BUG: scheduling while atomic" ]

沒有留言:

張貼留言

kgdb

--0313-- ken 不好意思 请教一下 之前你有交过我 在没有coredump的情况下 可以用gdb直接载入ko.debug, 然后dis -l register_bcache, 我记得使用方式是不是这样, 不过我现在dis -l出现错误^^" [root@...