All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: perf: Set affinity for PPI based PMUs
Date: Tue, 30 Jun 2015 09:52:26 +0100	[thread overview]
Message-ID: <20150630085225.GA25828@arm.com> (raw)
In-Reply-To: <1435615126-16492-1-git-send-email-sboyd@codeaurora.org>

Hi Stephen,

On Mon, Jun 29, 2015 at 10:58:46PM +0100, Stephen Boyd wrote:
> For PPI based PMUs, we bail out early in of_pmu_irq_cfg() without
> setting the PMU's supported_cpus bitmap. This causes the
> smp_call_function_any() in armv7_probe_num_events() to fail. Set
> the bitmap to be all CPUs so that we properly probe PMUs that use
> PPIs.
> 
> Fixes: cc88116da0d1 ("arm: perf: treat PMUs as CPU affine")
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>  arch/arm/kernel/perf_event.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
> index 54272e0be713..7d5379c1c443 100644
> --- a/arch/arm/kernel/perf_event.c
> +++ b/arch/arm/kernel/perf_event.c
> @@ -795,8 +795,10 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
>  
>  	/* Don't bother with PPIs; they're already affine */
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq >= 0 && irq_is_percpu(irq))
> +	if (irq >= 0 && irq_is_percpu(irq)) {
> +		cpumask_setall(&pmu->supported_cpus);
>  		return 0;
> +	}

Looks good to me as a fix, but I'm currently working on extending the
interrupt-affinity property to work with both SPIs and PPIs so that we
can use it to identify PMU affinity on multi-cluster systems.

  https://git.kernel.org/cgit/linux/kernel/git/will/linux.git/commit/?h=perf/updates&id=633fa0b629d86e58d68aff295f92031877dd0294

Any chance you could take that for a spin on your platform, please?

Will

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Mark Rutland <Mark.Rutland@arm.com>
Subject: Re: [PATCH] arm: perf: Set affinity for PPI based PMUs
Date: Tue, 30 Jun 2015 09:52:26 +0100	[thread overview]
Message-ID: <20150630085225.GA25828@arm.com> (raw)
In-Reply-To: <1435615126-16492-1-git-send-email-sboyd@codeaurora.org>

Hi Stephen,

On Mon, Jun 29, 2015 at 10:58:46PM +0100, Stephen Boyd wrote:
> For PPI based PMUs, we bail out early in of_pmu_irq_cfg() without
> setting the PMU's supported_cpus bitmap. This causes the
> smp_call_function_any() in armv7_probe_num_events() to fail. Set
> the bitmap to be all CPUs so that we properly probe PMUs that use
> PPIs.
> 
> Fixes: cc88116da0d1 ("arm: perf: treat PMUs as CPU affine")
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>  arch/arm/kernel/perf_event.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
> index 54272e0be713..7d5379c1c443 100644
> --- a/arch/arm/kernel/perf_event.c
> +++ b/arch/arm/kernel/perf_event.c
> @@ -795,8 +795,10 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
>  
>  	/* Don't bother with PPIs; they're already affine */
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq >= 0 && irq_is_percpu(irq))
> +	if (irq >= 0 && irq_is_percpu(irq)) {
> +		cpumask_setall(&pmu->supported_cpus);
>  		return 0;
> +	}

Looks good to me as a fix, but I'm currently working on extending the
interrupt-affinity property to work with both SPIs and PPIs so that we
can use it to identify PMU affinity on multi-cluster systems.

  https://git.kernel.org/cgit/linux/kernel/git/will/linux.git/commit/?h=perf/updates&id=633fa0b629d86e58d68aff295f92031877dd0294

Any chance you could take that for a spin on your platform, please?

Will

  reply	other threads:[~2015-06-30  8:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29 21:58 [PATCH] arm: perf: Set affinity for PPI based PMUs Stephen Boyd
2015-06-29 21:58 ` Stephen Boyd
2015-06-30  8:52 ` Will Deacon [this message]
2015-06-30  8:52   ` Will Deacon
2015-07-01  1:19   ` Stephen Boyd
2015-07-01  1:19     ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150630085225.GA25828@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.