Re: Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() at

Linus Torvalds (torvalds@transmeta.com)
Thu, 4 Apr 2002 11:13:19 -0800 (PST)


On Thu, 4 Apr 2002, Dave Hansen wrote:
>
> I've diabled preemption in the area where it used to be disabled because
> of the old lock_kernel(). I'm sending this message from a machine with
> that patch applied, so the patch does fix it.

I think the real fix is to make sure that preemption never hits while
current->state == TASK_ZOMBIE.

In other words, I think the _correct_ fix is to just make
preempt_schedule() check for something like

if (current->state != TASK_RUNNING)
return;

and just getting rid of the current "unconditionally set state to
running".

(Side note: if the state isn't running, we're most likely going to
reschedule in a controlled manner soon anyway. Sure, there are some loops
which set state to non-runnable early for race avoidance, but is it a
_problem_?)

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/