Index: kernel/stop_machine.c =================================================================== --- kernel/stop_machine.c (revision 181) +++ kernel/stop_machine.c (working copy) @@ -56,7 +56,7 @@ /* Yield in first stage: migration threads need to * help our sisters onto their CPUs. */ if (!prepared && !irqs_disabled) - yield(); + rt_yield(); else cpu_relax(); } @@ -110,7 +110,7 @@ /* Wait for them all to come to life. */ while (atomic_read(&stopmachine_thread_ack) != stopmachine_num_threads) - yield(); + rt_yield(); /* If some failed, kill them all. */ if (ret < 0) { Index: kernel/sched.c =================================================================== --- kernel/sched.c (revision 181) +++ kernel/sched.c (working copy) @@ -4288,7 +4288,7 @@ * this is a shortcut for kernel-space yielding - it marks the * thread runnable and calls sys_sched_yield(). */ -void __sched yield(void) +static inline void __sched __yield(int rtok) { static int once = 1; @@ -4298,7 +4298,7 @@ * us an idea about the scope of the problem, without spamming * the syslog: */ - if (once && rt_task(current)) { + if (!rtok && once && rt_task(current)) { once = 0; printk(KERN_ERR "BUG: %s:%d RT task yield()-ing!\n", current->comm, current->pid); @@ -4308,7 +4308,18 @@ sys_sched_yield(); } +void __sched yield(void) +{ + __yield(0); +} + +void __sched rt_yield(void) +{ + __yield(1); +} + EXPORT_SYMBOL(yield); +EXPORT_SYMBOL(rt_yield); /* * This task is about to go to sleep on IO. Increment rq->nr_iowait so Index: include/linux/sched.h =================================================================== --- include/linux/sched.h (revision 181) +++ include/linux/sched.h (working copy) @@ -1007,6 +1007,7 @@ extern int mutex_getprio(task_t *p); void yield(void); +void rt_yield(void); /* * The default (Linux) execution domain.