aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreeti U Murthy <preeti@linux.vnet.ibm.com>2014-04-10 09:15:12 +0530
committerEli Qiao <taget@linux.vnet.ibm.com>2014-04-10 12:28:26 +0800
commitcf05d568d7b8bda30561d86976df73c16c17b42a (patch)
tree14524923f6ed2f8fc6ecc60cd16d1fadd72725c4
parentfe93cac67c196c1cb7501a1ccbf18e12d1f50861 (diff)
downloadpowerkvm-cf05d568d7b8bda30561d86976df73c16c17b42a.tar.gz
kvm: Set the runlatch bits correctly for offline cpus
Up until now we have been setting the runlatch bits for a busy CPU and clearing it when a CPU enters idle state. The runlatch bit has thus been consistent with the utilization of a CPU as long as the CPU is online. However when a CPU is hotplugged out the runlatch bit is not cleared. It needs to be cleared to indicate an unused CPU. OCC consumes the runlatch bit to decide the utilization of a thread and ends up seeing the offline threads as busy. Hence this patch has the runlatch bit cleared for an offline CPU just before entering an idle state and sets it immediately after it exits the idle state. Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Acked-by: Paul Mackerras <paulus@samba.org> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-rw-r--r--arch/powerpc/platforms/powernv/smp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 90be045cf02f02..d2592d8914f5ee 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -30,6 +30,7 @@
#include <asm/cputhreads.h>
#include <asm/xics.h>
#include <asm/opal.h>
+#include <asm/runlatch.h>
#include "powernv.h"
@@ -172,7 +173,9 @@ static void pnv_smp_cpu_kill_self(void)
*/
mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1);
while (!generic_check_cpu_restart(cpu)) {
+ ppc64_runlatch_off();
power7_nap();
+ ppc64_runlatch_on();
if (!cpu_core_split_required()) {
if (generic_check_cpu_restart(cpu))