linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids
@ 2022-06-21 19:20 Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address Sudeep Holla
                   ` (20 more replies)
  0 siblings, 21 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv

Hi All,

This version updates cacheinfo to populate and use the information from
there for all the cache topology.

This series intends to fix some discrepancies we have in the CPU topology
parsing from the device tree /cpu-map node. Also this diverges from the
behaviour on a ACPI enabled platform. The expectation is that both DT
and ACPI enabled systems must present consistent view of the CPU topology.

Currently we assign generated cluster count as the physical package identifier
for each CPU which is wrong. The device tree bindings for CPU topology supports
sockets to infer the socket or physical package identifier for a given CPU.
Also we don't check if all the cores/threads belong to the same cluster before
updating their sibling masks which is fine as we don't set the cluster id yet.

These changes also assigns the cluster identifier as parsed from the device tree
cluster nodes within /cpu-map without support for nesting of the clusters.
Finally, it also add support for socket nodes in /cpu-map. With this the
parsing of exact same information from ACPI PPTT and /cpu-map DT node
aligns well.

The only exception is that the last level cache id information can be
inferred from the same ACPI PPTT while we need to parse CPU cache nodes
in the device tree.

Hi Greg,

I had not cc-ed you on earlier 3 versions as we had some disagreement
amongst Arm developers which we have not settled. Let me know how you want to
merge this once you agree with the changes. I can set pull request if
you prefer. Let me know.

v4[3]->v4:
	- Updated ACPI PPTT fw_token to use table offset instead of virtual
	  address as it could get changed for everytime it is mapped before
	  the global acpi_permanent_mmap is set
	- Added warning for the topology with nested clusters
	- Added update to cpu_clustergroup_mask so that introduction of
	  correct cluster_id doesn't break existing platforms by limiting
	  the span of clustergroup_mask(by Ionela)

v2[2]->v3[3]:
        - Dropped support to get the device node for the CPU's LLC
        - Updated cacheinfo to support calling of detect_cache_attributes
          early in smp_prepare_cpus stage
        - Added support to check if LLC is valid and shared in the cacheinfo
        - Used the same in arch_topology

v1[1]->v2[2]:
        - Updated ID validity check include all non-negative value
        - Added support to get the device node for the CPU's last level cache
        - Added support to build llc_sibling on DT platforms

[1] https://lore.kernel.org/lkml/20220513095559.1034633-1-sudeep.holla@arm.com
[2] https://lore.kernel.org/lkml/20220518093325.2070336-1-sudeep.holla@arm.com
[3] https://lore.kernel.org/lkml/20220525081416.3306043-1-sudeep.holla@arm.com


Ionela Voinescu (1):
  arch_topology: Limit span of cpu_clustergroup_mask()

Sudeep Holla (19):
  ACPI: PPTT: Use table offset as fw_token instead of virtual address
  cacheinfo: Use of_cpu_device_node_get instead cpu_dev->of_node
  cacheinfo: Add helper to access any cache index for a given CPU
  cacheinfo: Move cache_leaves_are_shared out of CONFIG_OF
  cacheinfo: Add support to check if last level cache(LLC) is valid or shared
  cacheinfo: Allow early detection and population of cache attributes
  cacheinfo: Use cache identifiers to check if the caches are shared if available
  arch_topology: Add support to parse and detect cache attributes
  arch_topology: Use the last level cache information from the cacheinfo
  arm64: topology: Remove redundant setting of llc_id in CPU topology
  arch_topology: Drop LLC identifier stash from the CPU topology
  arch_topology: Set thread sibling cpumask only within the cluster
  arch_topology: Check for non-negative value rather than -1 for IDs validity
  arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found
  arch_topology: Don't set cluster identifier as physical package identifier
  arch_topology: Drop unnecessary check for uninitialised package_id
  arch_topology: Set cluster identifier in each core/thread from /cpu-map
  arch_topology: Add support for parsing sockets in /cpu-map
  arch_topology: Warn that topology for nested clusters is not supported

 arch/arm64/kernel/topology.c  |  14 ----
 drivers/acpi/pptt.c           |   3 +-
 drivers/base/arch_topology.c  | 102 ++++++++++++++++++---------
 drivers/base/cacheinfo.c      | 127 ++++++++++++++++++++++------------
 include/linux/arch_topology.h |   1 -
 include/linux/cacheinfo.h     |   3 +
 6 files changed, 159 insertions(+), 91 deletions(-)

--
2.36.1


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-22 11:47   ` Rafael J. Wysocki
  2022-06-27 13:41   ` Ionela Voinescu
  2022-06-21 19:20 ` [PATCH v4 02/20] cacheinfo: Use of_cpu_device_node_get instead cpu_dev->of_node Sudeep Holla
                   ` (19 subsequent siblings)
  20 siblings, 2 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	linux-acpi

There is need to use the cache sharing information quite early during
the boot before the secondary cores are up and running. The permanent
memory map for all the ACPI tables(via acpi_permanent_mmap) is turned
on in acpi_early_init() which is quite late for the above requirement.

As a result there is possibility that the ACPI PPTT gets mapped to
different virtual addresses. In such scenarios, using virtual address as
fw_token before the acpi_permanent_mmap is enabled results in different
fw_token for the same cache entity and hence wrong cache sharing
information will be deduced based on the same.

Instead of using virtual address, just use the table offset as the
unique firmware token for the caches. The same offset is used as
ACPI identifiers if the firmware has not set a valid one for other
entries in the ACPI PPTT.

Cc: linux-acpi@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/acpi/pptt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Hi Rafael,

If you are happy with this change, can you provide Ack, so that it can be
merged together with other changes ?

Regards,
Sudeep

diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index 701f61c01359..763f021d45e6 100644
--- a/drivers/acpi/pptt.c
+++ b/drivers/acpi/pptt.c
@@ -437,7 +437,8 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table,
 		pr_debug("found = %p %p\n", found_cache, cpu_node);
 		if (found_cache)
 			update_cache_properties(this_leaf, found_cache,
-			                        cpu_node, table->revision);
+						ACPI_TO_POINTER(ACPI_PTR_DIFF(cpu_node, table)),
+						table->revision);
 
 		index++;
 	}
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 02/20] cacheinfo: Use of_cpu_device_node_get instead cpu_dev->of_node
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 03/20] cacheinfo: Add helper to access any cache index for a given CPU Sudeep Holla
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

The of_cpu_device_node_get takes care of fetching the CPU'd device node
either from cached cpu_dev->of_node if cpu_dev is initialised or uses
of_get_cpu_node to parse and fetch node if cpu_dev isn't available yet.

Just use of_cpu_device_node_get instead of getting the cpu device first
and then using cpu_dev->of_node for two reasons:
1. There is no other use of cpu_dev and can be simplified
2. It enabled the use detect_cache_attributes and hence cache_setup_of_node
   much earlier before the CPUs are registered as devices.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/cacheinfo.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index dad296229161..b0bde272e2ae 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -14,7 +14,7 @@
 #include <linux/cpu.h>
 #include <linux/device.h>
 #include <linux/init.h>
-#include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/smp.h>
@@ -157,7 +157,6 @@ static int cache_setup_of_node(unsigned int cpu)
 {
 	struct device_node *np;
 	struct cacheinfo *this_leaf;
-	struct device *cpu_dev = get_cpu_device(cpu);
 	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
 	unsigned int index = 0;
 
@@ -166,11 +165,7 @@ static int cache_setup_of_node(unsigned int cpu)
 		return 0;
 	}
 
-	if (!cpu_dev) {
-		pr_err("No cpu device for CPU %d\n", cpu);
-		return -ENODEV;
-	}
-	np = cpu_dev->of_node;
+	np = of_cpu_device_node_get(cpu);
 	if (!np) {
 		pr_err("Failed to find cpu%d device node\n", cpu);
 		return -ENOENT;
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 03/20] cacheinfo: Add helper to access any cache index for a given CPU
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 02/20] cacheinfo: Use of_cpu_device_node_get instead cpu_dev->of_node Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 04/20] cacheinfo: Move cache_leaves_are_shared out of CONFIG_OF Sudeep Holla
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

The cacheinfo for a given CPU at a given index is used at quite a few
places by fetching the base point for index 0 using the helper
per_cpu_cacheinfo(cpu) and offseting it by the required index.

Instead, add another helper to fetch the required pointer directly and
use it to simplify and improve readability.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/cacheinfo.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index b0bde272e2ae..e13ef41763e4 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -25,6 +25,8 @@ static DEFINE_PER_CPU(struct cpu_cacheinfo, ci_cpu_cacheinfo);
 #define ci_cacheinfo(cpu)	(&per_cpu(ci_cpu_cacheinfo, cpu))
 #define cache_leaves(cpu)	(ci_cacheinfo(cpu)->num_leaves)
 #define per_cpu_cacheinfo(cpu)	(ci_cacheinfo(cpu)->info_list)
+#define per_cpu_cacheinfo_idx(cpu, idx)		\
+				(per_cpu_cacheinfo(cpu) + (idx))
 
 struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu)
 {
@@ -172,7 +174,7 @@ static int cache_setup_of_node(unsigned int cpu)
 	}
 
 	while (index < cache_leaves(cpu)) {
-		this_leaf = this_cpu_ci->info_list + index;
+		this_leaf = per_cpu_cacheinfo_idx(cpu, index);
 		if (this_leaf->level != 1)
 			np = of_find_next_cache_node(np);
 		else
@@ -231,7 +233,7 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
 	for (index = 0; index < cache_leaves(cpu); index++) {
 		unsigned int i;
 
-		this_leaf = this_cpu_ci->info_list + index;
+		this_leaf = per_cpu_cacheinfo_idx(cpu, index);
 		/* skip if shared_cpu_map is already populated */
 		if (!cpumask_empty(&this_leaf->shared_cpu_map))
 			continue;
@@ -242,7 +244,7 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
 
 			if (i == cpu || !sib_cpu_ci->info_list)
 				continue;/* skip if itself or no cacheinfo */
-			sib_leaf = sib_cpu_ci->info_list + index;
+			sib_leaf = per_cpu_cacheinfo_idx(i, index);
 			if (cache_leaves_are_shared(this_leaf, sib_leaf)) {
 				cpumask_set_cpu(cpu, &sib_leaf->shared_cpu_map);
 				cpumask_set_cpu(i, &this_leaf->shared_cpu_map);
@@ -258,12 +260,11 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
 
 static void cache_shared_cpu_map_remove(unsigned int cpu)
 {
-	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
 	struct cacheinfo *this_leaf, *sib_leaf;
 	unsigned int sibling, index;
 
 	for (index = 0; index < cache_leaves(cpu); index++) {
-		this_leaf = this_cpu_ci->info_list + index;
+		this_leaf = per_cpu_cacheinfo_idx(cpu, index);
 		for_each_cpu(sibling, &this_leaf->shared_cpu_map) {
 			struct cpu_cacheinfo *sib_cpu_ci;
 
@@ -274,7 +275,7 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)
 			if (!sib_cpu_ci->info_list)
 				continue;
 
-			sib_leaf = sib_cpu_ci->info_list + index;
+			sib_leaf = per_cpu_cacheinfo_idx(sibling, index);
 			cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map);
 			cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map);
 		}
@@ -609,7 +610,6 @@ static int cache_add_dev(unsigned int cpu)
 	int rc;
 	struct device *ci_dev, *parent;
 	struct cacheinfo *this_leaf;
-	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
 	const struct attribute_group **cache_groups;
 
 	rc = cpu_cache_sysfs_init(cpu);
@@ -618,7 +618,7 @@ static int cache_add_dev(unsigned int cpu)
 
 	parent = per_cpu_cache_dev(cpu);
 	for (i = 0; i < cache_leaves(cpu); i++) {
-		this_leaf = this_cpu_ci->info_list + i;
+		this_leaf = per_cpu_cacheinfo_idx(cpu, i);
 		if (this_leaf->disable_sysfs)
 			continue;
 		if (this_leaf->type == CACHE_TYPE_NOCACHE)
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 04/20] cacheinfo: Move cache_leaves_are_shared out of CONFIG_OF
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (2 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 03/20] cacheinfo: Add helper to access any cache index for a given CPU Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 05/20] cacheinfo: Add support to check if last level cache(LLC) is valid or shared Sudeep Holla
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

cache_leaves_are_shared is already used even with ACPI and PPTT. It checks
if the cache leaves are the shared based on fw_token pointer. However it is
defined conditionally only if CONFIG_OF is enabled which is wrong.

Move the function cache_leaves_are_shared out of CONFIG_OF and keep it
generic. It also handles the case where both OF and ACPI is not defined.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/cacheinfo.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index e13ef41763e4..2cea9201f31c 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -33,13 +33,21 @@ struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu)
 	return ci_cacheinfo(cpu);
 }
 
-#ifdef CONFIG_OF
 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
 					   struct cacheinfo *sib_leaf)
 {
+	/*
+	 * For non DT/ACPI systems, assume unique level 1 caches,
+	 * system-wide shared caches for all other levels. This will be used
+	 * only if arch specific code has not populated shared_cpu_map
+	 */
+	if (!(IS_ENABLED(CONFIG_OF) || IS_ENABLED(CONFIG_ACPI)))
+		return !(this_leaf->level == 1);
+
 	return sib_leaf->fw_token == this_leaf->fw_token;
 }
 
+#ifdef CONFIG_OF
 /* OF properties to query for a given cache type */
 struct cache_type_info {
 	const char *size_prop;
@@ -193,16 +201,6 @@ static int cache_setup_of_node(unsigned int cpu)
 }
 #else
 static inline int cache_setup_of_node(unsigned int cpu) { return 0; }
-static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
-					   struct cacheinfo *sib_leaf)
-{
-	/*
-	 * For non-DT/ACPI systems, assume unique level 1 caches, system-wide
-	 * shared caches for all other levels. This will be used only if
-	 * arch specific code has not populated shared_cpu_map
-	 */
-	return !(this_leaf->level == 1);
-}
 #endif
 
 int __weak cache_setup_acpi(unsigned int cpu)
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 05/20] cacheinfo: Add support to check if last level cache(LLC) is valid or shared
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (3 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 04/20] cacheinfo: Move cache_leaves_are_shared out of CONFIG_OF Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 06/20] cacheinfo: Allow early detection and population of cache attributes Sudeep Holla
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

It is useful to have helper to check if the given two CPUs share last level
cache. We can do that check by comparing fw_token or by comparing the cache
ID. Currently we check just for fw_token as the cache ID is optional.

This helper can be used to build the llc_sibling during arch specific
topology parsing and feeding information to the sched_domains. This also
helps to get rid of llc_id in the CPU topology as it is sort of duplicate
information.

Also add helper to check if the llc information in cacheinfo is valid or not.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/cacheinfo.c  | 26 ++++++++++++++++++++++++++
 include/linux/cacheinfo.h |  2 ++
 2 files changed, 28 insertions(+)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index 2cea9201f31c..fdc1baa342f1 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -47,6 +47,32 @@ static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
 	return sib_leaf->fw_token == this_leaf->fw_token;
 }
 
+bool last_level_cache_is_valid(unsigned int cpu)
+{
+	struct cacheinfo *llc;
+
+	if (!cache_leaves(cpu))
+		return false;
+
+	llc = per_cpu_cacheinfo_idx(cpu, cache_leaves(cpu) - 1);
+
+	return !!llc->fw_token;
+}
+
+bool last_level_cache_is_shared(unsigned int cpu_x, unsigned int cpu_y)
+{
+	struct cacheinfo *llc_x, *llc_y;
+
+	if (!last_level_cache_is_valid(cpu_x) ||
+	    !last_level_cache_is_valid(cpu_y))
+		return false;
+
+	llc_x = per_cpu_cacheinfo_idx(cpu_x, cache_leaves(cpu_x) - 1);
+	llc_y = per_cpu_cacheinfo_idx(cpu_y, cache_leaves(cpu_y) - 1);
+
+	return cache_leaves_are_shared(llc_x, llc_y);
+}
+
 #ifdef CONFIG_OF
 /* OF properties to query for a given cache type */
 struct cache_type_info {
diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
index 4ff37cb763ae..7e429bc5c1a4 100644
--- a/include/linux/cacheinfo.h
+++ b/include/linux/cacheinfo.h
@@ -82,6 +82,8 @@ struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu);
 int init_cache_level(unsigned int cpu);
 int populate_cache_leaves(unsigned int cpu);
 int cache_setup_acpi(unsigned int cpu);
+bool last_level_cache_is_valid(unsigned int cpu);
+bool last_level_cache_is_shared(unsigned int cpu_x, unsigned int cpu_y);
 #ifndef CONFIG_ACPI_PPTT
 /*
  * acpi_find_last_cache_level is only called on ACPI enabled
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 06/20] cacheinfo: Allow early detection and population of cache attributes
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (4 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 05/20] cacheinfo: Add support to check if last level cache(LLC) is valid or shared Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 07/20] cacheinfo: Use cache identifiers to check if the caches are shared if available Sudeep Holla
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

Some architecture/platforms may need to setup cache properties very
early in the boot along with other cpu topologies so that all these
information can be used to build sched_domains which is used by the
scheduler.

Allow detect_cache_attributes to be called quite early during the boot.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/cacheinfo.c  | 51 ++++++++++++++++++++++++++-------------
 include/linux/cacheinfo.h |  1 +
 2 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index fdc1baa342f1..2aa9e8e341b7 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -193,14 +193,8 @@ static int cache_setup_of_node(unsigned int cpu)
 {
 	struct device_node *np;
 	struct cacheinfo *this_leaf;
-	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
 	unsigned int index = 0;
 
-	/* skip if fw_token is already populated */
-	if (this_cpu_ci->info_list->fw_token) {
-		return 0;
-	}
-
 	np = of_cpu_device_node_get(cpu);
 	if (!np) {
 		pr_err("Failed to find cpu%d device node\n", cpu);
@@ -236,6 +230,18 @@ int __weak cache_setup_acpi(unsigned int cpu)
 
 unsigned int coherency_max_size;
 
+static int cache_setup_properties(unsigned int cpu)
+{
+	int ret = 0;
+
+	if (of_have_populated_dt())
+		ret = cache_setup_of_node(cpu);
+	else if (!acpi_disabled)
+		ret = cache_setup_acpi(cpu);
+
+	return ret;
+}
+
 static int cache_shared_cpu_map_setup(unsigned int cpu)
 {
 	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
@@ -246,21 +252,21 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
 	if (this_cpu_ci->cpu_map_populated)
 		return 0;
 
-	if (of_have_populated_dt())
-		ret = cache_setup_of_node(cpu);
-	else if (!acpi_disabled)
-		ret = cache_setup_acpi(cpu);
-
-	if (ret)
-		return ret;
+	/*
+	 * skip setting up cache properties if LLC is valid, just need
+	 * to update the shared cpu_map if the cache attributes were
+	 * populated early before all the cpus are brought online
+	 */
+	if (!last_level_cache_is_valid(cpu)) {
+		ret = cache_setup_properties(cpu);
+		if (ret)
+			return ret;
+	}
 
 	for (index = 0; index < cache_leaves(cpu); index++) {
 		unsigned int i;
 
 		this_leaf = per_cpu_cacheinfo_idx(cpu, index);
-		/* skip if shared_cpu_map is already populated */
-		if (!cpumask_empty(&this_leaf->shared_cpu_map))
-			continue;
 
 		cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map);
 		for_each_online_cpu(i) {
@@ -330,10 +336,19 @@ int __weak populate_cache_leaves(unsigned int cpu)
 	return -ENOENT;
 }
 
-static int detect_cache_attributes(unsigned int cpu)
+int detect_cache_attributes(unsigned int cpu)
 {
 	int ret;
 
+	/* Since early detection of the cacheinfo is allowed via this
+	 * function and this also gets called as CPU hotplug callbacks via
+	 * cacheinfo_cpu_online, the initialisation can be skipped and only
+	 * CPU maps can be updated as the CPU online status would be update
+	 * if called via cacheinfo_cpu_online path.
+	 */
+	if (per_cpu_cacheinfo(cpu))
+		goto update_cpu_map;
+
 	if (init_cache_level(cpu) || !cache_leaves(cpu))
 		return -ENOENT;
 
@@ -349,6 +364,8 @@ static int detect_cache_attributes(unsigned int cpu)
 	ret = populate_cache_leaves(cpu);
 	if (ret)
 		goto free_ci;
+
+update_cpu_map:
 	/*
 	 * For systems using DT for cache hierarchy, fw_token
 	 * and shared_cpu_map will be set up here only if they are
diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
index 7e429bc5c1a4..00b7a6ae8617 100644
--- a/include/linux/cacheinfo.h
+++ b/include/linux/cacheinfo.h
@@ -84,6 +84,7 @@ int populate_cache_leaves(unsigned int cpu);
 int cache_setup_acpi(unsigned int cpu);
 bool last_level_cache_is_valid(unsigned int cpu);
 bool last_level_cache_is_shared(unsigned int cpu_x, unsigned int cpu_y);
+int detect_cache_attributes(unsigned int cpu);
 #ifndef CONFIG_ACPI_PPTT
 /*
  * acpi_find_last_cache_level is only called on ACPI enabled
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 07/20] cacheinfo: Use cache identifiers to check if the caches are shared if available
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (5 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 06/20] cacheinfo: Allow early detection and population of cache attributes Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 08/20] arch_topology: Add support to parse and detect cache attributes Sudeep Holla
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv

The cache identifiers is an optional property on most of the platforms. The
presence of one must be indicated by the CACHE_ID valid bit in the attributes.

We can use the cache identifiers provided by the firmware to check if any
two cpus share the same cache instead of relying on the fw_token generated
and set in the OS.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/cacheinfo.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index 2aa9e8e341b7..167abfa6f37d 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -44,6 +44,10 @@ static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
 	if (!(IS_ENABLED(CONFIG_OF) || IS_ENABLED(CONFIG_ACPI)))
 		return !(this_leaf->level == 1);
 
+	if ((sib_leaf->attributes & CACHE_ID) &&
+	    (this_leaf->attributes & CACHE_ID))
+		return sib_leaf->id == this_leaf->id;
+
 	return sib_leaf->fw_token == this_leaf->fw_token;
 }
 
@@ -56,7 +60,8 @@ bool last_level_cache_is_valid(unsigned int cpu)
 
 	llc = per_cpu_cacheinfo_idx(cpu, cache_leaves(cpu) - 1);
 
-	return !!llc->fw_token;
+	return (llc->attributes & CACHE_ID) || !!llc->fw_token;
+
 }
 
 bool last_level_cache_is_shared(unsigned int cpu_x, unsigned int cpu_y)
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 08/20] arch_topology: Add support to parse and detect cache attributes
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (6 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 07/20] cacheinfo: Use cache identifiers to check if the caches are shared if available Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 09/20] arch_topology: Use the last level cache information from the cacheinfo Sudeep Holla
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

Currently ACPI populates just the minimum information about the last
level cache from PPTT in order to feed the same to build sched_domains.
Similar support for DT platforms is not present.

In order to enable the same, the entire cache hierarchy information can
be built as part of CPU topoplogy parsing both on ACPI and DT platforms.

Note that this change builds the cacheinfo early even on ACPI systems, but
the current mechanism of building llc_sibling mask remains unchanged.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 579c851a2bd7..23cb52180ce3 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/cacheinfo.h>
 #include <linux/cpu.h>
 #include <linux/cpufreq.h>
 #include <linux/device.h>
@@ -780,15 +781,23 @@ __weak int __init parse_acpi_topology(void)
 #if defined(CONFIG_ARM64) || defined(CONFIG_RISCV)
 void __init init_cpu_topology(void)
 {
+	int ret, cpu;
+
 	reset_cpu_topology();
+	ret = parse_acpi_topology();
+	if (!ret)
+		ret = of_have_populated_dt() && parse_dt_topology();
 
-	/*
-	 * Discard anything that was parsed if we hit an error so we
-	 * don't use partial information.
-	 */
-	if (parse_acpi_topology())
-		reset_cpu_topology();
-	else if (of_have_populated_dt() && parse_dt_topology())
+	if (ret) {
+		/*
+		 * Discard anything that was parsed if we hit an error so we
+		 * don't use partial information.
+		 */
 		reset_cpu_topology();
+		return;
+	}
+
+	for_each_possible_cpu(cpu)
+		detect_cache_attributes(cpu);
 }
 #endif
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 09/20] arch_topology: Use the last level cache information from the cacheinfo
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (7 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 08/20] arch_topology: Add support to parse and detect cache attributes Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 10/20] arm64: topology: Remove redundant setting of llc_id in CPU topology Sudeep Holla
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

The cacheinfo is now initialised early along with the CPU topology
initialisation. Instead of relying on the LLC ID information parsed
separately only with ACPI PPTT elsewhere, migrate to use the similar
information from the cacheinfo.

This is generic for both DT and ACPI systems. The ACPI LLC ID information
parsed separately can now be removed from arch specific code.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 23cb52180ce3..c314c7064397 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -668,7 +668,8 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
 		/* not numa in package, lets use the package siblings */
 		core_mask = &cpu_topology[cpu].core_sibling;
 	}
-	if (cpu_topology[cpu].llc_id != -1) {
+
+	if (last_level_cache_is_valid(cpu)) {
 		if (cpumask_subset(&cpu_topology[cpu].llc_sibling, core_mask))
 			core_mask = &cpu_topology[cpu].llc_sibling;
 	}
@@ -699,7 +700,7 @@ void update_siblings_masks(unsigned int cpuid)
 	for_each_online_cpu(cpu) {
 		cpu_topo = &cpu_topology[cpu];
 
-		if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) {
+		if (last_level_cache_is_shared(cpu, cpuid)) {
 			cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling);
 			cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling);
 		}
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 10/20] arm64: topology: Remove redundant setting of llc_id in CPU topology
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (8 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 09/20] arch_topology: Use the last level cache information from the cacheinfo Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-23 15:55   ` Catalin Marinas
  2022-06-21 19:20 ` [PATCH v4 11/20] arch_topology: Drop LLC identifier stash from the " Sudeep Holla
                   ` (10 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Will Deacon, Catalin Marinas, Gavin Shan

Since the cacheinfo LLC information is used directly in arch_topology,
there is no need to parse and fetch the LLC ID information only for
ACPI systems.

Just drop the redundant parsing and setting of llc_id in CPU topology
from ACPI PPTT.

Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm64/kernel/topology.c | 14 --------------
 1 file changed, 14 deletions(-)

Hi Will/Catalin,

This is part of a series updating topology to get both ACPI and DT view
aligned. I have not cc-ed you assuming you won't be interested. Let me
know if you are. The parts affecting arm64 is just this patch removing
some unnecessary ACPI code that is now moved to core arch_topology.c

Please ack if you are happy with this and OK to take this as part of the
series.

Regards,
Sudeep

diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index 9ab78ad826e2..869ffc4d4484 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -89,8 +89,6 @@ int __init parse_acpi_topology(void)
 		return 0;
 
 	for_each_possible_cpu(cpu) {
-		int i, cache_id;
-
 		topology_id = find_acpi_cpu_topology(cpu, 0);
 		if (topology_id < 0)
 			return topology_id;
@@ -107,18 +105,6 @@ int __init parse_acpi_topology(void)
 		cpu_topology[cpu].cluster_id = topology_id;
 		topology_id = find_acpi_cpu_topology_package(cpu);
 		cpu_topology[cpu].package_id = topology_id;
-
-		i = acpi_find_last_cache_level(cpu);
-
-		if (i > 0) {
-			/*
-			 * this is the only part of cpu_topology that has
-			 * a direct relationship with the cache topology
-			 */
-			cache_id = find_acpi_cpu_cache_topology(cpu, i);
-			if (cache_id > 0)
-				cpu_topology[cpu].llc_id = cache_id;
-		}
 	}
 
 	return 0;
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 11/20] arch_topology: Drop LLC identifier stash from the CPU topology
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (9 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 10/20] arm64: topology: Remove redundant setting of llc_id in CPU topology Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 12/20] arch_topology: Set thread sibling cpumask only within the cluster Sudeep Holla
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

Since the cacheinfo LLC information is used directly in arch_topology,
there is no need to parse and store the LLC ID information only for
ACPI systems in the CPU topology.

Remove the redundant LLC ID from the generic CPU arch_topology information.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c  | 1 -
 include/linux/arch_topology.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index c314c7064397..b63cc52e12ce 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -752,7 +752,6 @@ void __init reset_cpu_topology(void)
 		cpu_topo->core_id = -1;
 		cpu_topo->cluster_id = -1;
 		cpu_topo->package_id = -1;
-		cpu_topo->llc_id = -1;
 
 		clear_cpu_topology(cpu);
 	}
diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h
index 58cbe18d825c..a07b510e7dc5 100644
--- a/include/linux/arch_topology.h
+++ b/include/linux/arch_topology.h
@@ -68,7 +68,6 @@ struct cpu_topology {
 	int core_id;
 	int cluster_id;
 	int package_id;
-	int llc_id;
 	cpumask_t thread_sibling;
 	cpumask_t core_sibling;
 	cpumask_t cluster_sibling;
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 12/20] arch_topology: Set thread sibling cpumask only within the cluster
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (10 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 11/20] arch_topology: Drop LLC identifier stash from the " Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-27 13:42   ` Ionela Voinescu
  2022-06-21 19:20 ` [PATCH v4 13/20] arch_topology: Check for non-negative value rather than -1 for IDs validity Sudeep Holla
                   ` (8 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

Currently the cluster identifier is not set on the DT based platforms.
The reset or default value is -1 for all the CPUs. Once we assign the
cluster identifier values correctly that imay result in getting the thread
siblings wrongs as the core identifiers can be same for 2 different CPUs
belonging to 2 different cluster.

So, in order to get the thread sibling cpumasks correct, we need to
update them only if the cores they belong are in the same cluster within
the socket. Let us skip updation of the thread sibling cpumaks if the
cluster identifier doesn't match.

This change won't affect even if the cluster identifiers are not set
currently but will avoid any breakage once we set the same correctly.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Tested-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index b63cc52e12ce..7a5ff1ea5f00 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -708,15 +708,17 @@ void update_siblings_masks(unsigned int cpuid)
 		if (cpuid_topo->package_id != cpu_topo->package_id)
 			continue;
 
-		if (cpuid_topo->cluster_id == cpu_topo->cluster_id &&
-		    cpuid_topo->cluster_id != -1) {
+		cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
+		cpumask_set_cpu(cpu, &cpuid_topo->core_sibling);
+
+		if (cpuid_topo->cluster_id != cpu_topo->cluster_id)
+			continue;
+
+		if (cpuid_topo->cluster_id != -1) {
 			cpumask_set_cpu(cpu, &cpuid_topo->cluster_sibling);
 			cpumask_set_cpu(cpuid, &cpu_topo->cluster_sibling);
 		}
 
-		cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
-		cpumask_set_cpu(cpu, &cpuid_topo->core_sibling);
-
 		if (cpuid_topo->core_id != cpu_topo->core_id)
 			continue;
 
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 13/20] arch_topology: Check for non-negative value rather than -1 for IDs validity
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (11 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 12/20] arch_topology: Set thread sibling cpumask only within the cluster Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 14/20] arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found Sudeep Holla
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan, Andy Shevchenko

Instead of just comparing the cpu topology IDs with -1 to check their
validity, improve that by checking for a valid non-negative value.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 7a5ff1ea5f00..ef90d9c00d9e 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -642,7 +642,7 @@ static int __init parse_dt_topology(void)
 	 * only mark cores described in the DT as possible.
 	 */
 	for_each_possible_cpu(cpu)
-		if (cpu_topology[cpu].package_id == -1)
+		if (cpu_topology[cpu].package_id < 0)
 			ret = -EINVAL;
 
 out_map:
@@ -714,7 +714,7 @@ void update_siblings_masks(unsigned int cpuid)
 		if (cpuid_topo->cluster_id != cpu_topo->cluster_id)
 			continue;
 
-		if (cpuid_topo->cluster_id != -1) {
+		if (cpuid_topo->cluster_id >= 0) {
 			cpumask_set_cpu(cpu, &cpuid_topo->cluster_sibling);
 			cpumask_set_cpu(cpuid, &cpu_topo->cluster_sibling);
 		}
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 14/20] arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (12 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 13/20] arch_topology: Check for non-negative value rather than -1 for IDs validity Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 15/20] arch_topology: Don't set cluster identifier as physical package identifier Sudeep Holla
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Gavin Shan

There is no point in looping through all the CPU's physical package
identifier to check if it is valid or not once a CPU which is outside
the topology(i.e. outlier CPU) is found.

Let us just break out of the loop early in such case.

Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index ef90d9c00d9e..7a569aefe313 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -642,8 +642,10 @@ static int __init parse_dt_topology(void)
 	 * only mark cores described in the DT as possible.
 	 */
 	for_each_possible_cpu(cpu)
-		if (cpu_topology[cpu].package_id < 0)
+		if (cpu_topology[cpu].package_id < 0) {
 			ret = -EINVAL;
+			break;
+		}
 
 out_map:
 	of_node_put(map);
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 15/20] arch_topology: Don't set cluster identifier as physical package identifier
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (13 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 14/20] arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-27 13:43   ` Ionela Voinescu
  2022-06-21 19:20 ` [PATCH v4 16/20] arch_topology: Drop unnecessary check for uninitialised package_id Sudeep Holla
                   ` (5 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv

Currently as we parse the CPU topology from /cpu-map node from the
device tree, we assign generated cluster count as the physical package
identifier for each CPU which is wrong.

The device tree bindings for CPU topology supports sockets to infer
the socket or physical package identifier for a given CPU. Since it is
fairly new and not support on most of the old and existing systems, we
can assume all such systems have single socket/physical package.

Fix the physical package identifier to 0 by removing the assignment of
cluster identifier to the same.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 7a569aefe313..46fa1b70b02b 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -549,7 +549,6 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
 	bool leaf = true;
 	bool has_cores = false;
 	struct device_node *c;
-	static int package_id __initdata;
 	int core_id = 0;
 	int i, ret;
 
@@ -588,7 +587,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
 			}
 
 			if (leaf) {
-				ret = parse_core(c, package_id, core_id++);
+				ret = parse_core(c, 0, core_id++);
 			} else {
 				pr_err("%pOF: Non-leaf cluster with core %s\n",
 				       cluster, name);
@@ -605,9 +604,6 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
 	if (leaf && !has_cores)
 		pr_warn("%pOF: empty cluster\n", cluster);
 
-	if (leaf)
-		package_id++;
-
 	return 0;
 }
 
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 16/20] arch_topology: Drop unnecessary check for uninitialised package_id
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (14 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 15/20] arch_topology: Don't set cluster identifier as physical package identifier Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-27 13:12   ` Ionela Voinescu
  2022-06-21 19:20 ` [PATCH v4 17/20] arch_topology: Limit span of cpu_clustergroup_mask() Sudeep Holla
                   ` (4 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv

With the support of socket node parsing from the device tree and
assigning 0 as package_id in absence of socket nodes, there is no need
to check for invalid package_id. It is always initialised to 0 or values
from the device tree socket nodes.

Just drop that now redundant check for uninitialised package_id.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 46fa1b70b02b..42448a5a9412 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -611,7 +611,6 @@ static int __init parse_dt_topology(void)
 {
 	struct device_node *cn, *map;
 	int ret = 0;
-	int cpu;
 
 	cn = of_find_node_by_path("/cpus");
 	if (!cn) {
@@ -633,16 +632,6 @@ static int __init parse_dt_topology(void)
 
 	topology_normalize_cpu_scale();
 
-	/*
-	 * Check that all cores are in the topology; the SMP code will
-	 * only mark cores described in the DT as possible.
-	 */
-	for_each_possible_cpu(cpu)
-		if (cpu_topology[cpu].package_id < 0) {
-			ret = -EINVAL;
-			break;
-		}
-
 out_map:
 	of_node_put(map);
 out:
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 17/20] arch_topology: Limit span of cpu_clustergroup_mask()
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (15 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 16/20] arch_topology: Drop unnecessary check for uninitialised package_id Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-21 19:20 ` [PATCH v4 18/20] arch_topology: Set cluster identifier in each core/thread from /cpu-map Sudeep Holla
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Darren Hart

From: Ionela Voinescu <ionela.voinescu@arm.com>

Currently the cluster identifier is not set on DT based platforms.
The reset or default value is -1 for all the CPUs. Once we assign the
cluster identifier values correctly, the cluster_sibling mask will be
populated and returned by cpu_clustergroup_mask() to contribute in the
creation of the CLS scheduling domain level, if SCHED_CLUSTER is
enabled.

To avoid topologies that will result in questionable or incorrect
scheduling domains, impose restrictions regarding the span of clusters,
as presented to scheduling domains building code: cluster_sibling should
not span more or the same CPUs as cpu_coregroup_mask().

This is needed in order to obtain a strict separation between the MC and
CLS levels, and maintain the same domains for existing platforms in
the presence of CONFIG_SCHED_CLUSTER, where the new cluster information
is redundant and irrelevant for the scheduler.

While previously the scheduling domain builder code would have removed MC
as redundant and kept CLS if SCHED_CLUSTER was enabled and the
cpu_coregroup_mask() and cpu_clustergroup_mask() spanned the same CPUs,
now CLS will be removed and MC kept.

Cc: Darren Hart <darren@os.amperecomputing.com>
Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 42448a5a9412..39be5dbaf4da 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -675,6 +675,14 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
 
 const struct cpumask *cpu_clustergroup_mask(int cpu)
 {
+	/*
+	 * Forbid cpu_clustergroup_mask() to span more or the same CPUs as
+	 * cpu_coregroup_mask().
+	 */
+	if (cpumask_subset(cpu_coregroup_mask(cpu),
+			  &cpu_topology[cpu].cluster_sibling))
+		return get_cpu_mask(cpu);
+
 	return &cpu_topology[cpu].cluster_sibling;
 }
 
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 18/20] arch_topology: Set cluster identifier in each core/thread from /cpu-map
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (16 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 17/20] arch_topology: Limit span of cpu_clustergroup_mask() Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-27 13:47   ` Ionela Voinescu
  2022-06-21 19:20 ` [PATCH v4 19/20] arch_topology: Add support for parsing sockets in /cpu-map Sudeep Holla
                   ` (2 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv

Let us set the cluster identifier as parsed from the device tree
cluster nodes within /cpu-map.

We don't support nesting of clusters yet as there are no real hardware
to support clusters of clusters.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 39be5dbaf4da..75604f783bfc 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -497,7 +497,7 @@ static int __init get_cpu_for_node(struct device_node *node)
 }
 
 static int __init parse_core(struct device_node *core, int package_id,
-			     int core_id)
+			     int cluster_id, int core_id)
 {
 	char name[20];
 	bool leaf = true;
@@ -513,6 +513,7 @@ static int __init parse_core(struct device_node *core, int package_id,
 			cpu = get_cpu_for_node(t);
 			if (cpu >= 0) {
 				cpu_topology[cpu].package_id = package_id;
+				cpu_topology[cpu].cluster_id = cluster_id;
 				cpu_topology[cpu].core_id = core_id;
 				cpu_topology[cpu].thread_id = i;
 			} else if (cpu != -ENODEV) {
@@ -534,6 +535,7 @@ static int __init parse_core(struct device_node *core, int package_id,
 		}
 
 		cpu_topology[cpu].package_id = package_id;
+		cpu_topology[cpu].cluster_id = cluster_id;
 		cpu_topology[cpu].core_id = core_id;
 	} else if (leaf && cpu != -ENODEV) {
 		pr_err("%pOF: Can't get CPU for leaf core\n", core);
@@ -543,7 +545,8 @@ static int __init parse_core(struct device_node *core, int package_id,
 	return 0;
 }
 
-static int __init parse_cluster(struct device_node *cluster, int depth)
+static int __init
+parse_cluster(struct device_node *cluster, int cluster_id, int depth)
 {
 	char name[20];
 	bool leaf = true;
@@ -563,7 +566,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
 		c = of_get_child_by_name(cluster, name);
 		if (c) {
 			leaf = false;
-			ret = parse_cluster(c, depth + 1);
+			ret = parse_cluster(c, i, depth + 1);
 			of_node_put(c);
 			if (ret != 0)
 				return ret;
@@ -587,7 +590,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
 			}
 
 			if (leaf) {
-				ret = parse_core(c, 0, core_id++);
+				ret = parse_core(c, 0, cluster_id, core_id++);
 			} else {
 				pr_err("%pOF: Non-leaf cluster with core %s\n",
 				       cluster, name);
@@ -626,7 +629,7 @@ static int __init parse_dt_topology(void)
 	if (!map)
 		goto out;
 
-	ret = parse_cluster(map, 0);
+	ret = parse_cluster(map, -1, 0);
 	if (ret != 0)
 		goto out_map;
 
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 19/20] arch_topology: Add support for parsing sockets in /cpu-map
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (17 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 18/20] arch_topology: Set cluster identifier in each core/thread from /cpu-map Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-27 13:47   ` Ionela Voinescu
  2022-06-21 19:20 ` [PATCH v4 20/20] arch_topology: Warn that topology for nested clusters is not supported Sudeep Holla
  2022-06-27 13:54 ` [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Ionela Voinescu
  20 siblings, 1 reply; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv

Finally let us add support for socket nodes in /cpu-map in the device
tree. Since this may not be present in all the old platforms and even
most of the existing platforms, we need to assume absence of the socket
node indicates that it is a single socket system and handle appropriately.

Also it is likely that most single socket systems skip to as the node
since it is optional.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 37 +++++++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 75604f783bfc..ed1cb64a95aa 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -545,8 +545,8 @@ static int __init parse_core(struct device_node *core, int package_id,
 	return 0;
 }
 
-static int __init
-parse_cluster(struct device_node *cluster, int cluster_id, int depth)
+static int __init parse_cluster(struct device_node *cluster, int package_id,
+				int cluster_id, int depth)
 {
 	char name[20];
 	bool leaf = true;
@@ -566,7 +566,7 @@ parse_cluster(struct device_node *cluster, int cluster_id, int depth)
 		c = of_get_child_by_name(cluster, name);
 		if (c) {
 			leaf = false;
-			ret = parse_cluster(c, i, depth + 1);
+			ret = parse_cluster(c, package_id, i, depth + 1);
 			of_node_put(c);
 			if (ret != 0)
 				return ret;
@@ -590,7 +590,8 @@ parse_cluster(struct device_node *cluster, int cluster_id, int depth)
 			}
 
 			if (leaf) {
-				ret = parse_core(c, 0, cluster_id, core_id++);
+				ret = parse_core(c, package_id, cluster_id,
+						 core_id++);
 			} else {
 				pr_err("%pOF: Non-leaf cluster with core %s\n",
 				       cluster, name);
@@ -610,6 +611,32 @@ parse_cluster(struct device_node *cluster, int cluster_id, int depth)
 	return 0;
 }
 
+static int __init parse_socket(struct device_node *socket)
+{
+	char name[20];
+	struct device_node *c;
+	bool has_socket = false;
+	int package_id = 0, ret;
+
+	do {
+		snprintf(name, sizeof(name), "socket%d", package_id);
+		c = of_get_child_by_name(socket, name);
+		if (c) {
+			has_socket = true;
+			ret = parse_cluster(c, package_id, -1, 0);
+			of_node_put(c);
+			if (ret != 0)
+				return ret;
+		}
+		package_id++;
+	} while (c);
+
+	if (!has_socket)
+		ret = parse_cluster(socket, 0, -1, 0);
+
+	return ret;
+}
+
 static int __init parse_dt_topology(void)
 {
 	struct device_node *cn, *map;
@@ -629,7 +656,7 @@ static int __init parse_dt_topology(void)
 	if (!map)
 		goto out;
 
-	ret = parse_cluster(map, -1, 0);
+	ret = parse_socket(map);
 	if (ret != 0)
 		goto out_map;
 
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 20/20] arch_topology: Warn that topology for nested clusters is not supported
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (18 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 19/20] arch_topology: Add support for parsing sockets in /cpu-map Sudeep Holla
@ 2022-06-21 19:20 ` Sudeep Holla
  2022-06-22 15:06   ` Ionela Voinescu
  2022-06-27 13:54 ` [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Ionela Voinescu
  20 siblings, 1 reply; 34+ messages in thread
From: Sudeep Holla @ 2022-06-21 19:20 UTC (permalink / raw)
  To: linux-kernel, Greg KH
  Cc: Sudeep Holla, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv

We don't support the topology for clusters of CPU clusters while the
DT and ACPI bindings theoritcally support the same. Just warn about the
same so that it is clear to the users of arch_topology that the nested
clusters are not yet supported.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/arch_topology.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index ed1cb64a95aa..1c5fa7bbbd00 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -567,6 +567,8 @@ static int __init parse_cluster(struct device_node *cluster, int package_id,
 		if (c) {
 			leaf = false;
 			ret = parse_cluster(c, package_id, i, depth + 1);
+			if (depth > 1)
+				pr_warn("Topology for clusters of clusters not yet supported\n");
 			of_node_put(c);
 			if (ret != 0)
 				return ret;
-- 
2.36.1


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

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address
  2022-06-21 19:20 ` [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address Sudeep Holla
@ 2022-06-22 11:47   ` Rafael J. Wysocki
  2022-06-27 13:41   ` Ionela Voinescu
  1 sibling, 0 replies; 34+ messages in thread
From: Rafael J. Wysocki @ 2022-06-22 11:47 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Linux Kernel Mailing List, Greg KH, Atish Patra, Atish Patra,
	Vincent Guittot, Dietmar Eggemann, Qing Wang, Rob Herring,
	Rafael J . Wysocki, Ionela Voinescu, Pierre Gondois, Linux ARM,
	linux-riscv, ACPI Devel Maling List

On Tue, Jun 21, 2022 at 9:20 PM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> There is need to use the cache sharing information quite early during
> the boot before the secondary cores are up and running. The permanent
> memory map for all the ACPI tables(via acpi_permanent_mmap) is turned
> on in acpi_early_init() which is quite late for the above requirement.
>
> As a result there is possibility that the ACPI PPTT gets mapped to
> different virtual addresses. In such scenarios, using virtual address as
> fw_token before the acpi_permanent_mmap is enabled results in different
> fw_token for the same cache entity and hence wrong cache sharing
> information will be deduced based on the same.
>
> Instead of using virtual address, just use the table offset as the
> unique firmware token for the caches. The same offset is used as
> ACPI identifiers if the firmware has not set a valid one for other
> entries in the ACPI PPTT.
>
> Cc: linux-acpi@vger.kernel.org
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/acpi/pptt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> Hi Rafael,
>
> If you are happy with this change, can you provide Ack, so that it can be
> merged together with other changes ?

No objections:

Acked-by: Rafael J. Wysocki <rafael@kernel.org>

> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> index 701f61c01359..763f021d45e6 100644
> --- a/drivers/acpi/pptt.c
> +++ b/drivers/acpi/pptt.c
> @@ -437,7 +437,8 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table,
>                 pr_debug("found = %p %p\n", found_cache, cpu_node);
>                 if (found_cache)
>                         update_cache_properties(this_leaf, found_cache,
> -                                               cpu_node, table->revision);
> +                                               ACPI_TO_POINTER(ACPI_PTR_DIFF(cpu_node, table)),
> +                                               table->revision);
>
>                 index++;
>         }
> --
> 2.36.1
>

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 20/20] arch_topology: Warn that topology for nested clusters is not supported
  2022-06-21 19:20 ` [PATCH v4 20/20] arch_topology: Warn that topology for nested clusters is not supported Sudeep Holla
@ 2022-06-22 15:06   ` Ionela Voinescu
  2022-06-22 15:46     ` Sudeep Holla
  0 siblings, 1 reply; 34+ messages in thread
From: Ionela Voinescu @ 2022-06-22 15:06 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv

Hi,

I just noticed this in a quick test.

On Tuesday 21 Jun 2022 at 20:20:34 (+0100), Sudeep Holla wrote:
> We don't support the topology for clusters of CPU clusters while the
> DT and ACPI bindings theoritcally support the same. Just warn about the
> same so that it is clear to the users of arch_topology that the nested
> clusters are not yet supported.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/base/arch_topology.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index ed1cb64a95aa..1c5fa7bbbd00 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -567,6 +567,8 @@ static int __init parse_cluster(struct device_node *cluster, int package_id,
>  		if (c) {
>  			leaf = false;
>  			ret = parse_cluster(c, package_id, i, depth + 1);
> +			if (depth > 1)
> +				pr_warn("Topology for clusters of clusters not yet supported\n");

I think the check should be for (depth > 0) or (depth >= 1).

We end up having depth = 2 when we have

cluster 0 {
	//depth is 0
	cluster 0 {
		//depth is 1
		cluster0 {
			//depth is 2
...

I suppose we should warn about nested clusters from depth 1, right?

Thanks,
Ionela.

>  			of_node_put(c);
>  			if (ret != 0)
>  				return ret;
> -- 
> 2.36.1
> 

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 20/20] arch_topology: Warn that topology for nested clusters is not supported
  2022-06-22 15:06   ` Ionela Voinescu
@ 2022-06-22 15:46     ` Sudeep Holla
  0 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-22 15:46 UTC (permalink / raw)
  To: Ionela Voinescu
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, Sudeep Holla, linux-arm-kernel, linux-riscv

On Wed, Jun 22, 2022 at 04:06:29PM +0100, Ionela Voinescu wrote:
> Hi,
> 
> I just noticed this in a quick test.
> 
> On Tuesday 21 Jun 2022 at 20:20:34 (+0100), Sudeep Holla wrote:
> > We don't support the topology for clusters of CPU clusters while the
> > DT and ACPI bindings theoritcally support the same. Just warn about the
> > same so that it is clear to the users of arch_topology that the nested
> > clusters are not yet supported.
> > 
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/base/arch_topology.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> > index ed1cb64a95aa..1c5fa7bbbd00 100644
> > --- a/drivers/base/arch_topology.c
> > +++ b/drivers/base/arch_topology.c
> > @@ -567,6 +567,8 @@ static int __init parse_cluster(struct device_node *cluster, int package_id,
> >  		if (c) {
> >  			leaf = false;
> >  			ret = parse_cluster(c, package_id, i, depth + 1);
> > +			if (depth > 1)
> > +				pr_warn("Topology for clusters of clusters not yet supported\n");
> 
> I think the check should be for (depth > 0) or (depth >= 1).
> 
> We end up having depth = 2 when we have
> 
> cluster 0 {
> 	//depth is 0
> 	cluster 0 {
> 		//depth is 1
> 		cluster0 {
> 			//depth is 2
> ...
> 
> I suppose we should warn about nested clusters from depth 1, right?
>

You are absolutely correct. For some reason when I wrote this patch I
read the line above as depth++ instead of depth + 1. I was searching
for that now reading your reply just to realise that I misread it.

Thanks for catching this.

-- 
Regards,
Sudeep

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 10/20] arm64: topology: Remove redundant setting of llc_id in CPU topology
  2022-06-21 19:20 ` [PATCH v4 10/20] arm64: topology: Remove redundant setting of llc_id in CPU topology Sudeep Holla
@ 2022-06-23 15:55   ` Catalin Marinas
  0 siblings, 0 replies; 34+ messages in thread
From: Catalin Marinas @ 2022-06-23 15:55 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Ionela Voinescu, Pierre Gondois, linux-arm-kernel, linux-riscv,
	Will Deacon, Gavin Shan

On Tue, Jun 21, 2022 at 08:20:24PM +0100, Sudeep Holla wrote:
> Since the cacheinfo LLC information is used directly in arch_topology,
> there is no need to parse and fetch the LLC ID information only for
> ACPI systems.
> 
> Just drop the redundant parsing and setting of llc_id in CPU topology
> from ACPI PPTT.
> 
> Cc: Will Deacon <will@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Reviewed-by: Gavin Shan <gshan@redhat.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

> Hi Will/Catalin,
> 
> This is part of a series updating topology to get both ACPI and DT view
> aligned. I have not cc-ed you assuming you won't be interested. Let me
> know if you are. The parts affecting arm64 is just this patch removing
> some unnecessary ACPI code that is now moved to core arch_topology.c
> 
> Please ack if you are happy with this and OK to take this as part of the
> series.

Yeah, that's fine, keep it with the rest of the series.

-- 
Catalin

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 16/20] arch_topology: Drop unnecessary check for uninitialised package_id
  2022-06-21 19:20 ` [PATCH v4 16/20] arch_topology: Drop unnecessary check for uninitialised package_id Sudeep Holla
@ 2022-06-27 13:12   ` Ionela Voinescu
  2022-06-27 16:30     ` Sudeep Holla
  0 siblings, 1 reply; 34+ messages in thread
From: Ionela Voinescu @ 2022-06-27 13:12 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv

On Tuesday 21 Jun 2022 at 20:20:30 (+0100), Sudeep Holla wrote:
> With the support of socket node parsing from the device tree and
> assigning 0 as package_id in absence of socket nodes, there is no need
> to check for invalid package_id. It is always initialised to 0 or values
> from the device tree socket nodes.
> 
> Just drop that now redundant check for uninitialised package_id.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/base/arch_topology.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 46fa1b70b02b..42448a5a9412 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -611,7 +611,6 @@ static int __init parse_dt_topology(void)
>  {
>  	struct device_node *cn, *map;
>  	int ret = 0;
> -	int cpu;
>  
>  	cn = of_find_node_by_path("/cpus");
>  	if (!cn) {
> @@ -633,16 +632,6 @@ static int __init parse_dt_topology(void)
>  
>  	topology_normalize_cpu_scale();
>  
> -	/*
> -	 * Check that all cores are in the topology; the SMP code will
> -	 * only mark cores described in the DT as possible.
> -	 */
> -	for_each_possible_cpu(cpu)
> -		if (cpu_topology[cpu].package_id < 0) {
> -			ret = -EINVAL;
> -			break;
> -		}
> -

Maybe it would still be good to keep this for systems with potential
errors in DT, where one forgets to add a core in cpu-map.

For example, if I modify juno.dts as follows:

--- a/arch/arm64/boot/dts/arm/juno.dts
+++ b/arch/arm64/boot/dts/arm/juno.dts
@@ -51,12 +51,9 @@ core0 {
                                        cpu = <&A53_0>;
                                };
                                core1 {
-                                       cpu = <&A53_1>;
-                               };
-                               core2 {
                                        cpu = <&A53_2>;
                                };
-                               core3 {
+                               core2 {
                                        cpu = <&A53_3>;
                                };
                        };

and miss a little core in cluster1, I would end up with an incomplete
topology: core3 would have cluster_id as -1, while all other CPUs would
have a valid value; also, core3 would have package_id = -1.

Thanks,
Ionela.

>  out_map:
>  	of_node_put(map);
>  out:
> -- 
> 2.36.1
> 

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address
  2022-06-21 19:20 ` [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address Sudeep Holla
  2022-06-22 11:47   ` Rafael J. Wysocki
@ 2022-06-27 13:41   ` Ionela Voinescu
  1 sibling, 0 replies; 34+ messages in thread
From: Ionela Voinescu @ 2022-06-27 13:41 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv, linux-acpi

Hi Sudeep,

On Tuesday 21 Jun 2022 at 20:20:15 (+0100), Sudeep Holla wrote:
> There is need to use the cache sharing information quite early during
> the boot before the secondary cores are up and running. The permanent
> memory map for all the ACPI tables(via acpi_permanent_mmap) is turned
> on in acpi_early_init() which is quite late for the above requirement.
> 
> As a result there is possibility that the ACPI PPTT gets mapped to
> different virtual addresses. In such scenarios, using virtual address as
> fw_token before the acpi_permanent_mmap is enabled results in different
> fw_token for the same cache entity and hence wrong cache sharing
> information will be deduced based on the same.
> 
> Instead of using virtual address, just use the table offset as the
> unique firmware token for the caches. The same offset is used as
> ACPI identifiers if the firmware has not set a valid one for other
> entries in the ACPI PPTT.
> 
> Cc: linux-acpi@vger.kernel.org
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/acpi/pptt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Hi Rafael,
> 
> If you are happy with this change, can you provide Ack, so that it can be
> merged together with other changes ?
> 
> Regards,
> Sudeep
> 
> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> index 701f61c01359..763f021d45e6 100644
> --- a/drivers/acpi/pptt.c
> +++ b/drivers/acpi/pptt.c
> @@ -437,7 +437,8 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table,
>  		pr_debug("found = %p %p\n", found_cache, cpu_node);
>  		if (found_cache)
>  			update_cache_properties(this_leaf, found_cache,
> -			                        cpu_node, table->revision);
> +						ACPI_TO_POINTER(ACPI_PTR_DIFF(cpu_node, table)),
> +						table->revision);
>  
>  		index++;
>  	}
> -- 
> 2.36.1
> 

I've run the set on Kunpeng920 where Dietmar noticed an issue [1] before
and it looks good to me.

Tested-by: Ionela Voinescu <ionela.voinescu@arm.com>

[1]
https://lore.kernel.org/lkml/0bf199a0-251d-323c-974a-bfd4e26f4cce@arm.com/

Thanks,
Ionela.

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 12/20] arch_topology: Set thread sibling cpumask only within the cluster
  2022-06-21 19:20 ` [PATCH v4 12/20] arch_topology: Set thread sibling cpumask only within the cluster Sudeep Holla
@ 2022-06-27 13:42   ` Ionela Voinescu
  0 siblings, 0 replies; 34+ messages in thread
From: Ionela Voinescu @ 2022-06-27 13:42 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv, Gavin Shan

On Tuesday 21 Jun 2022 at 20:20:26 (+0100), Sudeep Holla wrote:
> Currently the cluster identifier is not set on the DT based platforms.
> The reset or default value is -1 for all the CPUs. Once we assign the
> cluster identifier values correctly that imay result in getting the thread
                                           ^^^^
Nit: 					   may
> siblings wrongs as the core identifiers can be same for 2 different CPUs
Nit:       ^^^^^^
	   wrong


Thanks,
Ionela.

> belonging to 2 different cluster.
> 
> So, in order to get the thread sibling cpumasks correct, we need to
> update them only if the cores they belong are in the same cluster within
> the socket. Let us skip updation of the thread sibling cpumaks if the
> cluster identifier doesn't match.
> 
> This change won't affect even if the cluster identifiers are not set
> currently but will avoid any breakage once we set the same correctly.
> 
> Reviewed-by: Gavin Shan <gshan@redhat.com>
> Tested-by: Gavin Shan <gshan@redhat.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/base/arch_topology.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index b63cc52e12ce..7a5ff1ea5f00 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -708,15 +708,17 @@ void update_siblings_masks(unsigned int cpuid)
>  		if (cpuid_topo->package_id != cpu_topo->package_id)
>  			continue;
>  
> -		if (cpuid_topo->cluster_id == cpu_topo->cluster_id &&
> -		    cpuid_topo->cluster_id != -1) {
> +		cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
> +		cpumask_set_cpu(cpu, &cpuid_topo->core_sibling);
> +
> +		if (cpuid_topo->cluster_id != cpu_topo->cluster_id)
> +			continue;
> +
> +		if (cpuid_topo->cluster_id != -1) {
>  			cpumask_set_cpu(cpu, &cpuid_topo->cluster_sibling);
>  			cpumask_set_cpu(cpuid, &cpu_topo->cluster_sibling);
>  		}
>  
> -		cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
> -		cpumask_set_cpu(cpu, &cpuid_topo->core_sibling);
> -
>  		if (cpuid_topo->core_id != cpu_topo->core_id)
>  			continue;
>  
> -- 
> 2.36.1
> 

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 15/20] arch_topology: Don't set cluster identifier as physical package identifier
  2022-06-21 19:20 ` [PATCH v4 15/20] arch_topology: Don't set cluster identifier as physical package identifier Sudeep Holla
@ 2022-06-27 13:43   ` Ionela Voinescu
  0 siblings, 0 replies; 34+ messages in thread
From: Ionela Voinescu @ 2022-06-27 13:43 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv

On Tuesday 21 Jun 2022 at 20:20:29 (+0100), Sudeep Holla wrote:
> Currently as we parse the CPU topology from /cpu-map node from the
> device tree, we assign generated cluster count as the physical package
> identifier for each CPU which is wrong.
> 
> The device tree bindings for CPU topology supports sockets to infer
> the socket or physical package identifier for a given CPU. Since it is
> fairly new and not support on most of the old and existing systems, we
                     ^^^^^^^
Nit:		     supported
> can assume all such systems have single socket/physical package.
> 
> Fix the physical package identifier to 0 by removing the assignment of
> cluster identifier to the same.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com>

Thanks,
Ionela.

> ---
>  drivers/base/arch_topology.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 7a569aefe313..46fa1b70b02b 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -549,7 +549,6 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
>  	bool leaf = true;
>  	bool has_cores = false;
>  	struct device_node *c;
> -	static int package_id __initdata;
>  	int core_id = 0;
>  	int i, ret;
>  
> @@ -588,7 +587,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
>  			}
>  
>  			if (leaf) {
> -				ret = parse_core(c, package_id, core_id++);
> +				ret = parse_core(c, 0, core_id++);
>  			} else {
>  				pr_err("%pOF: Non-leaf cluster with core %s\n",
>  				       cluster, name);
> @@ -605,9 +604,6 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
>  	if (leaf && !has_cores)
>  		pr_warn("%pOF: empty cluster\n", cluster);
>  
> -	if (leaf)
> -		package_id++;
> -
>  	return 0;
>  }
>  
> -- 
> 2.36.1
> 

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 18/20] arch_topology: Set cluster identifier in each core/thread from /cpu-map
  2022-06-21 19:20 ` [PATCH v4 18/20] arch_topology: Set cluster identifier in each core/thread from /cpu-map Sudeep Holla
@ 2022-06-27 13:47   ` Ionela Voinescu
  0 siblings, 0 replies; 34+ messages in thread
From: Ionela Voinescu @ 2022-06-27 13:47 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv

On Tuesday 21 Jun 2022 at 20:20:32 (+0100), Sudeep Holla wrote:
> Let us set the cluster identifier as parsed from the device tree
> cluster nodes within /cpu-map.
> 
> We don't support nesting of clusters yet as there are no real hardware
> to support clusters of clusters.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/base/arch_topology.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 39be5dbaf4da..75604f783bfc 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -497,7 +497,7 @@ static int __init get_cpu_for_node(struct device_node *node)
>  }
>  
>  static int __init parse_core(struct device_node *core, int package_id,
> -			     int core_id)
> +			     int cluster_id, int core_id)
>  {
>  	char name[20];
>  	bool leaf = true;
> @@ -513,6 +513,7 @@ static int __init parse_core(struct device_node *core, int package_id,
>  			cpu = get_cpu_for_node(t);
>  			if (cpu >= 0) {
>  				cpu_topology[cpu].package_id = package_id;
> +				cpu_topology[cpu].cluster_id = cluster_id;
>  				cpu_topology[cpu].core_id = core_id;
>  				cpu_topology[cpu].thread_id = i;
>  			} else if (cpu != -ENODEV) {
> @@ -534,6 +535,7 @@ static int __init parse_core(struct device_node *core, int package_id,
>  		}
>  
>  		cpu_topology[cpu].package_id = package_id;
> +		cpu_topology[cpu].cluster_id = cluster_id;
>  		cpu_topology[cpu].core_id = core_id;
>  	} else if (leaf && cpu != -ENODEV) {
>  		pr_err("%pOF: Can't get CPU for leaf core\n", core);
> @@ -543,7 +545,8 @@ static int __init parse_core(struct device_node *core, int package_id,
>  	return 0;
>  }
>  
> -static int __init parse_cluster(struct device_node *cluster, int depth)
> +static int __init
> +parse_cluster(struct device_node *cluster, int cluster_id, int depth)
>  {
>  	char name[20];
>  	bool leaf = true;
> @@ -563,7 +566,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
>  		c = of_get_child_by_name(cluster, name);
>  		if (c) {
>  			leaf = false;
> -			ret = parse_cluster(c, depth + 1);
> +			ret = parse_cluster(c, i, depth + 1);
>  			of_node_put(c);
>  			if (ret != 0)
>  				return ret;
> @@ -587,7 +590,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
>  			}
>  
>  			if (leaf) {
> -				ret = parse_core(c, 0, core_id++);
> +				ret = parse_core(c, 0, cluster_id, core_id++);
>  			} else {
>  				pr_err("%pOF: Non-leaf cluster with core %s\n",
>  				       cluster, name);
> @@ -626,7 +629,7 @@ static int __init parse_dt_topology(void)
>  	if (!map)
>  		goto out;
>  
> -	ret = parse_cluster(map, 0);
> +	ret = parse_cluster(map, -1, 0);
>  	if (ret != 0)
>  		goto out_map;
>  
> -- 
> 2.36.1
> 

Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com>

Thanks,
Ionela.

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 19/20] arch_topology: Add support for parsing sockets in /cpu-map
  2022-06-21 19:20 ` [PATCH v4 19/20] arch_topology: Add support for parsing sockets in /cpu-map Sudeep Holla
@ 2022-06-27 13:47   ` Ionela Voinescu
  0 siblings, 0 replies; 34+ messages in thread
From: Ionela Voinescu @ 2022-06-27 13:47 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv

On Tuesday 21 Jun 2022 at 20:20:33 (+0100), Sudeep Holla wrote:
> Finally let us add support for socket nodes in /cpu-map in the device
> tree. Since this may not be present in all the old platforms and even
> most of the existing platforms, we need to assume absence of the socket
> node indicates that it is a single socket system and handle appropriately.
> 
> Also it is likely that most single socket systems skip to as the node
> since it is optional.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/base/arch_topology.c | 37 +++++++++++++++++++++++++++++++-----
>  1 file changed, 32 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 75604f783bfc..ed1cb64a95aa 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -545,8 +545,8 @@ static int __init parse_core(struct device_node *core, int package_id,
>  	return 0;
>  }
>  
> -static int __init
> -parse_cluster(struct device_node *cluster, int cluster_id, int depth)
> +static int __init parse_cluster(struct device_node *cluster, int package_id,
> +				int cluster_id, int depth)
>  {
>  	char name[20];
>  	bool leaf = true;
> @@ -566,7 +566,7 @@ parse_cluster(struct device_node *cluster, int cluster_id, int depth)
>  		c = of_get_child_by_name(cluster, name);
>  		if (c) {
>  			leaf = false;
> -			ret = parse_cluster(c, i, depth + 1);
> +			ret = parse_cluster(c, package_id, i, depth + 1);
>  			of_node_put(c);
>  			if (ret != 0)
>  				return ret;
> @@ -590,7 +590,8 @@ parse_cluster(struct device_node *cluster, int cluster_id, int depth)
>  			}
>  
>  			if (leaf) {
> -				ret = parse_core(c, 0, cluster_id, core_id++);
> +				ret = parse_core(c, package_id, cluster_id,
> +						 core_id++);
>  			} else {
>  				pr_err("%pOF: Non-leaf cluster with core %s\n",
>  				       cluster, name);
> @@ -610,6 +611,32 @@ parse_cluster(struct device_node *cluster, int cluster_id, int depth)
>  	return 0;
>  }
>  
> +static int __init parse_socket(struct device_node *socket)
> +{
> +	char name[20];
> +	struct device_node *c;
> +	bool has_socket = false;
> +	int package_id = 0, ret;
> +
> +	do {
> +		snprintf(name, sizeof(name), "socket%d", package_id);
> +		c = of_get_child_by_name(socket, name);
> +		if (c) {
> +			has_socket = true;
> +			ret = parse_cluster(c, package_id, -1, 0);
> +			of_node_put(c);
> +			if (ret != 0)
> +				return ret;
> +		}
> +		package_id++;
> +	} while (c);
> +
> +	if (!has_socket)
> +		ret = parse_cluster(socket, 0, -1, 0);
> +
> +	return ret;
> +}
> +
>  static int __init parse_dt_topology(void)
>  {
>  	struct device_node *cn, *map;
> @@ -629,7 +656,7 @@ static int __init parse_dt_topology(void)
>  	if (!map)
>  		goto out;
>  
> -	ret = parse_cluster(map, -1, 0);
> +	ret = parse_socket(map);
>  	if (ret != 0)
>  		goto out_map;
>  
> -- 
> 2.36.1
> 

Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com>

Thanks,
Ionela.

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids
  2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
                   ` (19 preceding siblings ...)
  2022-06-21 19:20 ` [PATCH v4 20/20] arch_topology: Warn that topology for nested clusters is not supported Sudeep Holla
@ 2022-06-27 13:54 ` Ionela Voinescu
  2022-06-27 16:22   ` Sudeep Holla
  20 siblings, 1 reply; 34+ messages in thread
From: Ionela Voinescu @ 2022-06-27 13:54 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv

Hi Sudeep,

On Tuesday 21 Jun 2022 at 20:20:14 (+0100), Sudeep Holla wrote:
> Hi All,
> 
> This version updates cacheinfo to populate and use the information from
> there for all the cache topology.
> 
> This series intends to fix some discrepancies we have in the CPU topology
> parsing from the device tree /cpu-map node. Also this diverges from the
> behaviour on a ACPI enabled platform. The expectation is that both DT
> and ACPI enabled systems must present consistent view of the CPU topology.
> 
> Currently we assign generated cluster count as the physical package identifier
> for each CPU which is wrong. The device tree bindings for CPU topology supports
> sockets to infer the socket or physical package identifier for a given CPU.
> Also we don't check if all the cores/threads belong to the same cluster before
> updating their sibling masks which is fine as we don't set the cluster id yet.
> 
> These changes also assigns the cluster identifier as parsed from the device tree
> cluster nodes within /cpu-map without support for nesting of the clusters.
> Finally, it also add support for socket nodes in /cpu-map. With this the
> parsing of exact same information from ACPI PPTT and /cpu-map DT node
> aligns well.
> 
> The only exception is that the last level cache id information can be
> inferred from the same ACPI PPTT while we need to parse CPU cache nodes
> in the device tree.
> 
> Hi Greg,
> 
> I had not cc-ed you on earlier 3 versions as we had some disagreement
> amongst Arm developers which we have not settled. Let me know how you want to

s/not/now :)

> merge this once you agree with the changes. I can set pull request if
> you prefer. Let me know.
> 
> v4[3]->v4:
> 	- Updated ACPI PPTT fw_token to use table offset instead of virtual
> 	  address as it could get changed for everytime it is mapped before
> 	  the global acpi_permanent_mmap is set
> 	- Added warning for the topology with nested clusters
> 	- Added update to cpu_clustergroup_mask so that introduction of
> 	  correct cluster_id doesn't break existing platforms by limiting
> 	  the span of clustergroup_mask(by Ionela)
> 

I've tested v4 on quite a few platforms:
 - DT: Juno R0, DB845c, RB5
 - ACPI: TX2, Ampere Altra, Kunpeng920

and it all looks good from my point of view (topology and sched domain
hierarchy).

So for the full set (after the changes requested for 16/20 and 20/20):

Tested-by: Ionela Voinescu <ionela.voinescu@arm.com>

Hope it helps,
Ionela.

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids
  2022-06-27 13:54 ` [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Ionela Voinescu
@ 2022-06-27 16:22   ` Sudeep Holla
  0 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-27 16:22 UTC (permalink / raw)
  To: Ionela Voinescu
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv

On Mon, Jun 27, 2022 at 02:54:28PM +0100, Ionela Voinescu wrote:
> Hi Sudeep,
> 
> On Tuesday 21 Jun 2022 at 20:20:14 (+0100), Sudeep Holla wrote:
> > Hi All,
> > 
> > This version updates cacheinfo to populate and use the information from
> > there for all the cache topology.
> > 
> > This series intends to fix some discrepancies we have in the CPU topology
> > parsing from the device tree /cpu-map node. Also this diverges from the
> > behaviour on a ACPI enabled platform. The expectation is that both DT
> > and ACPI enabled systems must present consistent view of the CPU topology.
> > 
> > Currently we assign generated cluster count as the physical package identifier
> > for each CPU which is wrong. The device tree bindings for CPU topology supports
> > sockets to infer the socket or physical package identifier for a given CPU.
> > Also we don't check if all the cores/threads belong to the same cluster before
> > updating their sibling masks which is fine as we don't set the cluster id yet.
> > 
> > These changes also assigns the cluster identifier as parsed from the device tree
> > cluster nodes within /cpu-map without support for nesting of the clusters.
> > Finally, it also add support for socket nodes in /cpu-map. With this the
> > parsing of exact same information from ACPI PPTT and /cpu-map DT node
> > aligns well.
> > 
> > The only exception is that the last level cache id information can be
> > inferred from the same ACPI PPTT while we need to parse CPU cache nodes
> > in the device tree.
> > 
> > Hi Greg,
> > 
> > I had not cc-ed you on earlier 3 versions as we had some disagreement
> > amongst Arm developers which we have not settled. Let me know how you want to
> 
> s/not/now :)
> 
> > merge this once you agree with the changes. I can set pull request if
> > you prefer. Let me know.
> > 
> > v4[3]->v4:
> > 	- Updated ACPI PPTT fw_token to use table offset instead of virtual
> > 	  address as it could get changed for everytime it is mapped before
> > 	  the global acpi_permanent_mmap is set
> > 	- Added warning for the topology with nested clusters
> > 	- Added update to cpu_clustergroup_mask so that introduction of
> > 	  correct cluster_id doesn't break existing platforms by limiting
> > 	  the span of clustergroup_mask(by Ionela)
> > 
> 
> I've tested v4 on quite a few platforms:
>  - DT: Juno R0, DB845c, RB5
>  - ACPI: TX2, Ampere Altra, Kunpeng920
> 
> and it all looks good from my point of view (topology and sched domain
> hierarchy).
> 
> So for the full set (after the changes requested for 16/20 and 20/20):
> 
> Tested-by: Ionela Voinescu <ionela.voinescu@arm.com>
>

Thanks for all the review and testing. Much appreciated!

-- 
Regards,
Sudeep

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v4 16/20] arch_topology: Drop unnecessary check for uninitialised package_id
  2022-06-27 13:12   ` Ionela Voinescu
@ 2022-06-27 16:30     ` Sudeep Holla
  0 siblings, 0 replies; 34+ messages in thread
From: Sudeep Holla @ 2022-06-27 16:30 UTC (permalink / raw)
  To: Ionela Voinescu
  Cc: linux-kernel, Greg KH, Atish Patra, Atish Patra, Vincent Guittot,
	Dietmar Eggemann, Qing Wang, Rob Herring, Rafael J . Wysocki,
	Pierre Gondois, linux-arm-kernel, linux-riscv

On Mon, Jun 27, 2022 at 02:12:52PM +0100, Ionela Voinescu wrote:
> On Tuesday 21 Jun 2022 at 20:20:30 (+0100), Sudeep Holla wrote:
> > With the support of socket node parsing from the device tree and
> > assigning 0 as package_id in absence of socket nodes, there is no need
> > to check for invalid package_id. It is always initialised to 0 or values
> > from the device tree socket nodes.
> > 
> > Just drop that now redundant check for uninitialised package_id.
> > 
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/base/arch_topology.c | 11 -----------
> >  1 file changed, 11 deletions(-)
> > 
> > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> > index 46fa1b70b02b..42448a5a9412 100644
> > --- a/drivers/base/arch_topology.c
> > +++ b/drivers/base/arch_topology.c
> > @@ -611,7 +611,6 @@ static int __init parse_dt_topology(void)
> >  {
> >  	struct device_node *cn, *map;
> >  	int ret = 0;
> > -	int cpu;
> >  
> >  	cn = of_find_node_by_path("/cpus");
> >  	if (!cn) {
> > @@ -633,16 +632,6 @@ static int __init parse_dt_topology(void)
> >  
> >  	topology_normalize_cpu_scale();
> >  
> > -	/*
> > -	 * Check that all cores are in the topology; the SMP code will
> > -	 * only mark cores described in the DT as possible.
> > -	 */
> > -	for_each_possible_cpu(cpu)
> > -		if (cpu_topology[cpu].package_id < 0) {
> > -			ret = -EINVAL;
> > -			break;
> > -		}
> > -
> 
> Maybe it would still be good to keep this for systems with potential
> errors in DT, where one forgets to add a core in cpu-map.
>

Though I would ideally prefer to catch such DT issues with schema, I know
we are no there yet. So I agree to retain this.

> For example, if I modify juno.dts as follows:
> 
> --- a/arch/arm64/boot/dts/arm/juno.dts
> +++ b/arch/arm64/boot/dts/arm/juno.dts
> @@ -51,12 +51,9 @@ core0 {
>                                         cpu = <&A53_0>;
>                                 };
>                                 core1 {
> -                                       cpu = <&A53_1>;
> -                               };
> -                               core2 {
>                                         cpu = <&A53_2>;
>                                 };
> -                               core3 {
> +                               core2 {
>                                         cpu = <&A53_3>;
>                                 };
>                         };
> 
> and miss a little core in cluster1, I would end up with an incomplete
> topology: core3 would have cluster_id as -1, while all other CPUs would
> have a valid value; also, core3 would have package_id = -1.
> 

Indeed. I didn't consider the case where DT would have issues when I dropped
this check. I will drop this patch. Thanks again.

-- 
Regards,
Sudeep

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2022-06-27 16:32 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 19:20 [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address Sudeep Holla
2022-06-22 11:47   ` Rafael J. Wysocki
2022-06-27 13:41   ` Ionela Voinescu
2022-06-21 19:20 ` [PATCH v4 02/20] cacheinfo: Use of_cpu_device_node_get instead cpu_dev->of_node Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 03/20] cacheinfo: Add helper to access any cache index for a given CPU Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 04/20] cacheinfo: Move cache_leaves_are_shared out of CONFIG_OF Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 05/20] cacheinfo: Add support to check if last level cache(LLC) is valid or shared Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 06/20] cacheinfo: Allow early detection and population of cache attributes Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 07/20] cacheinfo: Use cache identifiers to check if the caches are shared if available Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 08/20] arch_topology: Add support to parse and detect cache attributes Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 09/20] arch_topology: Use the last level cache information from the cacheinfo Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 10/20] arm64: topology: Remove redundant setting of llc_id in CPU topology Sudeep Holla
2022-06-23 15:55   ` Catalin Marinas
2022-06-21 19:20 ` [PATCH v4 11/20] arch_topology: Drop LLC identifier stash from the " Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 12/20] arch_topology: Set thread sibling cpumask only within the cluster Sudeep Holla
2022-06-27 13:42   ` Ionela Voinescu
2022-06-21 19:20 ` [PATCH v4 13/20] arch_topology: Check for non-negative value rather than -1 for IDs validity Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 14/20] arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 15/20] arch_topology: Don't set cluster identifier as physical package identifier Sudeep Holla
2022-06-27 13:43   ` Ionela Voinescu
2022-06-21 19:20 ` [PATCH v4 16/20] arch_topology: Drop unnecessary check for uninitialised package_id Sudeep Holla
2022-06-27 13:12   ` Ionela Voinescu
2022-06-27 16:30     ` Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 17/20] arch_topology: Limit span of cpu_clustergroup_mask() Sudeep Holla
2022-06-21 19:20 ` [PATCH v4 18/20] arch_topology: Set cluster identifier in each core/thread from /cpu-map Sudeep Holla
2022-06-27 13:47   ` Ionela Voinescu
2022-06-21 19:20 ` [PATCH v4 19/20] arch_topology: Add support for parsing sockets in /cpu-map Sudeep Holla
2022-06-27 13:47   ` Ionela Voinescu
2022-06-21 19:20 ` [PATCH v4 20/20] arch_topology: Warn that topology for nested clusters is not supported Sudeep Holla
2022-06-22 15:06   ` Ionela Voinescu
2022-06-22 15:46     ` Sudeep Holla
2022-06-27 13:54 ` [PATCH v4 00/20] arch_topology: Updates to add socket support and fix cluster ids Ionela Voinescu
2022-06-27 16:22   ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).