lkml.org 
[lkml]   [2016]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch V2 35/67] arm/perf: Convert to hotplug state machine
Hi,

On Wed, Jul 13, 2016 at 05:16:36PM +0000, Anna-Maria Gleixner wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
>
> Straight forward conversion w/o bells and whistles.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
> ---
> drivers/perf/arm_pmu.c | 36 +++++++++++++++---------------------
> include/linux/cpuhotplug.h | 1 +
> include/linux/perf/arm_pmu.h | 1 -
> 3 files changed, 16 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> index 140436a..ae9fc6c 100644
> --- a/drivers/perf/arm_pmu.c
> +++ b/drivers/perf/arm_pmu.c
> @@ -691,24 +691,15 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
> * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading
> * junk values out of them.
> */
> -static int cpu_pmu_notify(struct notifier_block *b, unsigned long action,
> - void *hcpu)
> +static int arm_perf_starting_cpu(unsigned int cpu)
> {
> - int cpu = (unsigned long)hcpu;
> - struct arm_pmu *pmu = container_of(b, struct arm_pmu, hotplug_nb);
> -
> - if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING)
> - return NOTIFY_DONE;
> -
> - if (!cpumask_test_cpu(cpu, &pmu->supported_cpus))
> - return NOTIFY_DONE;
> -
> - if (pmu->reset)
> - pmu->reset(pmu);
> - else
> - return NOTIFY_DONE;
> -
> - return NOTIFY_OK;
> + if (!__oprofile_cpu_pmu)
> + return 0;
> + if (!cpumask_test_cpu(cpu, &__oprofile_cpu_pmu->supported_cpus))
> + return 0;
> + if (__oprofile_cpu_pmu->reset)
> + __oprofile_cpu_pmu->reset(__oprofile_cpu_pmu);
> + return 0;
> }

We may have multiple PMUs (e.g. two in big.LITTLE systems), and
__oprofile_cpu_pmu only contains one of these. So this conversion is not
correct.

We were relying on the notifier list implicitly containing a list of
those PMUs. It seems like we need an explicit list here.

We keep __oprofile_cpu_pmu around for legacy 32-bit users of OProfile
(on non-hetereogeneous systems), and that's all that the variable should
be used for.

Thanks,
Mark.

\
 
 \ /
  Last update: 2016-07-15 15:41    [W:0.655 / U:2.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site