Messages in this thread Patch in this message | | | Date | Mon, 24 May 2004 11:15:04 +0200 | From | Ingo Molnar <> | Subject | Re: scheduler: IRQs disabled over context switches |
| |
* Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> >+# define prepare_arch_switch(rq, next) \ > >+ do { \ > >+ spin_lock(&(next)->switch_lock); \ > >+ spin_unlock(&(rq)->lock); \ > > spin_unlock_irq?
and spin_unlock in the finish_arch_switch() case, instead of spin_unlock_irq. New patch below.
Ingo
--- linux/kernel/sched.c.orig +++ linux/kernel/sched.c @@ -247,9 +247,15 @@ static DEFINE_PER_CPU(struct runqueue, r * Default context-switch locking: */ #ifndef prepare_arch_switch -# define prepare_arch_switch(rq, next) do { } while (0) -# define finish_arch_switch(rq, next) spin_unlock_irq(&(rq)->lock) -# define task_running(rq, p) ((rq)->curr == (p)) +# 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) \ + spin_unlock(&(prev)->switch_lock) +# define task_running(rq, p) \ + ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock)) #endif /* - 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/
| |