powerpc/perf: IMC pmu cpumask and cpuhotplug support
Subsystems (2)
PATCH v10 5/10 powerpc/perf: IMC pmu cpumask and cpuhotplug support
From: Anju T Sudhakar <[email protected]>
Adds cpumask attribute to be used by each IMC pmu. Only one cpu (any online CPU) from each chip for nest PMUs is designated to read counters.
On CPU hotplug, dying CPU is checked to see whether it is one of the designated cpus, if yes, next online cpu from the same chip (for nest units) is designated as new cpu to read counters. For this purpose, we introduce a new state : CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE.
Signed-off-by Anju T Sudhakar <[email protected]>
Signed-off-by Hemant Kumar <[email protected]>
Signed-off-by Madhavan Srinivasan <[email protected]>
--- arch/powerpc/include/asm/opal-api.h | 14 +- arch/powerpc/include/asm/opal.h | 4 + arch/powerpc/perf/imc-pmu.c | 211 ++++++++++++++++++++++++- arch/powerpc/platforms/powernv/opal-wrappers.S | 3 + include/linux/cpuhotplug.h | 1 + 5 files changed, 229 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/opal-api.h +11 -3
@@ -190,7 +190,10 @@#define OPAL_NPU_INIT_CONTEXT 146#define OPAL_NPU_DESTROY_CONTEXT 147#define OPAL_NPU_MAP_LPAR 148 -#define OPAL_LAST 148 +#define OPAL_IMC_COUNTERS_INIT 149 +#define OPAL_IMC_COUNTERS_START 150 +#define OPAL_IMC_COUNTERS_STOP 151 +#define OPAL_LAST 151/* Device tree flags */
@@ -1005,8 +1008,13 @@ enum {/* In-Memory Collection Counters Type */ enum { -IMC_COUNTER_PER_CHIP =0x10 , -IMC_COUNTER_PER_SOCKET =0x20 , +IMC_COUNTER_PER_CHIP =0x10 , +IMC_COUNTER_PER_SOCKET =0x20 , +}; + +/* Argument to OPAL_IMC_COUNTERS_* */ +enum { +OPAL_IMC_COUNTERS_NEST =1 , };#endif /* __ASSEMBLY__ */
arch/powerpc/include/asm/opal.h +4 -0
@@ -268,6 +268,10 @@ int64_t opal_xive_free_irq(uint32_t girq);int64_t opal_xive_sync (uint32_t type,uint32_t id);int64_t opal_xive_dump (uint32_t type,uint32_t id); +int64_t opal_imc_counters_init (uint32_t type,uint64_t address,uint64_t cpu); +int64_t opal_imc_counters_start (uint32_t type); +int64_t opal_imc_counters_stop (uint32_t type); +/* Internal functions */ extern int early_init_dt_scan_opal (unsigned long node,const char *uname,int depth,void *data);
arch/powerpc/perf/imc-pmu.c +210 -1
249 lines not on this page · raw message
arch/powerpc/platforms/powernv/opal-wrappers.S +3 -0
@@ -310,3 +310,6 @@ OPAL_CALL(opal_xive_dump, OPAL_XIVE_DUMP); OPAL_CALL(opal_npu_init_context, OPAL_NPU_INIT_CONTEXT); OPAL_CALL(opal_npu_destroy_context, OPAL_NPU_DESTROY_CONTEXT); OPAL_CALL(opal_npu_map_lpar, OPAL_NPU_MAP_LPAR); +OPAL_CALL(opal_imc_counters_init, OPAL_IMC_COUNTERS_INIT); +OPAL_CALL(opal_imc_counters_start, OPAL_IMC_COUNTERS_START); +OPAL_CALL(opal_imc_counters_stop, OPAL_IMC_COUNTERS_STOP);
include/linux/cpuhotplug.h +1 -0
@@ -139,6 +139,7 @@ enum cpuhp_state {CPUHP_AP_PERF_ARM_L2X0_ONLINE ,CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE ,CPUHP_AP_PERF_ARM_QCOM_L3_ONLINE , +CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE ,CPUHP_AP_WORKQUEUE_ONLINE ,CPUHP_AP_RCUTREE_ONLINE , CPUHP_AP_ONLINE_DYN,
Signature · 1 line
2.7.4