Documentation/preempt-locking.txt states, that
disabled interrupts prevents preemption.
Well, unless process does not touch TIF_NEED_RESCHED.
Consider:
// preempt_count == 0
local_irq_disable();
set_tsk_need_resched(current);
preempt_disable();
preempt_enable();
We fall into the schedule() - possible preemtion,
interruppts ENABLED in any case.
Note that this may be implicit, for example:
__cli();
wake_up(q);
// spin_lock_irqsave(&q->lock, flags)
// __wake_up_common() - sets need_resched
// spin_unlock_irqrestore(q->lock, flags)
// spin_unlock()
// preempt_enable()
// irq_handler: I WAS HERE!!!
// possible preemtion
// local_irq_restore() - too late
Or I am just stupid?
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/