[POWERPC] Use H_CEDE on non-SMT
authorJake Moilanen <moilanen@austin.ibm.com>
Tue, 25 Jul 2006 20:11:47 +0000 (15:11 -0500)
committerPaul Mackerras <paulus@samba.org>
Mon, 31 Jul 2006 04:35:21 +0000 (14:35 +1000)
On the JS21 systems, they have the SPLPAR hypertas set, but are not SMT
capable.  So, they are not making the H_CEDE call.  This is causing the
hypervisor to have to queue up work for the hdecr, taking an excessive
amount of time in maintenance code, and causing jitter on the box.

Making the H_CEDE call helps alleviate that problem.

Signed-off-by: Jake Moilanen <moilanen@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/pseries/setup.c

index 54a52437265c50ecb5d0038a3c070c67d1945a9c..71c634e0b87cdc1cbe30df395837a1b090815e84 100644 (file)
@@ -501,7 +501,8 @@ static void pseries_dedicated_idle_sleep(void)
        }
 
        /*
-        * Cede if the other thread is not idle, so that it can
+        * If not SMT, cede processor.  If CPU is running SMT
+        * cede if the other thread is not idle, so that it can
         * go single-threaded.  If the other thread is idle,
         * we ask the hypervisor if it has pending work it
         * wants to do and cede if it does.  Otherwise we keep
@@ -514,7 +515,8 @@ static void pseries_dedicated_idle_sleep(void)
         * very low priority.  The cede enables interrupts, which
         * doesn't matter here.
         */
-       if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
+       if (!cpu_has_feature(CPU_FTR_SMT) || !lppaca[cpu ^ 1].idle
+           || poll_pending() == H_PENDING)
                cede_processor();
 
 out: