]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: enable POWER5 low power mode in idle loop
authorAnton Blanchard <anton@samba.org>
Tue, 14 Sep 2004 00:43:06 +0000 (17:43 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 14 Sep 2004 00:43:06 +0000 (17:43 -0700)
Now that we understand (and have fixed) the problem with using low power mode
in the idle loop, lets enable it.  It should save a fair amount of power.

(The problem was that our exceptions were inheriting the low power mode and so
were executing at a fraction of the normal cpu issue rate.  We fixed it by
always bumping our priority to medium at the start of every exception).

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/kernel/idle.c

index 4d191a28657c9622de08a64ccb433cafea9afe83..616a5bcd464d1726f04e79988120332195e543be 100644 (file)
@@ -142,7 +142,12 @@ int default_idle(void)
 
                        while (!need_resched() && !cpu_is_offline(cpu)) {
                                barrier();
+                               /*
+                                * Go into low thread priority and possibly
+                                * low power mode.
+                                */
                                HMT_low();
+                               HMT_very_low();
                        }
 
                        HMT_medium();
@@ -184,18 +189,18 @@ int dedicated_idle(void)
                        start_snooze = __get_tb() +
                                *smt_snooze_delay * tb_ticks_per_usec;
                        while (!need_resched() && !cpu_is_offline(cpu)) {
-                               /* need_resched could be 1 or 0 at this 
-                                * point.  If it is 0, set it to 0, so
-                                * an IPI/Prod is sent.  If it is 1, keep
-                                * it that way & schedule work.
+                               /*
+                                * Go into low thread priority and possibly
+                                * low power mode.
                                 */
+                               HMT_low();
+                               HMT_very_low();
+
                                if (*smt_snooze_delay == 0 ||
-                                   __get_tb() < start_snooze) {
-                                       HMT_low(); /* Low thread priority */
+                                   __get_tb() < start_snooze)
                                        continue;
-                               }
 
-                               HMT_very_low(); /* Low power mode */
+                               HMT_medium();
 
                                if (!(ppaca->lppaca.xIdle)) {
                                        /* Indicate we are no longer polling for
@@ -210,7 +215,6 @@ int dedicated_idle(void)
                                                break;
                                        }
 
-                                       /* DRENG: Go HMT_medium here ? */
                                        local_irq_disable(); 
 
                                        /* SMT dynamic mode.  Cede will result