[SPARC64]: Add tick_nohz_{stop,restart}_sched_tick() calls to cpu_idle().
authorDavid S. Miller <davem@sunset.davemloft.net>
Thu, 22 Feb 2007 14:24:45 +0000 (06:24 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 08:54:13 +0000 (01:54 -0700)
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/process.c

index b291060c25a642daf5d369a9a77cb594abf0903f..a114151f9fbe586547f4f7e9a78c9ef1e7092bd0 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/reboot.h>
 #include <linux/delay.h>
 #include <linux/compat.h>
+#include <linux/tick.h>
 #include <linux/init.h>
 
 #include <asm/oplib.h>
@@ -88,12 +89,14 @@ void cpu_idle(void)
        set_thread_flag(TIF_POLLING_NRFLAG);
 
        while(1) {
-               if (need_resched()) {
-                       preempt_enable_no_resched();
-                       schedule();
-                       preempt_disable();
-               }
-               sparc64_yield();
+               tick_nohz_stop_sched_tick();
+               while (!need_resched())
+                       sparc64_yield();
+               tick_nohz_restart_sched_tick();
+
+               preempt_enable_no_resched();
+               schedule();
+               preempt_disable();
        }
 }