All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,
	mark.rutland@arm.com, punit.agrawal@arm.com,
	steve.capper@arm.com, msalter@redhat.com, mlangsdorf@redhat.com,
	linux@armlinux.org.uk
Subject: Re: [PATCH v11 7/7] arm: pmu: Add PMU definitions for cores not initially online
Date: Thu, 15 Dec 2016 17:08:11 +0000	[thread overview]
Message-ID: <20161215170810.GJ10481@arm.com> (raw)
In-Reply-To: <457894f4-67f8-9d32-ee8b-5a34e9a21488@arm.com>

On Tue, Dec 06, 2016 at 11:56:56AM -0600, Jeremy Linton wrote:
> Hi,
> 
> On 12/06/2016 09:21 AM, Will Deacon wrote:
> >On Fri, Dec 02, 2016 at 12:56:01PM -0600, Jeremy Linton wrote:
> >>ACPI CPUs aren't associated with a PMU until they have been put
> >>online. This means that we potentially have to update a PMU
> >>definition the first time a CPU is hot added to the machine.
> >>
> >>Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> >>---
> >> drivers/perf/arm_pmu.c       | 38 ++++++++++++++++++++++++++++++++++++--
> >> include/linux/perf/arm_pmu.h |  4 ++++
> >> 2 files changed, 40 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> >>index fa40294..4abb2fe 100644
> >>--- a/drivers/perf/arm_pmu.c
> >>+++ b/drivers/perf/arm_pmu.c
> >>@@ -711,6 +711,30 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
> >> 	return 0;
> >> }
> >>
> >>+static DEFINE_SPINLOCK(arm_pmu_resource_lock);
> >
> >Why do you need this spinlock? The hotplug notifiers are serialised afaik,
> >and you don't take it anywhere else.
> 
> Well, I assumed they were serialized, but then I went looking for a
> guarantee and couldn't find one specific to the notifiers, even though the
> previous lock was removed. 

They should be serialised either by virtue of them all running off the back
of a single CPU (because the hotplug thread hasn't yet been created), or
by the st->done completion for the hotplug work threads.

Will

WARNING: multiple messages have this Message-ID (diff)
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v11 7/7] arm: pmu: Add PMU definitions for cores not initially online
Date: Thu, 15 Dec 2016 17:08:11 +0000	[thread overview]
Message-ID: <20161215170810.GJ10481@arm.com> (raw)
In-Reply-To: <457894f4-67f8-9d32-ee8b-5a34e9a21488@arm.com>

On Tue, Dec 06, 2016 at 11:56:56AM -0600, Jeremy Linton wrote:
> Hi,
> 
> On 12/06/2016 09:21 AM, Will Deacon wrote:
> >On Fri, Dec 02, 2016 at 12:56:01PM -0600, Jeremy Linton wrote:
> >>ACPI CPUs aren't associated with a PMU until they have been put
> >>online. This means that we potentially have to update a PMU
> >>definition the first time a CPU is hot added to the machine.
> >>
> >>Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> >>---
> >> drivers/perf/arm_pmu.c       | 38 ++++++++++++++++++++++++++++++++++++--
> >> include/linux/perf/arm_pmu.h |  4 ++++
> >> 2 files changed, 40 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> >>index fa40294..4abb2fe 100644
> >>--- a/drivers/perf/arm_pmu.c
> >>+++ b/drivers/perf/arm_pmu.c
> >>@@ -711,6 +711,30 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
> >> 	return 0;
> >> }
> >>
> >>+static DEFINE_SPINLOCK(arm_pmu_resource_lock);
> >
> >Why do you need this spinlock? The hotplug notifiers are serialised afaik,
> >and you don't take it anywhere else.
> 
> Well, I assumed they were serialized, but then I went looking for a
> guarantee and couldn't find one specific to the notifiers, even though the
> previous lock was removed. 

They should be serialised either by virtue of them all running off the back
of a single CPU (because the hotplug thread hasn't yet been created), or
by the st->done completion for the hotplug work threads.

Will

  parent reply	other threads:[~2016-12-15 17:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 18:55 [PATCH v11 0/7] Enable PMUs in ACPI systems Jeremy Linton
2016-12-02 18:55 ` Jeremy Linton
2016-12-02 18:55 ` [PATCH v11 1/7] arm64: Rename the common MADT parse routine Jeremy Linton
2016-12-02 18:55   ` Jeremy Linton
2016-12-02 18:55 ` [PATCH v11 2/7] arm: arm64: Add routine to determine cpuid of other cpus Jeremy Linton
2016-12-02 18:55   ` Jeremy Linton
2016-12-02 18:55 ` [PATCH v11 3/7] arm64: pmu: Cache PMU interrupt numbers from MADT parse Jeremy Linton
2016-12-02 18:55   ` Jeremy Linton
2016-12-02 18:55 ` [PATCH v11 4/7] arm: arm64: pmu: Assign platform PMU CPU affinity Jeremy Linton
2016-12-02 18:55   ` Jeremy Linton
2016-12-02 18:55 ` [PATCH v11 5/7] arm64: pmu: Detect multiple generic PMUs and append counter Jeremy Linton
2016-12-02 18:55   ` Jeremy Linton
2016-12-02 18:56 ` [PATCH v11 6/7] arm64: pmu: Detect and enable multiple PMUs in an ACPI system Jeremy Linton
2016-12-02 18:56   ` Jeremy Linton
2016-12-02 18:56 ` [PATCH v11 7/7] arm: pmu: Add PMU definitions for cores not initially online Jeremy Linton
2016-12-02 18:56   ` Jeremy Linton
2016-12-06 15:21   ` Will Deacon
2016-12-06 15:21     ` Will Deacon
2016-12-06 17:56     ` Jeremy Linton
2016-12-06 17:56       ` Jeremy Linton
2016-12-07 11:08       ` Mark Rutland
2016-12-07 11:08         ` Mark Rutland
2016-12-15 17:08       ` Will Deacon [this message]
2016-12-15 17:08         ` Will Deacon

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=20161215170810.GJ10481@arm.com \
    --to=will.deacon@arm.com \
    --cc=jeremy.linton@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mlangsdorf@redhat.com \
    --cc=msalter@redhat.com \
    --cc=punit.agrawal@arm.com \
    --cc=steve.capper@arm.com \
    /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.