mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	linux-kernel@vger.kernel.org, Atish Patra <atishp@atishpatra.org>,
	Atish Patra <atishp@rivosinc.com>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	Qing Wang <wangqing@vivo.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-riscv@lists.infradead.org, Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH v3 15/16] arch_topology: Set cluster identifier in each core/thread from /cpu-map
Date: Mon, 20 Jun 2022 15:27:33 +0200	[thread overview]
Message-ID: <e7d65b22-67a2-b21a-86e5-a9a1606be4d6@arm.com> (raw)
In-Reply-To: <20220617111647.62hsqbpl3bk7xb2y@bogus>

On 17/06/2022 13:16, Sudeep Holla wrote:
> On Thu, Jun 16, 2022 at 05:02:28PM +0100, Dietmar Eggemann wrote:
>> On 13/06/2022 12:17, Sudeep Holla wrote:
>>> On Mon, Jun 13, 2022 at 11:19:36AM +0200, Dietmar Eggemann wrote:
>>>> On 10/06/2022 12:27, Sudeep Holla wrote:
>>>>> On Fri, Jun 10, 2022 at 12:08:44PM +0200, Vincent Guittot wrote:
>>>>>> On Mon, 6 Jun 2022 at 12:22, Sudeep Holla <sudeep.holla@arm.com> wrote:

[...]

>>> What are you referring as 'glue them together'. As I said this series just
>>> address the hardware topology and if there is any impact on sched domains
>>> then it is do with alignment with ACPI and DT platform behaviour. I am not
>>> adding anything more to glue topology and info needed for sched domains.
>>
>> You can fix (1) without (2) parsing 1. level cluster nodes as
>> cluster_siblings.
>>
> 
> Technically yes, but I see no point in delaying it as it is considered as
> broken with respect to the moment ACPI exposed the correct value and at the
> same time resulted in exposing incorrect value in case of DT. I am referring
> to the same change that introduced SCHED_CLUSTER. The damage is done and it
> needs repairing ASAP.

OK, then lets `/sys/.../topology/cluster_cpus` refer to pure
topology-based cluster information. This can be DT cluster-node
information or ACPI L3-tag information e.g. for KP920.

>>> Indeed. But I don't get what you mean by 2 level here. ACPI puts 1st level
>>
>> cpu_map {
>>   socket0 {
>>     cluster0 {    <-- 1. level cluster
>>       cluster0 {  <-- 2. level cluster (3 -->)
> 
> Oh I had misunderstood this level nomenclature, I refer it as leaf cluster
> node which is 2. level cluster in this DT snippet.
> 
>>         core0 {
>>
>>         };
>>         core1 {
>>
>>         };
>>       cluster1 {
>>   ...
>>
>> Armv9 L2 complexes: e.g. QC SM8450:
>>
>>       .---------------.
>> CPU   |0 1 2 3 4 5 6 7|
>>       +---------------+
>> uarch |l l l l m m m b| (so called tri-gear: little, medium, big)
>>       +---------------+
>>   L2  |   |   | | | | | <-- 2. level cluster, Armv9 L2 complexes (<-- 3)
> 
> Again before I assume, what exactly <--3 here and in above snippet mean ?

I wanted to show that we could encode `2. level cluster` as `Armv9 L2
complexes`. But since we agreed (after the email was sent) not to
support `nested cluster-nodes`, this idea does not hold anymore.

>>       +---------------+
>>   L3  |<--         -->|
>>       +---------------+
>>       |<-- cluster -->|
> 
> I think this is 2 level cluster or only cluster in this system w.r.t hardware.
> So lets not confuse with multi-level if not necessary.

No need, we said no `nested cluster-node` support in DT.

>>       +---------------+
>>       |<--   DSU   -->|
>>       '---------------'
>>
>> Only if we map (i) into cluster_sibling, we get the same hardware
>> representation (for the task scheduler) for ACPI (4) and DT (5) systems.
>>
> 
> What is (i) above ?

Sorry, (i) was meant to be `3 -->`.

>> (4) examples:
>>
>> Kunpeng920 - 24 CPUs sharing LLC (cpu_coregroup_mask()), 4 CPUs sharing
>> L3-tag (cpu_clustergroup_mask()).
>>
> 
> Again decouple cache info and cluster info from h/w, you have all the info.
> You can couple them together if that helps when you feed sched_domains.

OK, this is what we finally agreed.

>> X86 Jacobsville - 24 CPUs sharing LLC (L3), 4 CPUs sharing L2
>>
>> Armv9 L2 complexes: e.g. QC SM8450 - 8 CPUs sharing LLC (L3), (for A510
>> (little CPUs)) 2 CPUs sharing L2
> 
> [...]
> 
>>> And yes lstopo doesn't read cluster IDs. But we expose them in ACPI system
>>> and not on DT which was my main point.

OK, no further discussion needed here. `/sys/.../topology/cluster_cpus`
shows L2 (LLC) on Juno, L3-tag an KP920 or L2 on X86 Jacobsville. The
cpu_xxx_mask()s of (e.g.) default_topology[] have to make sure that the
scheduler sees the correct information (the hierarchy of cpumasks).

>> Understood. But a Kunpeng920 `cluster_cpus_list` file would contain
>> logically different information than a Juno `cluster_cpus_list` file.
>>
> And why is that ?

If we see it from the angle of the definition of SCHED_CONFIG_CLUSTER
(`... the level of topology above CPUs ...` then I can see that both
definitions are the same. (CPUS should be rather `cores` here, I guess?).

[...]

>>> As pointed out earlier, have you checked ACPI on Juno and with 
>>> CONFIG_SCHED_CLUSTER ? If the behaviour with my series on DT and ACPI
>>> differs, then it is an issue. But AFAIU, it doesn't and that is my main
>>> argument. You are just assuming what we have on Juno with DT is correct
>>> which may be w.r.t to scheduler but definitely not with respect to the
>>> hardware topology exposed to the users. So my aim is to get that fixed.
>>
>> I never run Juno w/ ACPI. Are you saying that
>> find_acpi_cpu_topology_cluster() returns cpu_topology[cpu].cluster_id's
>> which match the `1. level cluster nodes`?
>>
> 
> Again I am totally confused as why this is now 1.level cluster where as above
> SDM was 2.level cluster. Both SoCs have only 1 level of cluster. While SDM
> has 1 DSU cluster, Juno has 2 clusters.

No need in agreeing what level (could) stand(s) here for. We said `no
nested cluster-node`.

>> The function header of find_acpi_cpu_topology_cluster() says that `...
>> the cluster, if present is the level of topology above CPUs. ...`.
>>
> 
> Exactly and that's how sysfs is also defined and we can't go back and change
> that now. I don't see any issue TBH.

OK.

>> From this perspective I can see your point. But this is then still
>> clearly poorly designed.
> 
> Not really as per the definition.

Not from the viewpoint of topology and cacheinfo. But from the scheduler
and the whole thing gets activated by a scheduler CONFIG option.

>> How would we ever support CONFIG_SCHED_CLUSTER
>> in DT when it really (potentially) would bring a benefit (i.e. in the
>> Armv9 L2-complex case) and not only create trouble for the task
>> scheduler to setup its domains correctly?
> 
> Indeed, that is the next problem once we get all these aligned across
> DT and ACPI. They have diverged and I prefer not to allow that anymore
> by adding more divergence e.g. to support Armv9 L2-complex case. Please
> consider that on top of these, I am not addressing that at the moment.
> In fact I am not addressing any sched_domain topics or issues. I have made
> that clear 😉.

If I recall the content of our discussion correctly, `Armv9 L2
complexes` support could come from L2 (probably `LLC - 1` ?) detection
from cacheinfo. But this is not part of this patch-set.

>> Also in case we stick to
>> setting CONFIG_SCHED_CLUSTER=1 by default, CLS should be the default LLC
>> sched domain and MC the exceptional one. Just to respect the way how the
>> task scheduler removes not useful domains today.
> 
> Fix the cpu_clustergroup_mask or any other cpu_*group_mask as per your
> taste. The topology masks are just inputs to these and will not be changed
> or diverged for these reasons. Sorry if that is not helpful, but that is the
> reality with sysfs exposed to the user-space.

Agreed. We don't have to rely on the task scheduler to build the right
sched domain hierarchy out of every cpu_xxx_mask() functions. We can
tweak cpu_xxx_mask() to get this done.

>>> If you are not happy with that, then how can be be happy with what is the
>>> current behaviour on ACPI + and - CONFIG_SCHED_CLUSTER. I haven't got
>>> your opinion yet on that matter.
>>
>> I guess it's clear now that ACPI + CONFIG_SCHED_CLUSTER with ``the level
>> of topology above CPUs` is congruent with LLC` creates trouble to the
>> scheduler. So I don't see why we should replicate this for DT. Let's
>> discuss further tomorrow in person.
> 
> I see it differently. If that creates a trouble, fix that and you will not
> have any issues with DT too.

OK, I think we (arm64) found a way to support a default
CONFIG_SCHED_CLUSTER and fixing the `Juno lstopo` issue with a possible
way to include `Armv9 L2 complexes` support via cacheinfo later.

  reply	other threads:[~2022-06-20 14:12 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25  8:14 [PATCH v3 00/16] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
2022-05-25  8:14 ` [PATCH v3 01/16] cacheinfo: Use of_cpu_device_node_get instead cpu_dev->of_node Sudeep Holla
2022-05-25  8:14   ` [PATCH v3 02/16] cacheinfo: Add helper to access any cache index for a given CPU Sudeep Holla
2022-05-25  8:14     ` [PATCH v3 03/16] cacheinfo: Move cache_leaves_are_shared out of CONFIG_OF Sudeep Holla
2022-05-25  8:14       ` [PATCH v3 04/16] cacheinfo: Add support to check if last level cache(LLC) is valid or shared Sudeep Holla
2022-05-25  8:14         ` [PATCH v3 05/16] cacheinfo: Allow early detection and population of cache attributes Sudeep Holla
2022-05-25  8:14           ` [PATCH v3 06/16] arch_topology: Add support to parse and detect " Sudeep Holla
2022-05-25  8:14             ` [PATCH v3 07/16] arch_topology: Use the last level cache information from the cacheinfo Sudeep Holla
2022-05-25  8:14               ` [PATCH v3 08/16] arm64: topology: Remove redundant setting of llc_id in CPU topology Sudeep Holla
2022-05-25  8:14                 ` [PATCH v3 09/16] arch_topology: Drop LLC identifier stash from the " Sudeep Holla
2022-05-25  8:14                   ` [PATCH v3 10/16] arch_topology: Set thread sibling cpumask only within the cluster Sudeep Holla
2022-05-25  8:14                     ` [PATCH v3 11/16] arch_topology: Check for non-negative value rather than -1 for IDs validity Sudeep Holla
2022-05-25  8:14                       ` [PATCH v3 12/16] arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found Sudeep Holla
2022-05-25  8:14                         ` [PATCH v3 13/16] arch_topology: Don't set cluster identifier as physical package identifier Sudeep Holla
2022-05-25  8:14                           ` [PATCH v3 14/16] arch_topology: Drop unnecessary check for uninitialised package_id Sudeep Holla
2022-05-25  8:14                             ` [PATCH v3 15/16] arch_topology: Set cluster identifier in each core/thread from /cpu-map Sudeep Holla
2022-05-25  8:14                               ` [PATCH v3 16/16] arch_topology: Add support for parsing sockets in /cpu-map Sudeep Holla
2022-06-03 12:30                               ` [PATCH v3 15/16] arch_topology: Set cluster identifier in each core/thread from /cpu-map Dietmar Eggemann
2022-06-06 10:21                                 ` Sudeep Holla
2022-06-10 10:08                                   ` Vincent Guittot
2022-06-10 10:27                                     ` Sudeep Holla
2022-06-13  9:19                                       ` Dietmar Eggemann
2022-06-13 11:17                                         ` Sudeep Holla
2022-06-16 16:02                                           ` Dietmar Eggemann
2022-06-17 11:16                                             ` Sudeep Holla
2022-06-20 13:27                                               ` Dietmar Eggemann [this message]
2022-06-21 16:00                                                 ` Sudeep Holla
2022-06-14 17:59                                       ` Vincent Guittot
2022-06-15 17:00                                         ` Sudeep Holla
2022-06-15 22:44                                           ` Vincent Guittot
2022-06-15 22:45                                           ` Vincent Guittot
2022-06-01  3:40                         ` [PATCH v3 12/16] arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found Gavin Shan
2022-06-01  3:38                       ` [PATCH v3 11/16] arch_topology: Check for non-negative value rather than -1 for IDs validity Gavin Shan
2022-06-01  3:36                     ` [PATCH v3 10/16] arch_topology: Set thread sibling cpumask only within the cluster Gavin Shan
2022-06-01  3:35                   ` [PATCH v3 09/16] arch_topology: Drop LLC identifier stash from the CPU topology Gavin Shan
2022-06-01 12:06                     ` Sudeep Holla
2022-06-02  6:44                       ` Gavin Shan
2022-06-02  6:42                   ` Gavin Shan
2022-06-02  6:42                 ` [PATCH v3 08/16] arm64: topology: Remove redundant setting of llc_id in " Gavin Shan
2022-06-01  3:31               ` [PATCH v3 07/16] arch_topology: Use the last level cache information from the cacheinfo Gavin Shan
2022-06-02 14:26               ` Dietmar Eggemann
2022-06-06  9:54                 ` Sudeep Holla
2022-06-01  3:29             ` [PATCH v3 06/16] arch_topology: Add support to parse and detect cache attributes Gavin Shan
2022-06-01  3:25           ` [PATCH v3 05/16] cacheinfo: Allow early detection and population of " Gavin Shan
2022-06-01  3:20         ` [PATCH v3 04/16] cacheinfo: Add support to check if last level cache(LLC) is valid or shared Gavin Shan
2022-06-01  2:51       ` [PATCH v3 03/16] cacheinfo: Move cache_leaves_are_shared out of CONFIG_OF Gavin Shan
2022-06-01  2:44     ` [PATCH v3 02/16] cacheinfo: Add helper to access any cache index for a given CPU Gavin Shan
2022-06-01 12:45       ` Sudeep Holla
2022-06-01  2:45   ` [PATCH v3 01/16] cacheinfo: Use of_cpu_device_node_get instead cpu_dev->of_node Gavin Shan
2022-06-01  3:49 ` [PATCH v3 00/16] arch_topology: Updates to add socket support and fix cluster ids Gavin Shan
2022-06-01 12:03   ` Sudeep Holla

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=e7d65b22-67a2-b21a-86e5-a9a1606be4d6@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=atishp@atishpatra.org \
    --cc=atishp@rivosinc.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=morten.rasmussen@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=wangqing@vivo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®