[lkml]   [2004]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectscheduler: IRQs disabled over context switches

The 2.6.6 scheduler disables IRQs across context switches, which is
bad news for IRQ latency on ARM - to the point where 16550A FIFO
UARTs to overrun.

I'm considering defining prepare_arch_switch & co as follows on ARM,
so that we release IRQs over the call to context_switch().

#define prepare_arch_switch(rq,next) \
do { \
spin_lock(&(next)->switch_lock); \
spin_unlock_irq(&(rq)->lock); \
} while (0)
#define finish_arch_switch(rq,prev) \
#define task_running(rq,p) \
((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))

The question is... why are we keeping IRQs disabled over context_switch()
in the first case? Looking at the code, the only thing which is touched
outside of the two tasks is rq->prev_mm. Since runqueues are CPU-
specific and we're holding at least one spinlock, I think the above
is preempt safe and SMP safe.

However, I'd like to find out from someone who knows this code why
IRQs are disabled by default here.

Russell King
Linux kernel 2.6 ARM Linux -
maintainer of: 2.6 PCMCIA -
2.6 Serial core
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:03    [W:0.083 / U:3.840 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site