You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
powerpc/perf_counter: Make sure PMU gets enabled properly
This makes sure that we call the platform-specific ppc_md.enable_pmcs function on each CPU before we try to use the PMU on that CPU. If the CPU goes off-line and then on-line, we need to do the enable_pmcs call again, so we use the hw_perf_counter_setup hook to ensure that. It gets called as each CPU comes online, but it isn't called on the CPU that is coming up, so this adds the CPU number as an argument to it (there were no non-empty instances of hw_perf_counter_setup before). This also arranges to set the pmcregs_in_use field of the lppaca (data structure shared with the hypervisor) on each CPU when we are using the PMU and clear it when we are not. This allows the hypervisor to optimize partition switches by not saving/restoring the PMU registers when we aren't using the PMU. Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
@@ -46,7 +46,7 @@ hw_perf_counter_init(struct perf_counter *counter)
|
||||
|
||||
u64 __weak hw_perf_save_disable(void) { return 0; }
|
||||
void __weak hw_perf_restore(u64 ctrl) { barrier(); }
|
||||
void __weak hw_perf_counter_setup(void) { barrier(); }
|
||||
void __weak hw_perf_counter_setup(int cpu) { barrier(); }
|
||||
int __weak hw_perf_group_sched_in(struct perf_counter *group_leader,
|
||||
struct perf_cpu_context *cpuctx,
|
||||
struct perf_counter_context *ctx, int cpu)
|
||||
@@ -1598,7 +1598,7 @@ static void __cpuinit perf_counter_init_cpu(int cpu)
|
||||
cpuctx->max_pertask = perf_max_counters - perf_reserved_percpu;
|
||||
mutex_unlock(&perf_resource_mutex);
|
||||
|
||||
hw_perf_counter_setup();
|
||||
hw_perf_counter_setup(cpu);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
|
||||
Reference in New Issue
Block a user