Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444290

Re: [patch V2 35/67] arm/perf: Convert to hotplug state machine

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [patch V2 35/67] arm/perf: Convert to hotplug state machine
Date 2016-07-15 15:10 +0200
Message-ID <rVb2q-7js-17@gated-at.bofh.it> (permalink)
References <rUvZf-63d-5@gated-at.bofh.it> <rUw8V-67L-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[patch V2 35/67] arm/perf: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
  Re: [patch V2 35/67] arm/perf: Convert to hotplug state machine Mark Rutland <mark.rutland@arm.com> - 2016-07-15 15:10 +0200
    Re: [patch V2 35/67] arm/perf: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-15 17:30 +0200
      Re: [patch V2 35/67] arm/perf: Convert to hotplug state machine Mark Rutland <mark.rutland@arm.com> - 2016-07-15 18:20 +0200
  [tip:smp/hotplug] arm/perf: Convert to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    Re: [tip:smp/hotplug] arm/perf: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-19 09:40 +0200
      Re: [tip:smp/hotplug] arm/perf: Convert to hotplug state machine Ingo Molnar <mingo@kernel.org> - 2016-07-19 09:50 +0200
        [PATCH v2] arm/perf: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-19 11:10 +0200
          Re: [PATCH v2] arm/perf: Convert to hotplug state machine Mark Rutland <mark.rutland@arm.com> - 2016-07-19 12:00 +0200
            [PATCH v3] arm/perf: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-19 13:20 +0200
              Re: [PATCH v3] arm/perf: Convert to hotplug state machine Ingo Molnar <mingo@kernel.org> - 2016-07-20 10:10 +0200
              [tip:smp/hotplug] arm/perf: Fix hotplug state machine conversion tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-20 12:50 +0200

csiph-web