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: Punit Agrawal <punit.agrawal@arm.com>,
	linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com,
	linux-acpi@vger.kernel.org, mlangsdorf@redhat.com,
	steve.capper@arm.com
Subject: Re: [PATCH v7 8/9] arm64: pmu: Detect and enable multiple PMUs in an ACPI system
Date: Thu, 1 Sep 2016 15:30:37 +0100	[thread overview]
Message-ID: <20160901143037.GL6721@arm.com> (raw)
In-Reply-To: <b4d5397f-2ab0-8c19-d36e-ea23edb71bfb@arm.com>

On Fri, Aug 26, 2016 at 05:44:59PM -0500, Jeremy Linton wrote:
> Hi,
> 
> On 08/26/2016 10:04 AM, Punit Agrawal wrote:
> (trimming)
> >>+			pmu = kzalloc(sizeof(struct pmu_types), GFP_KERNEL);
> >>+			if (!pmu) {
> >>+				pr_warn("Unable to allocate pmu_types\n");
> >>+				/*
> >>+				 * continue to count cpus for any pmu_types
> >>+				 * already allocated, but don't allocate any
> >>+				 * more pmu_types. This avoids undercounting.
> >>+				 */
> >>+				alloc_failure = true;
> >
> >Why not just fail probe and return an error? What is the benefit of
> >having some of the PMUs available?
> 
> AFAIC, there isn't a good reason for penalizing PMU's which we can get
> working if a subset of the system PMUs can't be created. But this is per PMU
> type, so with current systems the kzalloc will be called a max of 2 times
> (there is the potential of a 3rd time, due to some other error handling, but
> that doesn't change the argument much). AKA, this doesn't result in "partial
> registration" of a PMU.

... but this will look mighty confusing to userspace, where things will
appear to "half-work", if for some reason the machine makes it that far
at all.

I think we should stick with the KISS approach and just fail the probe
as Punit is suggesting.

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 v7 8/9] arm64: pmu: Detect and enable multiple PMUs in an ACPI system
Date: Thu, 1 Sep 2016 15:30:37 +0100	[thread overview]
Message-ID: <20160901143037.GL6721@arm.com> (raw)
In-Reply-To: <b4d5397f-2ab0-8c19-d36e-ea23edb71bfb@arm.com>

On Fri, Aug 26, 2016 at 05:44:59PM -0500, Jeremy Linton wrote:
> Hi,
> 
> On 08/26/2016 10:04 AM, Punit Agrawal wrote:
> (trimming)
> >>+			pmu = kzalloc(sizeof(struct pmu_types), GFP_KERNEL);
> >>+			if (!pmu) {
> >>+				pr_warn("Unable to allocate pmu_types\n");
> >>+				/*
> >>+				 * continue to count cpus for any pmu_types
> >>+				 * already allocated, but don't allocate any
> >>+				 * more pmu_types. This avoids undercounting.
> >>+				 */
> >>+				alloc_failure = true;
> >
> >Why not just fail probe and return an error? What is the benefit of
> >having some of the PMUs available?
> 
> AFAIC, there isn't a good reason for penalizing PMU's which we can get
> working if a subset of the system PMUs can't be created. But this is per PMU
> type, so with current systems the kzalloc will be called a max of 2 times
> (there is the potential of a 3rd time, due to some other error handling, but
> that doesn't change the argument much). AKA, this doesn't result in "partial
> registration" of a PMU.

... but this will look mighty confusing to userspace, where things will
appear to "half-work", if for some reason the machine makes it that far
at all.

I think we should stick with the KISS approach and just fail the probe
as Punit is suggesting.

Will

  parent reply	other threads:[~2016-09-01 14:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 20:47 [PATCH v7 0/9] Enable PMUs in ACPI systems Jeremy Linton
2016-08-23 20:47 ` Jeremy Linton
2016-08-23 20:47 ` [PATCH v7 1/9] arm64: pmu: add fallback probe table Jeremy Linton
2016-08-23 20:47   ` Jeremy Linton
2016-08-26 14:34   ` Punit Agrawal
2016-08-26 14:34     ` Punit Agrawal
2016-08-23 20:47 ` [PATCH v7 2/9] arm64: pmu: Probe default hw/cache counters Jeremy Linton
2016-08-23 20:47   ` Jeremy Linton
2016-08-23 20:47 ` [PATCH v7 3/9] arm64: pmu: Hoist pmu platform device name Jeremy Linton
2016-08-23 20:47   ` Jeremy Linton
2016-08-23 20:47 ` [PATCH v7 4/9] arm64: Rename the common MADT parse routine Jeremy Linton
2016-08-23 20:47   ` Jeremy Linton
2016-08-23 20:47 ` [PATCH v7 5/9] arm64: pmu: Add support for probing with ACPI Jeremy Linton
2016-08-23 20:47   ` Jeremy Linton
2016-08-26 14:42   ` Punit Agrawal
2016-08-26 14:42     ` Punit Agrawal
2016-08-23 20:47 ` [PATCH v7 6/9] arm: arm64: Add routine to determine cpuid of other cpus Jeremy Linton
2016-08-23 20:47   ` Jeremy Linton
2016-08-23 20:47 ` [PATCH v7 7/9] arm: arm64: pmu: Assign platform PMU CPU affinity Jeremy Linton
2016-08-23 20:47   ` Jeremy Linton
2016-08-26 14:54   ` Punit Agrawal
2016-08-26 14:54     ` Punit Agrawal
2016-08-23 20:47 ` [PATCH v7 8/9] arm64: pmu: Detect and enable multiple PMUs in an ACPI system Jeremy Linton
2016-08-23 20:47   ` Jeremy Linton
2016-08-26 15:04   ` Punit Agrawal
2016-08-26 15:04     ` Punit Agrawal
2016-08-26 22:44     ` Jeremy Linton
2016-08-26 22:44       ` Jeremy Linton
2016-08-30  9:43       ` Punit Agrawal
2016-08-30  9:43         ` Punit Agrawal
2016-09-01 14:30       ` Will Deacon [this message]
2016-09-01 14:30         ` Will Deacon
2016-08-23 20:48 ` [PATCH v7 9/9] MAINTAINERS: Tweak ARM PMU maintainers Jeremy Linton
2016-08-23 20:48   ` Jeremy Linton

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=20160901143037.GL6721@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=mark.rutland@arm.com \
    --cc=mlangsdorf@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.