Skip to contentSkip to conversation

Fix SH config error.

PATCH In review Gon Solo 4 participants 9 messages Dec 16, 2019 – May 4, 2020 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

Gon Solo

author
#0 lore raw

cover Fix SH config error.

This fixes an error reported at
http://kisskb.ellerman.id.au/kisskb/buildresult/14067948.

On SH4 it was possible to configure NUMA without SMP.

Gon Solo (1):
Fix undefined reference to 'node_reclaim_distance'.

 arch/sh/mm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH 1/1 Fix undefined reference to 'node_reclaim_distance'.

According to https://lkml.org/lkml/2019/12/16/101 and
http://kisskb.ellerman.id.au/kisskb/buildresult/14067948/ building on sh4 is broken due to a

page_alloc.c:(.text+0x3148): undefined reference to `node_reclaim_distance'.

This only happens with CONFIG_NUMA=y (variable used with #ifdef CONFIG_NUMA at mm/page_alloc.c:3529) and CONFIG_SMP=n (variable defined at kernel/sched/topology.c:2291 but the whole file to be built depends on CONFIG_SMP in kernel/sched/Makefile:23.

Follow the lead of arch/x86/Kconfig:1547 and depend on SMP.

This assumes that there are no NUMA systems without SMP which is reasonable I guess.

---
 arch/sh/mm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/mm/Kconfig +1 -1
index 5c8a2ebfc720..cf655d8e8758 100644
@@ -108,7 +108,7 @@ config VSYSCALL
 
 config NUMA
 	bool "Non Uniform Memory Access (NUMA) Support"
-	depends on MMU && SYS_SUPPORTS_NUMA
+	depends on MMU && SMP && SYS_SUPPORTS_NUMA
 	select ARCH_WANT_NUMA_VARIABLE_LOCALITY
 	default n
 	help
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH 1/1] Fix undefined reference to 'node_reclaim_distance'.

Hi Gon,

Thanks for your patch!

Quoted 11 lines · Gon Solo

According to https://lkml.org/lkml/2019/12/16/101 and
http://kisskb.ellerman.id.au/kisskb/buildresult/14067948/ building on sh4 is broken due to a

page_alloc.c:(.text+0x3148): undefined reference to `node_reclaim_distance'.

This only happens with CONFIG_NUMA=y (variable used with #ifdef CONFIG_NUMA at mm/page_alloc.c:3529) and CONFIG_SMP=n (variable defined at kernel/sched/topology.c:2291 but the whole file to be built depends on CONFIG_SMP in kernel/sched/Makefile:23.

Quoted 4 lines

Follow the lead of arch/x86/Kconfig:1547 and depend on SMP.

This assumes that there are no NUMA systems without SMP which is reasonable I guess.

Unfortunately that may be an x86-centric assumption: on other platforms, there do exist systems with multiple memory banks with different access performance figures.

Quoted 10 lines
---
 arch/sh/mm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/mm/Kconfig +0 -0
index 5c8a2ebfc720..cf655d8e8758 100644

arch/sh/mm/Kconfig config VSYSCALL · line 114

Quoted 8 lines
arch/sh/mm/Kconfig +1 -1
@@ -108,7 +108,7 @@ config VSYSCALL
 
 config NUMA
        bool "Non Uniform Memory Access (NUMA) Support"
-       depends on MMU && SYS_SUPPORTS_NUMA
+       depends on MMU && SMP && SYS_SUPPORTS_NUMA
        select ARCH_WANT_NUMA_VARIABLE_LOCALITY
        default n
        help

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
author
#3 lore raw

Re: [PATCH 1/1] Fix undefined reference to 'node_reclaim_distance'.

Hi!

Quoted 3 lines

Unfortunately that may be an x86-centric assumption: on other platforms, there do exist systems with multiple memory banks with different access performance figures.

Does that mean that the line

obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o topology.o stop_task.o pelt.o

in kernel/sched/topology/Makefile:23 is wrong?

Because in topology.c:1284 the variable node_reclaim_distance ist defined which is used in mm/page_alloc.c:3529 without depending on SMP.

Signature · 1 line
g
#4 lore raw

Re: [PATCH 1/1] Fix undefined reference to 'node_reclaim_distance'.

Hi Gon,

Quoted 4 lines · Gonsolo
Quoted 3 lines

Unfortunately that may be an x86-centric assumption: on other platforms, there do exist systems with multiple memory banks with different access performance figures.

Quoted 8 lines

Does that mean that the line

obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o topology.o stop_task.o pelt.o

in kernel/sched/topology/Makefile:23 is wrong?

Because in topology.c:1284 the variable node_reclaim_distance ist defined which is used in mm/page_alloc.c:3529 without depending on SMP.

The offending commit seems to be a55c7454a8c887b2 ("sched/topology:
Improve load balancing on AMD EPYC systems").

Probably the node_reclaim_distance variable should be moved from an SMP-specific file to a NUMA-specific file.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
author
#5 lore raw

Re: [PATCH 1/1] Fix undefined reference to 'node_reclaim_distance'.

Quoted 5 lines

The offending commit seems to be a55c7454a8c887b2 ("sched/topology:
Improve load balancing on AMD EPYC systems").

Probably the node_reclaim_distance variable should be moved from an SMP-specific file to a NUMA-specific file.

There are two variables that are used elsewhere:

int sched_max_numa_distance;

Used in kernel/sched/fair.c and kernel/sched/topology.c. I would move it to fair.c.

int __read_mostly node_reclaim_distance = RECLAIM_DISTANCE;

Used in
arch/x86/kernel/cpu/amd.c, line 894
kernel/sched/topology.c
mm/khugepaged.c, line 725
mm/page_alloc.c, line 3529

I'm not sure where to move this one.

Signature · 1 line
g
#6 lore raw

Re: [PATCH 1/1] Fix undefined reference to 'node_reclaim_distance'.

Quoted 15 lines · Gonsolo
Quoted 5 lines

The offending commit seems to be a55c7454a8c887b2 ("sched/topology:
Improve load balancing on AMD EPYC systems").

Probably the node_reclaim_distance variable should be moved from an SMP-specific file to a NUMA-specific file.

There are two variables that are used elsewhere:

int sched_max_numa_distance;

Used in kernel/sched/fair.c and kernel/sched/topology.c. I would move it to fair.c.

int __read_mostly node_reclaim_distance = RECLAIM_DISTANCE;

Quoted 7 lines

Used in
arch/x86/kernel/cpu/amd.c, line 894
kernel/sched/topology.c
mm/khugepaged.c, line 725
mm/page_alloc.c, line 3529

I'm not sure where to move this one.

Can someone test out this patch on one of the failing architectures? (sh, ppc64)

---->8----

kernel/sched/topology.c +0 -1
index 6ec1e595b1d4..bf20e5883026 100644
@@ -1281,7 +1281,6 @@ static int			sched_domains_curr_level;
 int				sched_max_numa_distance;
 static int			*sched_domains_numa_distance;
 static struct cpumask		***sched_domains_numa_masks;
-int __read_mostly		node_reclaim_distance = RECLAIM_DISTANCE;
 #endif
 
 /*
mm/page_alloc.c +1 -0
index 4785a8a2040e..733890d913ea 100644
@@ -3523,6 +3523,7 @@ bool zone_watermark_ok_safe(struct zone *z, unsigned int order,
 }
 
 #ifdef CONFIG_NUMA
+int __read_mostly		node_reclaim_distance = RECLAIM_DISTANCE;
 static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone)
 {
 	return node_distance(zone_to_nid(local_zone), zone_to_nid(zone)) <
#7 lore raw

Re: [PATCH 1/1] Fix undefined reference to 'node_reclaim_distance'.

Quoted 22 lines · Matt Fleming
Quoted 21 lines · Gonsolo
Quoted 5 lines

The offending commit seems to be a55c7454a8c887b2 ("sched/topology:
Improve load balancing on AMD EPYC systems").

Probably the node_reclaim_distance variable should be moved from an SMP-specific file to a NUMA-specific file.

There are two variables that are used elsewhere:

int sched_max_numa_distance;

Used in kernel/sched/fair.c and kernel/sched/topology.c. I would move it to fair.c.

int __read_mostly node_reclaim_distance = RECLAIM_DISTANCE;

Used in
arch/x86/kernel/cpu/amd.c, line 894
kernel/sched/topology.c
mm/khugepaged.c, line 725
mm/page_alloc.c, line 3529

Quoted 4 lines
Quoted 1 line

I'm not sure where to move this one.

Can someone test out this patch on one of the failing architectures? (sh, ppc64)

Yes, it fixes the arch/sh/ build errors in my testing. I don't have a failing ppc64 .config file to test.

thanks.

Quoted 26 lines

---->8----

kernel/sched/topology.c +0 -1
index 6ec1e595b1d4..bf20e5883026 100644
@@ -1281,7 +1281,6 @@ static int			sched_domains_curr_level;
 int				sched_max_numa_distance;
 static int			*sched_domains_numa_distance;
 static struct cpumask		***sched_domains_numa_masks;
-int __read_mostly		node_reclaim_distance = RECLAIM_DISTANCE;
 #endif
 
 /*
mm/page_alloc.c +1 -0
index 4785a8a2040e..733890d913ea 100644
@@ -3523,6 +3523,7 @@ bool zone_watermark_ok_safe(struct zone *z, unsigned int order,
 }
 
 #ifdef CONFIG_NUMA
+int __read_mostly		node_reclaim_distance = RECLAIM_DISTANCE;
 static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone)
 {
 	return node_distance(zone_to_nid(local_zone), zone_to_nid(zone)) <> 
Signature · 2 lines
~Randy
Reported-by: Randy Dunlap <[email protected]>

A message that is not in the archive (sent off-list or not yet received): CANL0fFTCVj7c-EQTs1kRuOn8e++vgFw1fUTJfya12csWkJdGqA@mail.gmail.com

author
#9 lore raw

Re: [PATCH 1/1] Fix undefined reference to 'node_reclaim_distance'.

Hi!

Quoted 2 lines

Yes, it fixes the arch/sh/ build errors in my testing. I don't have a failing ppc64 .config file to test.

As of v5.7-rc4 this patch doesn't seem to have been applied and the build is still failing:
http://kisskb.ellerman.id.au/kisskb/buildresult/14067948/

kernel/sched/topology.c +0 -0
index 6ec1e595b1d4..bf20e5883026 100644
@@ -1281,7 +1281,6 @@ static int                      sched_domains_curr_level;

int sched_max_numa_distance;
static int *sched_domains_numa_distance;
static struct cpumask ***sched_domains_numa_masks;
-int __read_mostly node_reclaim_distance = RECLAIM_DISTANCE;
#endif

/*

mm/page_alloc.c +0 -0
index 4785a8a2040e..733890d913ea 100644
@@ -3523,6 +3523,7 @@ bool zone_watermark_ok_safe(struct zone *z,

unsigned int order,
}

#ifdef CONFIG_NUMA
+int __read_mostly node_reclaim_distance = RECLAIM_DISTANCE;
static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone) {
return node_distance(zone_to_nid(local_zone), zone_to_nid(zone)) <

Signature · 1 line
g