]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/ppc/kernel/idle.c
[PATCH] sched: disable preempt in idle tasks
[net-next-2.6.git] / arch / ppc / kernel / idle.c
index 11e5b44713f7237e3ec0ecf2b0fc331fff751619..a6141f05c91973348e4dfc7ec6f163bca2863fbd 100644 (file)
@@ -53,10 +53,6 @@ void default_idle(void)
                }
 #endif
        }
-       if (need_resched())
-               schedule();
-       if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
-               cpu_die();
 }
 
 /*
@@ -64,11 +60,22 @@ void default_idle(void)
  */
 void cpu_idle(void)
 {
-       for (;;)
+       int cpu = smp_processor_id();
+
+       for (;;) {
                if (ppc_md.idle != NULL)
                        ppc_md.idle();
                else
                        default_idle();
+               if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
+                       cpu_die();
+               if (need_resched()) {
+                       preempt_enable_no_resched();
+                       schedule();
+                       preempt_disable();
+               }
+
+       }
 }
 
 #if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx)