提交 4f0f8217 编写于 作者: T Thomas Gleixner 提交者: Ingo Molnar

s390/perf: Convert the hotplug notifier to state machine callbacks (Counter)

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NAnna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153334.436370635@linutronix.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 57ecde42
......@@ -664,30 +664,22 @@ static struct pmu cpumf_pmu = {
.cancel_txn = cpumf_pmu_cancel_txn,
};
static int cpumf_pmu_notifier(struct notifier_block *self, unsigned long action,
void *hcpu)
static int cpumf_pmf_setup(unsigned int cpu, int flags)
{
int flags;
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_ONLINE:
case CPU_DOWN_FAILED:
flags = PMC_INIT;
local_irq_disable();
setup_pmc_cpu(&flags);
local_irq_enable();
break;
case CPU_DOWN_PREPARE:
flags = PMC_RELEASE;
local_irq_disable();
setup_pmc_cpu(&flags);
local_irq_enable();
break;
default:
break;
}
local_irq_disable();
setup_pmc_cpu(&flags);
local_irq_enable();
return 0;
}
static int s390_pmu_online_cpu(unsigned int cpu)
{
return cpumf_pmf_setup(cpu, PMC_INIT);
}
return NOTIFY_OK;
static int s390_pmu_offline_cpu(unsigned int cpu)
{
return cpumf_pmf_setup(cpu, PMC_RELEASE);
}
static int __init cpumf_pmu_init(void)
......@@ -707,7 +699,7 @@ static int __init cpumf_pmu_init(void)
if (rc) {
pr_err("Registering for CPU-measurement alerts "
"failed with rc=%i\n", rc);
goto out;
return rc;
}
cpumf_pmu.attr_groups = cpumf_cf_event_group();
......@@ -716,10 +708,10 @@ static int __init cpumf_pmu_init(void)
pr_err("Registering the cpum_cf PMU failed with rc=%i\n", rc);
unregister_external_irq(EXT_IRQ_MEASURE_ALERT,
cpumf_measurement_alert);
goto out;
return rc;
}
perf_cpu_notifier(cpumf_pmu_notifier);
out:
return rc;
return cpuhp_setup_state(CPUHP_AP_PERF_S390_CF_ONLINE,
"AP_PERF_S390_CF_ONLINE",
s390_pmu_online_cpu, s390_pmu_offline_cpu);
}
early_initcall(cpumf_pmu_init);
......@@ -42,6 +42,7 @@ enum cpuhp_state {
CPUHP_AP_PERF_X86_RAPL_ONLINE,
CPUHP_AP_PERF_X86_CQM_ONLINE,
CPUHP_AP_PERF_X86_CSTATE_ONLINE,
CPUHP_AP_PERF_S390_CF_ONLINE,
CPUHP_AP_NOTIFY_ONLINE,
CPUHP_AP_ONLINE_DYN,
CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册