lkml.org 
[lkml]   [2002]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectQ: preemptible kernel and interrupts consistency.
Hello.

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/

\
 
 \ /
  Last update: 2005-03-22 13:27    [W:0.041 / U:0.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site