On 2019-07-04 13:50:08 [+0800], xiaoqiang.zhao wrote: > > > > 2) -> __schedule_bug ( leads to kernel pagefault exception, OOPS!!) > > > > > > Before schedule, we have call preempt_disable twice, this will definitely > > > bump preempt_count to 2 and > > > > something probably disabled preemption before that > > I feel this is not make sense. In my opinion, the preempt_count must be > zero before we call 'schedule()', that is correct. I was saying that the preempt count was > 0 before wake_up() was invoked. > otherwise, in_atomic_preempt_off will return true and trigger the > __schedule_bug. If we have already > > disable_preempt, we may in atomic context and we should not call schedule, > right ? correct. Sebastian