diff mbox series

[1/2] mm: Move node_reclaim_distance to fix NUMA without SMP

Message ID 6432666a648dde85635341e6c918cee97c97d264.1631781495.git.geert+renesas@glider.be (mailing list archive)
State New
Headers show
Series Fix NUMA without SMP | expand

Commit Message

Geert Uytterhoeven Sept. 16, 2021, 8:42 a.m. UTC
If CONFIG_NUMA=y, but CONFIG_SMP=n (e.g. sh/migor_defconfig):

    sh4-linux-gnu-ld: mm/page_alloc.o: in function `get_page_from_freelist':
    page_alloc.c:(.text+0x2c24): undefined reference to `node_reclaim_distance'

Fix this by moving the declaration of node_reclaim_distance from an
SMP-only to a generic file.

Fixes: a55c7454a8c887b2 ("sched/topology: Improve load balancing on AMD EPYC systems")
Suggested-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 kernel/sched/topology.c | 1 -
 mm/page_alloc.c         | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Mel Gorman Sept. 21, 2021, 12:32 p.m. UTC | #1
On Thu, Sep 16, 2021 at 10:42:42AM +0200, Geert Uytterhoeven wrote:
> If CONFIG_NUMA=y, but CONFIG_SMP=n (e.g. sh/migor_defconfig):
> 
>     sh4-linux-gnu-ld: mm/page_alloc.o: in function `get_page_from_freelist':
>     page_alloc.c:(.text+0x2c24): undefined reference to `node_reclaim_distance'
> 
> Fix this by moving the declaration of node_reclaim_distance from an
> SMP-only to a generic file.
> 
> Fixes: a55c7454a8c887b2 ("sched/topology: Improve load balancing on AMD EPYC systems")
> Suggested-by: Matt Fleming <matt@codeblueprint.co.uk>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Mel Gorman <mgorman@suse.de>
diff mbox series

Patch

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 4e8698e62f0754a3..738ee7fa79724c7d 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1481,7 +1481,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;
 
 static unsigned long __read_mostly *sched_numa_onlined_nodes;
 #endif
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b37435c274cf1cb1..8b2d7a9bae6c1754 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3966,6 +3966,8 @@  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)) <=