All of lore.kernel.org
 help / color / mirror / Atom feed
From: Punit Agrawal <punit.agrawal@arm.com>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com,
	will.deacon@arm.com, linux-acpi@vger.kernel.org,
	mlangsdorf@redhat.com, steve.capper@arm.com
Subject: Re: [PATCH v9 08/10] arm64: pmu: Detect and enable multiple PMUs in an ACPI system
Date: Tue, 20 Sep 2016 17:11:24 +0100	[thread overview]
Message-ID: <87y42msg9f.fsf@e105922-lin.cambridge.arm.com> (raw)
In-Reply-To: <b8b27aa5-e80e-f7cc-3410-4b2ac44c69e5@arm.com> (Jeremy Linton's message of "Fri, 16 Sep 2016 12:57:20 -0500")

Jeremy Linton <jeremy.linton@arm.com> writes:

> On 09/16/2016 12:07 PM, Punit Agrawal wrote:
>> Jeremy Linton <jeremy.linton@arm.com> writes:
>>
>>> Hi,
>>>
>>> On 09/16/2016 08:33 AM, Punit Agrawal wrote:
>>>> Jeremy Linton <jeremy.linton@arm.com> writes:
>>>>
>>>>> Its possible that an ACPI system has multiple CPU types in it
>>>>> with differing PMU counters. Iterate the CPU's and make a determination
>>>>> about how many of each type exist in the system. Then take and create
>>>>> a PMU platform device for each type, and assign it the interrupts parsed
>>>>> from the MADT. Creating a platform device is necessary because the PMUs
>>>>> are not described as devices in the DSDT table.
>>>>>
>>>>> This code is loosely based on earlier work by Mark Salter.
>>>
>>> (trimming)
>>>
>>>>> +
>>>>> +	list_for_each_entry_safe(pmu, safe_temp, &pmus, list) {
>>>>> +		if (unused_madt_entries)
>>>>> +			pmu->cpu_count = num_possible_cpus();
>>>>
>>>> So if there is any unbooted cpu ...
>>>>
>>>>> +
>>>>> +		res = kcalloc(pmu->cpu_count,
>>>>> +				  sizeof(struct resource), GFP_KERNEL);
>>>>
>>>> ... we allocate potentially large number (num_possible_cpus()) of
>>>> resources for each PMU.
>>>>
>>>> This is needlessly wasteful. Under what conditions have you found
>>>> reg_midr to be 0?
>>>
>>> Unused MADT entries, in place for potentially unbooted/hotplug
>>> CPUs.
>>
>> Is linux able to deal with booting secondaries that have unused MADT
>> entries?
>
> Uh, yah I think so, that is how i've been testing it, maybe we are
> saying different things. When i'm talking about "unused" I mean MADT
> entries that don't have started/running cpus. Obviously they stop
> being unused when a cpu is booted.
>
>>
>>> In those cases you don't know for sure which PMU the CPU belongs
>>> to until it comes online and the MIDR can be read. I'm open to
>>> suggestions on how to deal with this, outside of pushing my luck and
>>> further breaking the platform device encapsulation by trying to
>>> reallocate the resource structure while its active. Besides its only
>>> wasteful for ACPI+big.little, which at the moment only applies to a
>>> development platform.
>>
>> I don't have any ideas to solve this problem, but in the interest of
>> helping review, please move all the changes arising from hotplug/unused
>> MADT entries in this patch to the next one.
>
> Which is sort of the opposite of the last 3 months, of complaints
> about how hard it was to review this module with multiple patches
> adding features to the code...

My suggestion to move functionality that has concerns and needs rework
to later patch is aimed at helping get stuff that everybody agrees upon
merged. But it's only a suggestion...

> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: punit.agrawal@arm.com (Punit Agrawal)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 08/10] arm64: pmu: Detect and enable multiple PMUs in an ACPI system
Date: Tue, 20 Sep 2016 17:11:24 +0100	[thread overview]
Message-ID: <87y42msg9f.fsf@e105922-lin.cambridge.arm.com> (raw)
In-Reply-To: <b8b27aa5-e80e-f7cc-3410-4b2ac44c69e5@arm.com> (Jeremy Linton's message of "Fri, 16 Sep 2016 12:57:20 -0500")

Jeremy Linton <jeremy.linton@arm.com> writes:

> On 09/16/2016 12:07 PM, Punit Agrawal wrote:
>> Jeremy Linton <jeremy.linton@arm.com> writes:
>>
>>> Hi,
>>>
>>> On 09/16/2016 08:33 AM, Punit Agrawal wrote:
>>>> Jeremy Linton <jeremy.linton@arm.com> writes:
>>>>
>>>>> Its possible that an ACPI system has multiple CPU types in it
>>>>> with differing PMU counters. Iterate the CPU's and make a determination
>>>>> about how many of each type exist in the system. Then take and create
>>>>> a PMU platform device for each type, and assign it the interrupts parsed
>>>>> from the MADT. Creating a platform device is necessary because the PMUs
>>>>> are not described as devices in the DSDT table.
>>>>>
>>>>> This code is loosely based on earlier work by Mark Salter.
>>>
>>> (trimming)
>>>
>>>>> +
>>>>> +	list_for_each_entry_safe(pmu, safe_temp, &pmus, list) {
>>>>> +		if (unused_madt_entries)
>>>>> +			pmu->cpu_count = num_possible_cpus();
>>>>
>>>> So if there is any unbooted cpu ...
>>>>
>>>>> +
>>>>> +		res = kcalloc(pmu->cpu_count,
>>>>> +				  sizeof(struct resource), GFP_KERNEL);
>>>>
>>>> ... we allocate potentially large number (num_possible_cpus()) of
>>>> resources for each PMU.
>>>>
>>>> This is needlessly wasteful. Under what conditions have you found
>>>> reg_midr to be 0?
>>>
>>> Unused MADT entries, in place for potentially unbooted/hotplug
>>> CPUs.
>>
>> Is linux able to deal with booting secondaries that have unused MADT
>> entries?
>
> Uh, yah I think so, that is how i've been testing it, maybe we are
> saying different things. When i'm talking about "unused" I mean MADT
> entries that don't have started/running cpus. Obviously they stop
> being unused when a cpu is booted.
>
>>
>>> In those cases you don't know for sure which PMU the CPU belongs
>>> to until it comes online and the MIDR can be read. I'm open to
>>> suggestions on how to deal with this, outside of pushing my luck and
>>> further breaking the platform device encapsulation by trying to
>>> reallocate the resource structure while its active. Besides its only
>>> wasteful for ACPI+big.little, which at the moment only applies to a
>>> development platform.
>>
>> I don't have any ideas to solve this problem, but in the interest of
>> helping review, please move all the changes arising from hotplug/unused
>> MADT entries in this patch to the next one.
>
> Which is sort of the opposite of the last 3 months, of complaints
> about how hard it was to review this module with multiple patches
> adding features to the code...

My suggestion to move functionality that has concerns and needs rework
to later patch is aimed at helping get stuff that everybody agrees upon
merged. But it's only a suggestion...

> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-09-20 16:12 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 22:32 [PATCH v9 00/10] Enable PMUs in ACPI systems Jeremy Linton
2016-09-14 22:32 ` Jeremy Linton
2016-09-14 22:32 ` [PATCH v9 01/10] arm64: pmu: add fallback probe table Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-14 22:32 ` [PATCH v9 02/10] arm64: pmu: Probe default hw/cache counters Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-14 22:32 ` [PATCH v9 03/10] arm64: pmu: Hoist pmu platform device name Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-14 22:32 ` [PATCH v9 04/10] arm64: Rename the common MADT parse routine Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-14 22:32 ` [PATCH v9 05/10] arm: arm64: Add routine to determine cpuid of other cpus Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-14 22:32 ` [PATCH v9 06/10] arm64: pmu: Cache PMU interrupt numbers from MADT parse Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-14 22:32 ` [PATCH v9 07/10] arm: arm64: pmu: Assign platform PMU CPU affinity Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-16 13:29   ` Will Deacon
2016-09-16 13:29     ` Will Deacon
2016-09-16 15:35     ` Jeremy Linton
2016-09-16 15:35       ` Jeremy Linton
2016-09-16 15:48       ` Will Deacon
2016-09-16 15:48         ` Will Deacon
2016-09-16 16:37   ` Punit Agrawal
2016-09-16 16:37     ` Punit Agrawal
2016-09-14 22:32 ` [PATCH v9 08/10] arm64: pmu: Detect and enable multiple PMUs in an ACPI system Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-16 13:33   ` Punit Agrawal
2016-09-16 13:33     ` Punit Agrawal
2016-09-16 16:32     ` Jeremy Linton
2016-09-16 16:32       ` Jeremy Linton
2016-09-16 17:07       ` Punit Agrawal
2016-09-16 17:07         ` Punit Agrawal
2016-09-16 17:57         ` Jeremy Linton
2016-09-16 17:57           ` Jeremy Linton
2016-09-20 16:11           ` Punit Agrawal [this message]
2016-09-20 16:11             ` Punit Agrawal
2016-09-14 22:32 ` [PATCH v9 09/10] arm: pmu: Add PMU definitions for hot-plugged CPUs Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-14 22:32 ` [PATCH v9 10/10] MAINTAINERS: Tweak ARM PMU maintainers Jeremy Linton
2016-09-14 22:32   ` Jeremy Linton
2016-09-16 17:13 ` [PATCH v9 00/10] Enable PMUs in ACPI systems Punit Agrawal
2016-09-16 17:13   ` Punit Agrawal

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=87y42msg9f.fsf@e105922-lin.cambridge.arm.com \
    --to=punit.agrawal@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=steve.capper@arm.com \
    --cc=will.deacon@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.