linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] Revert "arm64: topology: divorce MC scheduling domain from core_siblings"
@ 2018-06-05 14:35 Sudeep Holla
  2018-06-05 14:35 ` [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled Sudeep Holla
  2018-06-05 14:35 ` [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily Sudeep Holla
  0 siblings, 2 replies; 12+ messages in thread
From: Sudeep Holla @ 2018-06-05 14:35 UTC (permalink / raw)
  To: linux-acpi, Rafael J . Wysocki, Catalin Marinas, Jeremy Linton
  Cc: Sudeep Holla, Morten Rasmussen, linux-arm-kernel, linux-kernel,
	Hanjun Guo, Geert Uytterhoeven, Will Deacon

This reverts commit 37c3ec2d810f87eac73822f76b30391a83bded19.

Currently on ARM64 platforms, we don't update the CPU topology masks
on each hotplug operation. However, the updates to cpu_coregroup_mask
done as part of ACPI PPTT support, in particular the commit being
reverted makes use of cpumask_of_node which returns the cpu_oneline_mask
instead of core_sibling as core_sibling masks are not updated for CPU
hotplug operations and the comparision to find NUMA in package or LLC
siblings fails.

This often leads to system hang or crash during CPU hotplug and system
suspend operation. This is mostly observed on HMP systems where the
CPU compute capacities are different and ends up in different scheduler
domains. Since cpumask_of_node is returned instead core_sibling, the
scheduler is confused with incorrect cpumasks(e.g. one CPU in two
different sched domains at the same time) on CPU hotplug.

The original commit is technically correct and since it depends on the
not yet supported feature, let's revert this for now. We can put it back
once we have the support for CPU topology masks update on hotplug merged.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm64/include/asm/topology.h |  2 --
 arch/arm64/kernel/topology.c      | 36 +-----------------------------------
 2 files changed, 1 insertion(+), 37 deletions(-)

v1->v2:
	- Updated commit log to describe the observations made as a
	  consequence of the issue as suggested by Geert's

diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h
index df48212f767b..6b10459e6905 100644
--- a/arch/arm64/include/asm/topology.h
+++ b/arch/arm64/include/asm/topology.h
@@ -8,10 +8,8 @@ struct cpu_topology {
 	int thread_id;
 	int core_id;
 	int package_id;
-	int llc_id;
 	cpumask_t thread_sibling;
 	cpumask_t core_sibling;
-	cpumask_t llc_siblings;
 };
 
 extern struct cpu_topology cpu_topology[NR_CPUS];
diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index 7415c166281f..047d98e68502 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -13,7 +13,6 @@
 
 #include <linux/acpi.h>
 #include <linux/arch_topology.h>
-#include <linux/cacheinfo.h>
 #include <linux/cpu.h>
 #include <linux/cpumask.h>
 #include <linux/init.h>
@@ -215,19 +214,7 @@ EXPORT_SYMBOL_GPL(cpu_topology);
 
 const struct cpumask *cpu_coregroup_mask(int cpu)
 {
-	const cpumask_t *core_mask = cpumask_of_node(cpu_to_node(cpu));
-
-	/* Find the smaller of NUMA, core or LLC siblings */
-	if (cpumask_subset(&cpu_topology[cpu].core_sibling, core_mask)) {
-		/* not numa in package, lets use the package siblings */
-		core_mask = &cpu_topology[cpu].core_sibling;
-	}
-	if (cpu_topology[cpu].llc_id != -1) {
-		if (cpumask_subset(&cpu_topology[cpu].llc_siblings, core_mask))
-			core_mask = &cpu_topology[cpu].llc_siblings;
-	}
-
-	return core_mask;
+	return &cpu_topology[cpu].core_sibling;
 }
 
 static void update_siblings_masks(unsigned int cpuid)
@@ -239,9 +226,6 @@ static void update_siblings_masks(unsigned int cpuid)
 	for_each_possible_cpu(cpu) {
 		cpu_topo = &cpu_topology[cpu];
 
-		if (cpuid_topo->llc_id == cpu_topo->llc_id)
-			cpumask_set_cpu(cpu, &cpuid_topo->llc_siblings);
-
 		if (cpuid_topo->package_id != cpu_topo->package_id)
 			continue;
 
@@ -307,10 +291,6 @@ static void __init reset_cpu_topology(void)
 		cpu_topo->core_id = 0;
 		cpu_topo->package_id = -1;
 
-		cpu_topo->llc_id = -1;
-		cpumask_clear(&cpu_topo->llc_siblings);
-		cpumask_set_cpu(cpu, &cpu_topo->llc_siblings);
-
 		cpumask_clear(&cpu_topo->core_sibling);
 		cpumask_set_cpu(cpu, &cpu_topo->core_sibling);
 		cpumask_clear(&cpu_topo->thread_sibling);
@@ -331,8 +311,6 @@ static int __init parse_acpi_topology(void)
 	is_threaded = read_cpuid_mpidr() & MPIDR_MT_BITMASK;
 
 	for_each_possible_cpu(cpu) {
-		int i, cache_id;
-
 		topology_id = find_acpi_cpu_topology(cpu, 0);
 		if (topology_id < 0)
 			return topology_id;
@@ -347,18 +325,6 @@ static int __init parse_acpi_topology(void)
 		}
 		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.7.4

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

* [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled
  2018-06-05 14:35 [PATCH v2 1/3] Revert "arm64: topology: divorce MC scheduling domain from core_siblings" Sudeep Holla
@ 2018-06-05 14:35 ` Sudeep Holla
  2018-06-05 15:00   ` Rafael J. Wysocki
  2018-06-05 17:08   ` Catalin Marinas
  2018-06-05 14:35 ` [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily Sudeep Holla
  1 sibling, 2 replies; 12+ messages in thread
From: Sudeep Holla @ 2018-06-05 14:35 UTC (permalink / raw)
  To: linux-acpi, Rafael J . Wysocki, Catalin Marinas, Jeremy Linton
  Cc: Sudeep Holla, Morten Rasmussen, linux-arm-kernel, linux-kernel,
	Hanjun Guo, Geert Uytterhoeven

Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
it may be useful to support the build with CONFIG_ACPI_PPTT disabled.

This patch adds the missing dummy/boiler plate implementation to fix
the build.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 include/linux/acpi.h      | 15 +++++++++++++++
 include/linux/cacheinfo.h |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

Hi Rafael,

If you are fine with this, can you provide Ack, so that we route this
through ARM64 tree where most of the ACPI PPTT support is present.

Regards,
Sudeep

v1->v2:
	- removed duplicate definition for acpi_find_last_cache_level

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 8f2cdb0eca71..4b35a66383f9 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
 }
 #endif
 
+#ifdef CONFIG_ACPI_PPTT
 int find_acpi_cpu_topology(unsigned int cpu, int level);
 int find_acpi_cpu_topology_package(unsigned int cpu);
 int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
+#else
+static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
+{
+	return -EINVAL;
+}
+static inline int find_acpi_cpu_topology_package(unsigned int cpu)
+{
+	return -EINVAL;
+}
+static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
+{
+	return -EINVAL;
+}
+#endif
 
 #endif	/*_LINUX_ACPI_H*/
diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
index 89397e30e269..70e19bc6cc9f 100644
--- a/include/linux/cacheinfo.h
+++ b/include/linux/cacheinfo.h
@@ -98,7 +98,7 @@ 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);
-#ifndef CONFIG_ACPI
+#ifndef CONFIG_ACPI_PPTT
 /*
  * acpi_find_last_cache_level is only called on ACPI enabled
  * platforms using the PPTT for topology. This means that if
-- 
2.7.4

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

* [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily
  2018-06-05 14:35 [PATCH v2 1/3] Revert "arm64: topology: divorce MC scheduling domain from core_siblings" Sudeep Holla
  2018-06-05 14:35 ` [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled Sudeep Holla
@ 2018-06-05 14:35 ` Sudeep Holla
  2018-06-05 15:02   ` Rafael J. Wysocki
  1 sibling, 1 reply; 12+ messages in thread
From: Sudeep Holla @ 2018-06-05 14:35 UTC (permalink / raw)
  To: linux-acpi, Rafael J . Wysocki, Catalin Marinas, Jeremy Linton
  Cc: Sudeep Holla, Morten Rasmussen, linux-arm-kernel, linux-kernel,
	Hanjun Guo, Geert Uytterhoeven, Will Deacon

Currently, ARM64 doesn't support updating the CPU topology masks on
CPU hotplug operations. ACPI PPTT support rely on that missing feature
which is technically not incorrect. Instead of reverting all the PPTT
support, let's keep it simple and disable ACPI PPTT support on ARM64
for time-being until the topology updates are added for CPU hotplug
operations.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm64/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 9fd4a8ccce07..98a5c78a80f9 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -7,7 +7,6 @@ config ARM64
 	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
 	select ACPI_MCFG if ACPI
 	select ACPI_SPCR_TABLE if ACPI
-	select ACPI_PPTT if ACPI
 	select ARCH_CLOCKSOURCE_DATA
 	select ARCH_HAS_DEBUG_VIRTUAL
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
-- 
2.7.4

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

* Re: [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled
  2018-06-05 14:35 ` [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled Sudeep Holla
@ 2018-06-05 15:00   ` Rafael J. Wysocki
  2018-06-05 15:33     ` Sudeep Holla
  2018-06-05 17:08   ` Catalin Marinas
  1 sibling, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2018-06-05 15:00 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: ACPI Devel Maling List, Rafael J . Wysocki, Catalin Marinas,
	Jeremy Linton, Morten Rasmussen, Linux ARM,
	Linux Kernel Mailing List, Hanjun Guo, Geert Uytterhoeven

On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>
> This patch adds the missing dummy/boiler plate implementation to fix
> the build.
>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  include/linux/acpi.h      | 15 +++++++++++++++
>  include/linux/cacheinfo.h |  2 +-
>  2 files changed, 16 insertions(+), 1 deletion(-)
>
> Hi Rafael,
>
> If you are fine with this, can you provide Ack, so that we route this
> through ARM64 tree where most of the ACPI PPTT support is present.
>
> Regards,
> Sudeep
>
> v1->v2:
>         - removed duplicate definition for acpi_find_last_cache_level
>
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 8f2cdb0eca71..4b35a66383f9 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>  }
>  #endif
>
> +#ifdef CONFIG_ACPI_PPTT
>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>  int find_acpi_cpu_topology_package(unsigned int cpu);
>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
> +#else
> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
> +{
> +       return -EINVAL;

Why -EINVAL?

> +}
> +static inline int find_acpi_cpu_topology_package(unsigned int cpu)
> +{
> +       return -EINVAL;
> +}
> +static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
> +{
> +       return -EINVAL;
> +}
> +#endif
>
>  #endif /*_LINUX_ACPI_H*/
> diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
> index 89397e30e269..70e19bc6cc9f 100644
> --- a/include/linux/cacheinfo.h
> +++ b/include/linux/cacheinfo.h
> @@ -98,7 +98,7 @@ 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);
> -#ifndef CONFIG_ACPI
> +#ifndef CONFIG_ACPI_PPTT
>  /*
>   * acpi_find_last_cache_level is only called on ACPI enabled
>   * platforms using the PPTT for topology. This means that if
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily
  2018-06-05 14:35 ` [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily Sudeep Holla
@ 2018-06-05 15:02   ` Rafael J. Wysocki
  2018-06-05 15:27     ` Sudeep Holla
  0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2018-06-05 15:02 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: ACPI Devel Maling List, Rafael J . Wysocki, Catalin Marinas,
	Jeremy Linton, Morten Rasmussen, Linux ARM,
	Linux Kernel Mailing List, Hanjun Guo, Geert Uytterhoeven,
	Will Deacon

On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
> Currently, ARM64 doesn't support updating the CPU topology masks on
> CPU hotplug operations. ACPI PPTT support rely on that missing feature
> which is technically not incorrect. Instead of reverting all the PPTT
> support, let's keep it simple and disable ACPI PPTT support on ARM64
> for time-being until the topology updates are added for CPU hotplug
> operations.

When is that going to happen?

Nobody else uses PPTT now.

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

* Re: [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily
  2018-06-05 15:02   ` Rafael J. Wysocki
@ 2018-06-05 15:27     ` Sudeep Holla
  2018-06-05 16:38       ` Jeremy Linton
  0 siblings, 1 reply; 12+ messages in thread
From: Sudeep Holla @ 2018-06-05 15:27 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Sudeep Holla, ACPI Devel Maling List, Rafael J . Wysocki,
	Catalin Marinas, Jeremy Linton, Morten Rasmussen, Linux ARM,
	Linux Kernel Mailing List, Hanjun Guo, Geert Uytterhoeven,
	Will Deacon



On 05/06/18 16:02, Rafael J. Wysocki wrote:
> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> Currently, ARM64 doesn't support updating the CPU topology masks on
>> CPU hotplug operations. ACPI PPTT support rely on that missing feature
>> which is technically not incorrect. Instead of reverting all the PPTT
>> support, let's keep it simple and disable ACPI PPTT support on ARM64
>> for time-being until the topology updates are added for CPU hotplug
>> operations.
> 
> When is that going to happen?
> > Nobody else uses PPTT now.
> 

No we need it on ARM64. I have even the fixes for the original issue
but it's bit invasive and too late as we are already in the merge
window. It needs to be tested on NUMA platforms, I have asked for that
explicitly.

-- 
Regards,
Sudeep

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

* Re: [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled
  2018-06-05 15:00   ` Rafael J. Wysocki
@ 2018-06-05 15:33     ` Sudeep Holla
  2018-06-05 16:12       ` Rafael J. Wysocki
  0 siblings, 1 reply; 12+ messages in thread
From: Sudeep Holla @ 2018-06-05 15:33 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Sudeep Holla, ACPI Devel Maling List, Rafael J . Wysocki,
	Catalin Marinas, Jeremy Linton, Morten Rasmussen, Linux ARM,
	Linux Kernel Mailing List, Hanjun Guo, Geert Uytterhoeven



On 05/06/18 16:00, Rafael J. Wysocki wrote:
> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
>> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>>
>> This patch adds the missing dummy/boiler plate implementation to fix
>> the build.
>>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
>>  include/linux/acpi.h      | 15 +++++++++++++++
>>  include/linux/cacheinfo.h |  2 +-
>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>
>> Hi Rafael,
>>
>> If you are fine with this, can you provide Ack, so that we route this
>> through ARM64 tree where most of the ACPI PPTT support is present.
>>
>> Regards,
>> Sudeep
>>
>> v1->v2:
>>         - removed duplicate definition for acpi_find_last_cache_level
>>
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index 8f2cdb0eca71..4b35a66383f9 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>  }
>>  #endif
>>
>> +#ifdef CONFIG_ACPI_PPTT
>>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>>  int find_acpi_cpu_topology_package(unsigned int cpu);
>>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
>> +#else
>> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
>> +{
>> +       return -EINVAL;
> 
> Why -EINVAL?
> 

I am not sure either. I used to return -ENOTSUPP, but IIRC someone
suggested to use it only for syscalls. Also I just based it on other
existing functions in acpi.h

I am open for any alternatives if you think that is better here.
-- 
Regards,
Sudeep

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

* Re: [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled
  2018-06-05 15:33     ` Sudeep Holla
@ 2018-06-05 16:12       ` Rafael J. Wysocki
  2018-06-05 16:18         ` Sudeep Holla
  0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2018-06-05 16:12 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Rafael J. Wysocki, ACPI Devel Maling List, Rafael J . Wysocki,
	Catalin Marinas, Jeremy Linton, Morten Rasmussen, Linux ARM,
	Linux Kernel Mailing List, Hanjun Guo, Geert Uytterhoeven

On Tue, Jun 5, 2018 at 5:33 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>
> On 05/06/18 16:00, Rafael J. Wysocki wrote:
>> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
>>> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>>>
>>> This patch adds the missing dummy/boiler plate implementation to fix
>>> the build.
>>>
>>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>> ---
>>>  include/linux/acpi.h      | 15 +++++++++++++++
>>>  include/linux/cacheinfo.h |  2 +-
>>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>>
>>> Hi Rafael,
>>>
>>> If you are fine with this, can you provide Ack, so that we route this
>>> through ARM64 tree where most of the ACPI PPTT support is present.
>>>
>>> Regards,
>>> Sudeep
>>>
>>> v1->v2:
>>>         - removed duplicate definition for acpi_find_last_cache_level
>>>
>>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>>> index 8f2cdb0eca71..4b35a66383f9 100644
>>> --- a/include/linux/acpi.h
>>> +++ b/include/linux/acpi.h
>>> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>>  }
>>>  #endif
>>>
>>> +#ifdef CONFIG_ACPI_PPTT
>>>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>>>  int find_acpi_cpu_topology_package(unsigned int cpu);
>>>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
>>> +#else
>>> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
>>> +{
>>> +       return -EINVAL;
>>
>> Why -EINVAL?
>>
>
> I am not sure either. I used to return -ENOTSUPP, but IIRC someone
> suggested to use it only for syscalls. Also I just based it on other
> existing functions in acpi.h
>
> I am open for any alternatives if you think that is better here.

It would be good to make it consistent with the error codes returned
by the functions when they are present.

Anyway, it's fine by me if that's consistent with the other acpi.h stubs.

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

* Re: [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled
  2018-06-05 16:12       ` Rafael J. Wysocki
@ 2018-06-05 16:18         ` Sudeep Holla
  2018-06-05 16:20           ` Rafael J. Wysocki
  0 siblings, 1 reply; 12+ messages in thread
From: Sudeep Holla @ 2018-06-05 16:18 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Sudeep Holla, ACPI Devel Maling List, Rafael J . Wysocki,
	Catalin Marinas, Jeremy Linton, Morten Rasmussen, Linux ARM,
	Linux Kernel Mailing List, Hanjun Guo, Geert Uytterhoeven



On 05/06/18 17:12, Rafael J. Wysocki wrote:
> On Tue, Jun 5, 2018 at 5:33 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>
>>
>> On 05/06/18 16:00, Rafael J. Wysocki wrote:
>>> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
>>>> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>>>>
>>>> This patch adds the missing dummy/boiler plate implementation to fix
>>>> the build.
>>>>
>>>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>>> ---
>>>>  include/linux/acpi.h      | 15 +++++++++++++++
>>>>  include/linux/cacheinfo.h |  2 +-
>>>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>>>
>>>> Hi Rafael,
>>>>
>>>> If you are fine with this, can you provide Ack, so that we route this
>>>> through ARM64 tree where most of the ACPI PPTT support is present.
>>>>
>>>> Regards,
>>>> Sudeep
>>>>
>>>> v1->v2:
>>>>         - removed duplicate definition for acpi_find_last_cache_level
>>>>
>>>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>>>> index 8f2cdb0eca71..4b35a66383f9 100644
>>>> --- a/include/linux/acpi.h
>>>> +++ b/include/linux/acpi.h
>>>> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>>>  }
>>>>  #endif
>>>>
>>>> +#ifdef CONFIG_ACPI_PPTT
>>>>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>>>>  int find_acpi_cpu_topology_package(unsigned int cpu);
>>>>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
>>>> +#else
>>>> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
>>>> +{
>>>> +       return -EINVAL;
>>>
>>> Why -EINVAL?
>>>
>>
>> I am not sure either. I used to return -ENOTSUPP, but IIRC someone
>> suggested to use it only for syscalls. Also I just based it on other
>> existing functions in acpi.h
>>
>> I am open for any alternatives if you think that is better here.
> 
> It would be good to make it consistent with the error codes returned
> by the functions when they are present.
> 
> Anyway, it's fine by me if that's consistent with the other acpi.h stubs.
> 

Thanks, indeed I copied it from existing stubs.

Can I take this as official Ack ?

-- 
Regards,
Sudeep

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

* Re: [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled
  2018-06-05 16:18         ` Sudeep Holla
@ 2018-06-05 16:20           ` Rafael J. Wysocki
  0 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2018-06-05 16:20 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Rafael J. Wysocki, ACPI Devel Maling List, Rafael J . Wysocki,
	Catalin Marinas, Jeremy Linton, Morten Rasmussen, Linux ARM,
	Linux Kernel Mailing List, Hanjun Guo, Geert Uytterhoeven

On Tue, Jun 5, 2018 at 6:18 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>
> On 05/06/18 17:12, Rafael J. Wysocki wrote:
>> On Tue, Jun 5, 2018 at 5:33 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>
>>>
>>> On 05/06/18 16:00, Rafael J. Wysocki wrote:
>>>> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>>> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
>>>>> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>>>>>
>>>>> This patch adds the missing dummy/boiler plate implementation to fix
>>>>> the build.
>>>>>
>>>>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>>>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>>>> ---
>>>>>  include/linux/acpi.h      | 15 +++++++++++++++
>>>>>  include/linux/cacheinfo.h |  2 +-
>>>>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>>>>
>>>>> Hi Rafael,
>>>>>
>>>>> If you are fine with this, can you provide Ack, so that we route this
>>>>> through ARM64 tree where most of the ACPI PPTT support is present.
>>>>>
>>>>> Regards,
>>>>> Sudeep
>>>>>
>>>>> v1->v2:
>>>>>         - removed duplicate definition for acpi_find_last_cache_level
>>>>>
>>>>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>>>>> index 8f2cdb0eca71..4b35a66383f9 100644
>>>>> --- a/include/linux/acpi.h
>>>>> +++ b/include/linux/acpi.h
>>>>> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>>>>  }
>>>>>  #endif
>>>>>
>>>>> +#ifdef CONFIG_ACPI_PPTT
>>>>>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>>>>>  int find_acpi_cpu_topology_package(unsigned int cpu);
>>>>>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
>>>>> +#else
>>>>> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
>>>>> +{
>>>>> +       return -EINVAL;
>>>>
>>>> Why -EINVAL?
>>>>
>>>
>>> I am not sure either. I used to return -ENOTSUPP, but IIRC someone
>>> suggested to use it only for syscalls. Also I just based it on other
>>> existing functions in acpi.h
>>>
>>> I am open for any alternatives if you think that is better here.
>>
>> It would be good to make it consistent with the error codes returned
>> by the functions when they are present.
>>
>> Anyway, it's fine by me if that's consistent with the other acpi.h stubs.
>>
>
> Thanks, indeed I copied it from existing stubs.
>
> Can I take this as official Ack ?

Yes, please.

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

* Re: [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily
  2018-06-05 15:27     ` Sudeep Holla
@ 2018-06-05 16:38       ` Jeremy Linton
  0 siblings, 0 replies; 12+ messages in thread
From: Jeremy Linton @ 2018-06-05 16:38 UTC (permalink / raw)
  To: Sudeep Holla, Rafael J. Wysocki
  Cc: ACPI Devel Maling List, Rafael J . Wysocki, Catalin Marinas,
	Morten Rasmussen, Linux ARM, Linux Kernel Mailing List,
	Hanjun Guo, Geert Uytterhoeven, Will Deacon

Hi,

On 06/05/2018 10:27 AM, Sudeep Holla wrote:
> 
> 
> On 05/06/18 16:02, Rafael J. Wysocki wrote:
>> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>> Currently, ARM64 doesn't support updating the CPU topology masks on
>>> CPU hotplug operations. ACPI PPTT support rely on that missing feature
>>> which is technically not incorrect. Instead of reverting all the PPTT
>>> support, let's keep it simple and disable ACPI PPTT support on ARM64
>>> for time-being until the topology updates are added for CPU hotplug
>>> operations.
>>
>> When is that going to happen?
>>> Nobody else uses PPTT now.
>>
> 
> No we need it on ARM64. I have even the fixes for the original issue
> but it's bit invasive and too late as we are already in the merge
> window. It needs to be tested on NUMA platforms, I have asked for that
> explicitly.
> 

So, there is a lot simpler fix for this, and its to remove the numa mask 
dependency from the scheduler domain building. That is just a couple 
line fix, and it reverts !ACPI to its original behavior, while the ACPI 
LLC building will work around the NUMA in package issue that caused 
patch 12/12 as the machine in question doesn't have a LLC crossing numa 
domains.

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

* Re: [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled
  2018-06-05 14:35 ` [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled Sudeep Holla
  2018-06-05 15:00   ` Rafael J. Wysocki
@ 2018-06-05 17:08   ` Catalin Marinas
  1 sibling, 0 replies; 12+ messages in thread
From: Catalin Marinas @ 2018-06-05 17:08 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-acpi, Rafael J . Wysocki, Jeremy Linton, linux-kernel,
	Geert Uytterhoeven, Hanjun Guo, Morten Rasmussen,
	linux-arm-kernel

On Tue, Jun 05, 2018 at 03:35:03PM +0100, Sudeep Holla wrote:
> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
> 
> This patch adds the missing dummy/boiler plate implementation to fix
> the build.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  include/linux/acpi.h      | 15 +++++++++++++++
>  include/linux/cacheinfo.h |  2 +-
>  2 files changed, 16 insertions(+), 1 deletion(-)

I queued this patch for now, it's a good clean-up regardless of whether
we disable PPTT temporarily or not.

Thanks.

-- 
Catalin

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

end of thread, other threads:[~2018-06-05 17:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 14:35 [PATCH v2 1/3] Revert "arm64: topology: divorce MC scheduling domain from core_siblings" Sudeep Holla
2018-06-05 14:35 ` [PATCH v2 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled Sudeep Holla
2018-06-05 15:00   ` Rafael J. Wysocki
2018-06-05 15:33     ` Sudeep Holla
2018-06-05 16:12       ` Rafael J. Wysocki
2018-06-05 16:18         ` Sudeep Holla
2018-06-05 16:20           ` Rafael J. Wysocki
2018-06-05 17:08   ` Catalin Marinas
2018-06-05 14:35 ` [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily Sudeep Holla
2018-06-05 15:02   ` Rafael J. Wysocki
2018-06-05 15:27     ` Sudeep Holla
2018-06-05 16:38       ` Jeremy Linton

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).