[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-94cc60b72f99006f6f2b9b5b7317805d6e5abddb@git.kernel.org>
Date: Wed, 4 Jul 2018 09:15:57 -0700
From: tip-bot for Dan Williams <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: dan.j.williams@...el.com, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, lkp@...el.com, rientjes@...gle.com,
hpa@...or.com, richard.weiyang@...il.com, peterz@...radead.org,
mingo@...nel.org, tglx@...utronix.de
Subject: [tip:x86/cpu] x86/numa_emulation: Fix uniform size build failure
Commit-ID: 94cc60b72f99006f6f2b9b5b7317805d6e5abddb
Gitweb: https://git.kernel.org/tip/94cc60b72f99006f6f2b9b5b7317805d6e5abddb
Author: Dan Williams <dan.j.williams@...el.com>
AuthorDate: Tue, 3 Jul 2018 14:00:57 -0700
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 4 Jul 2018 18:12:20 +0200
x86/numa_emulation: Fix uniform size build failure
The calculation of a uniform numa-node size attempted to perform
division with a 64-bit diviser leading to the following failure on
32-bit:
arch/x86/mm/numa_emulation.o: In function `split_nodes_size_interleave_uniform':
arch/x86/mm/numa_emulation.c:239: undefined reference to `__udivdi3'
Convert the implementation to do the division in terms of pages and then
shift the result back to an absolute physical address.
Reported-by: kbuild test robot <lkp@...el.com>
Signed-off-by: Dan Williams <dan.j.williams@...el.com>
Cc: David Rientjes <rientjes@...gle.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Wei Yang <richard.weiyang@...il.com>
Cc: linux-mm@...ck.org
Fixes: 93e738834fcc ("x86/numa_emulation: Introduce uniform split capability")
Link: http://lkml.kernel.org/r/153065162801.12250.4860144566061573514.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/mm/numa_emulation.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c
index 039db00541b7..cc7523e45926 100644
--- a/arch/x86/mm/numa_emulation.c
+++ b/arch/x86/mm/numa_emulation.c
@@ -198,6 +198,14 @@ static u64 __init find_end_of_node(u64 start, u64 max_addr, u64 size)
return end;
}
+static u64 uniform_size(u64 max_addr, u64 base, int nr_nodes)
+{
+ unsigned long max_pfn = PHYS_PFN(max_addr);
+ unsigned long base_pfn = PHYS_PFN(base);
+
+ return PFN_PHYS((max_pfn - base_pfn) / nr_nodes);
+}
+
/*
* Sets up fake nodes of `size' interleaved over physical nodes ranging from
* `addr' to `max_addr'.
@@ -236,7 +244,7 @@ static int __init split_nodes_size_interleave_uniform(struct numa_meminfo *ei,
}
if (uniform) {
- min_size = (max_addr - addr) / nr_nodes;
+ min_size = uniform_size(max_addr, addr, nr_nodes);
size = min_size;
} else {
/*
Powered by blists - more mailing lists