Re: [PATCH] BUG(): sched.c: Line 944

Linus Torvalds
2002-09-16T23:40:40Z

On 16 Sep 2002, Robert Love wrote:
>
> Nope. If PREEMPT_ACTIVE is set, schedule() assumes the task is being
> preempted and skips certain logic e.g. deactivate_task() (this is the
> same code that lets us safely preempt a TASK_ZOMBIE).

Ahhah! I know. You just make lock_depth 0 when you exit, without actually
taking the kernel lock. Which fools the logic into accepting a
preempt-disable, since it thinks that the preempt disable is due to
holding the kernel lock.

Add a big comment and you're all done.

Linus