All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Linton <jeremy.linton@arm.com>
To: Robert Richter <rric@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com,
	catalin.marinas@arm.com, rjw@rjwysocki.net,
	linux-acpi@vger.kernel.org, sudeep.holla@arm.com,
	will@kernel.org, lenb@kernel.org
Subject: Re: [PATCH v4 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag
Date: Fri, 2 Aug 2019 10:36:45 -0500	[thread overview]
Message-ID: <488e9444-d01e-6bf4-770c-34091a8a8244@arm.com> (raw)
In-Reply-To: <20190802130510.rd4uyndtqlcfdhtm@rric.localdomain>

Hi,

Thanks for taking a look at this.

On 8/2/19 8:05 AM, Robert Richter wrote:
> On 31.07.19 22:46:33, Jeremy Linton wrote:
> 
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index 9426b9aaed86..9d0e20a2ac83 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -1302,11 +1302,16 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>   #endif
>>   
>>   #ifdef CONFIG_ACPI_PPTT
>> +int acpi_pptt_cpu_is_thread(unsigned int cpu);
>>   int find_acpi_cpu_topology(unsigned int cpu, int level);
>>   int find_acpi_cpu_topology_package(unsigned int cpu);
>>   int find_acpi_cpu_topology_hetero_id(unsigned int cpu);
>>   int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
> 
> All those functions (exept hetero_id) are used only in
> parse_acpi_topology(). So how about creating a struct with thread_id,
> core_id, and cache_id (and hetero_id (?)) and have a single pptt table
> parsing function that fills in all of this into that struct? This
> simplifies the api and also the code.
> 
> This also shows that hetid (see arm_pmu_acpi.c) better should be
> stored in cpu_topology[] too and thus being parsed with the other
> parameters as well and made accessible from there by a helper.


I think the idea here was to avoid an additional set of intermediate 
data structures between the PPTT table/structure and the final arch 
specific data structures (which themselves are used to feed other 
things, like the scheduler, note the llc parsing). Rather the attempt is 
to provide a set of tools to retrieve information and let the policy for 
how that information is used be dictated by the consumer.

In the future, if we can further unify the arch specific cpu_topology 
structures it would make sense to parse directly into them, but until 
that happens I don't think we should try. The existing code does parse 
directly into the cache structures, but the cpu topology is subtly arm64 
at the moment. If another arch decided to use this, i'm not sure they 
would want or need it parsed in exactly the same way.


WARNING: multiple messages have this Message-ID (diff)
From: Jeremy Linton <jeremy.linton@arm.com>
To: Robert Richter <rric@kernel.org>
Cc: lorenzo.pieralisi@arm.com, catalin.marinas@arm.com,
	rjw@rjwysocki.net, linux-acpi@vger.kernel.org,
	sudeep.holla@arm.com, will@kernel.org,
	linux-arm-kernel@lists.infradead.org, lenb@kernel.org
Subject: Re: [PATCH v4 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag
Date: Fri, 2 Aug 2019 10:36:45 -0500	[thread overview]
Message-ID: <488e9444-d01e-6bf4-770c-34091a8a8244@arm.com> (raw)
In-Reply-To: <20190802130510.rd4uyndtqlcfdhtm@rric.localdomain>

Hi,

Thanks for taking a look at this.

On 8/2/19 8:05 AM, Robert Richter wrote:
> On 31.07.19 22:46:33, Jeremy Linton wrote:
> 
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index 9426b9aaed86..9d0e20a2ac83 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -1302,11 +1302,16 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>   #endif
>>   
>>   #ifdef CONFIG_ACPI_PPTT
>> +int acpi_pptt_cpu_is_thread(unsigned int cpu);
>>   int find_acpi_cpu_topology(unsigned int cpu, int level);
>>   int find_acpi_cpu_topology_package(unsigned int cpu);
>>   int find_acpi_cpu_topology_hetero_id(unsigned int cpu);
>>   int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
> 
> All those functions (exept hetero_id) are used only in
> parse_acpi_topology(). So how about creating a struct with thread_id,
> core_id, and cache_id (and hetero_id (?)) and have a single pptt table
> parsing function that fills in all of this into that struct? This
> simplifies the api and also the code.
> 
> This also shows that hetid (see arm_pmu_acpi.c) better should be
> stored in cpu_topology[] too and thus being parsed with the other
> parameters as well and made accessible from there by a helper.


I think the idea here was to avoid an additional set of intermediate 
data structures between the PPTT table/structure and the final arch 
specific data structures (which themselves are used to feed other 
things, like the scheduler, note the llc parsing). Rather the attempt is 
to provide a set of tools to retrieve information and let the policy for 
how that information is used be dictated by the consumer.

In the future, if we can further unify the arch specific cpu_topology 
structures it would make sense to parse directly into them, but until 
that happens I don't think we should try. The existing code does parse 
directly into the cache structures, but the cpu topology is subtly arm64 
at the moment. If another arch decided to use this, i'm not sure they 
would want or need it parsed in exactly the same way.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-02 15:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  3:46 [PATCH v4 0/2] arm64/PPTT ACPI 6.3 thread flag support Jeremy Linton
2019-08-01  3:46 ` Jeremy Linton
2019-08-01  3:46 ` [PATCH v4 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag Jeremy Linton
2019-08-01  3:46   ` Jeremy Linton
2019-08-01 15:57   ` Sudeep Holla
2019-08-01 15:57     ` Sudeep Holla
2019-08-01 16:10     ` Jeremy Linton
2019-08-01 16:10       ` Jeremy Linton
2019-08-02 13:05   ` Robert Richter
2019-08-02 13:05     ` Robert Richter
2019-08-02 15:36     ` Jeremy Linton [this message]
2019-08-02 15:36       ` Jeremy Linton
2019-08-01  3:46 ` [PATCH v4 2/2] arm64: topology: Use PPTT to determine if PE is a thread Jeremy Linton
2019-08-01  3:46   ` Jeremy Linton
2019-08-01 15:58   ` Sudeep Holla
2019-08-01 15:58     ` Sudeep Holla
2019-08-02 13:44   ` Robert Richter
2019-08-02 13:44     ` Robert Richter
2019-08-02 16:04     ` Jeremy Linton
2019-08-02 16:04       ` Jeremy Linton
2019-08-08 20:40 [PATCH v4 0/2] arm64/PPTT ACPI 6.3 thread flag support Jeremy Linton
2019-08-08 20:40 ` [PATCH v4 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag Jeremy Linton
2019-08-08 20:40   ` Jeremy Linton
2019-08-08 22:25   ` Robert Richter
2019-08-08 22:25     ` Robert Richter
2019-08-12  9:06     ` Rafael J. Wysocki
2019-08-12  9:06       ` Rafael J. Wysocki
2019-08-12 11:59       ` Will Deacon
2019-08-12 11:59         ` Will Deacon
2019-08-20  9:01         ` John Garry
2019-08-20  9:01           ` John Garry
2019-08-21 13:20           ` Jeremy Linton
2019-08-21 13:20             ` Jeremy Linton
2019-08-21 13:25             ` John Garry
2019-08-21 13:25               ` John Garry

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=488e9444-d01e-6bf4-770c-34091a8a8244@arm.com \
    --to=jeremy.linton@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=rric@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=will@kernel.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.