diff -urN oldtree/include/linux/sched.h newtree/include/linux/sched.h --- oldtree/include/linux/sched.h 2006-09-29 14:03:22.000000000 -0400 +++ newtree/include/linux/sched.h 2006-09-29 14:08:46.000000000 -0400 @@ -508,6 +508,9 @@ #define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH) #define has_rt_policy(p) unlikely(is_rt_policy((p)->policy)) +/* Must be high prio: stop_machine expects to yield to it. */ +#define MIGRATION_THREAD_PRIO (MAX_RT_PRIO-20) + /* * Some day this will be a full-fledged user tracking system.. */ diff -urN oldtree/include/linux/stop_machine.h newtree/include/linux/stop_machine.h --- oldtree/include/linux/stop_machine.h 2006-09-29 13:50:42.000000000 -0400 +++ newtree/include/linux/stop_machine.h 2006-09-29 14:08:46.000000000 -0400 @@ -8,6 +8,9 @@ #include #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) + +#define STOP_MACHINE_PRIO (MAX_RT_PRIO-20) + /** * stop_machine_run: freeze the machine on all CPUs and run this function * @fn: the function to run diff -urN oldtree/kernel/sched.c newtree/kernel/sched.c --- oldtree/kernel/sched.c 2006-09-29 14:08:38.000000000 -0400 +++ newtree/kernel/sched.c 2006-09-29 14:08:46.000000000 -0400 @@ -5206,9 +5206,8 @@ return NOTIFY_BAD; p->flags |= PF_NOFREEZE; kthread_bind(p, cpu); - /* Must be high prio: stop_machine expects to yield to it. */ rq = task_rq_lock(p, &flags); - __setscheduler(p, SCHED_FIFO, MAX_RT_PRIO-1); + __setscheduler(p, SCHED_FIFO, MIGRATION_THREAD_PRIO); task_rq_unlock(rq, &flags); cpu_rq(cpu)->migration_thread = p; break; diff -urN oldtree/kernel/stop_machine.c newtree/kernel/stop_machine.c --- oldtree/kernel/stop_machine.c 2006-09-29 14:03:22.000000000 -0400 +++ newtree/kernel/stop_machine.c 2006-09-29 14:08:46.000000000 -0400 @@ -89,7 +89,7 @@ static int stop_machine(void) { int i, ret = 0; - struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; + struct sched_param param = { .sched_priority = STOP_MACHINE_PRIO }; /* One high-prio thread per cpu. We'll do this one. */ sched_setscheduler(current, SCHED_FIFO, ¶m);