Fix SH config error.
Subsystems (4)
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
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
@@ -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
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 apage_alloc.c:(.text+0x3148): undefined reference to `node_reclaim_distance'.
This only happens with
CONFIG_NUMA=y(variable used with #ifdefCONFIG_NUMAatmm/page_alloc.c:3529) andCONFIG_SMP=n(variable defined atkernel/sched/topology.c:2291but the whole file to be built depends onCONFIG_SMPinkernel/sched/Makefile:23.
Quoted 4 lines
Follow the lead of
arch/x86/Kconfig:1547and 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
Signed-off-by Gon Solo <[email protected]>--- arch/sh/mm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/sh/mm/Kconfig +0
-0
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
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
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:23is wrong?Because in topology.c:1284 the variable
node_reclaim_distanceist defined which is used inmm/page_alloc.c:3529without 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
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_distancevariable 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 inarch/x86/kernel/cpu/amd.c, line 894kernel/sched/topology.cmm/khugepaged.c, line 725mm/page_alloc.c, line 3529
I'm not sure where to move this one.
Signature · 1 line
g
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_distancevariable 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.candkernel/sched/topology.c. I would move it tofair.c.int
__read_mostlynode_reclaim_distance=RECLAIM_DISTANCE;
Quoted 7 lines
Used in
arch/x86/kernel/cpu/amd.c, line 894kernel/sched/topology.cmm/khugepaged.c, line 725mm/page_alloc.c, line 3529I'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
@@ -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
@@ -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)) <
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_distancevariable 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.candkernel/sched/topology.c. I would move it tofair.c.int
__read_mostlynode_reclaim_distance=RECLAIM_DISTANCE;Used in
arch/x86/kernel/cpu/amd.c, line 894kernel/sched/topology.cmm/khugepaged.c, line 725mm/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@@ -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@@ -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
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
@@ -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
@@ -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