[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1489649707-8021-14-git-send-email-maddy@linux.vnet.ibm.com>
Date: Thu, 16 Mar 2017 13:05:07 +0530
From: Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>
To: mpe@...erman.id.au
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Anju T Sudhakar <anju@...ux.vnet.ibm.com>,
"Gautham R . Shenoy" <ego@...ux.vnet.ibm.com>,
Balbir Singh <bsingharora@...il.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Anton Blanchard <anton@...ba.org>,
Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>,
Michael Neuling <mikey@...ling.org>,
Stewart Smith <stewart@...ux.vnet.ibm.com>,
Daniel Axtens <dja@...ens.net>,
Stephane Eranian <eranian@...gle.com>,
Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>
Subject: [PATCH 13/13] powerpc/perf: Enable/disable core engine during cpuhotplug
From: Anju T Sudhakar <anju@...ux.vnet.ibm.com>
This patch disables the core imc engine when we offline all the cpus available in
a core. Also it enables core imc when any of the cpu in that core comes back.
Enable/disable core imc is done through the opal calls OPAL_CORE_IMC_ENABLE
and OPAL_CORE_IMC_DISABLE respectively.
Cc: Gautham R. Shenoy <ego@...ux.vnet.ibm.com>
Cc: Balbir Singh <bsingharora@...il.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Anton Blanchard <anton@...ba.org>
Cc: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc: Michael Neuling <mikey@...ling.org>
Cc: Stewart Smith <stewart@...ux.vnet.ibm.com>
Cc: Daniel Axtens <dja@...ens.net>
Cc: Stephane Eranian <eranian@...gle.com>
Signed-off-by: Anju T Sudhakar <anju@...ux.vnet.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>
---
arch/powerpc/perf/imc-pmu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index 2ff39fe2a5ce..278c7a427b43 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -127,6 +127,7 @@ static int ppc_core_imc_cpu_online(unsigned int cpu)
/* Else, set the cpu in the mask, and change the context */
cpumask_set_cpu(cpu, &core_imc_cpumask);
+ opal_core_imc_counters_control(OPAL_CORE_IMC_ENABLE, 0, 0, 0);
core_imc_change_cpu_context(-1, cpu);
return 0;
}
@@ -149,8 +150,10 @@ static int ppc_core_imc_cpu_offline(unsigned int cpu)
if (ncpu < nr_cpu_ids) {
target = ncpu;
cpumask_set_cpu(target, &core_imc_cpumask);
- } else
+ } else {
+ opal_core_imc_counters_control(OPAL_CORE_IMC_DISABLE, 0, 0, 0);
target = -1;
+ }
/* migrate the context */
core_imc_change_cpu_context(cpu, target);
--
2.7.4
Powered by blists - more mailing lists