"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" ]
沒有留言:
張貼留言