Re: Q: preemptible kernel and interrupts consistency.

From: Oleg Nesterov (oleg@tv-sign.ru)
Date: Thu Jul 11 2002 - 16:19:09 EST


Hello.

Robert Love wrote:
> However, the only places that set need_resched like that are the
> scheduler and they do so also under lock so we are safe.

Safe? Look, if process does not hold any spinlock and interrupts
disabled, then any distant implicit call to resched_task() silently
enables irqs. At least, this must be documented.

> Also, in your example, being in an interrupt handler bumps the
> preempt_count so even the scenario you give will not cause a
> preemption. If we did not bump the unlock, then your example would give
> a lot of "scheduling in interrupt" BUGs so we would know it ;-)

No, I meant process context in both scenarios! Note also, that it
happens even in UP case.

> All that said, there is a bug: the send_reschedule IPI can set
> need_resched on another CPU. If the other CPU happens to have
> interrupts disabled, we can in fact preempt.

I can't see, how this can happen. Can you explain?
But it seems unrelated...

Oleg.
-
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/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:20 EST