From: Tejun Heo <tj@kernel.org>
To: mingo@redhat.com, yinghai@kernel.org, rientjes@google.com,
tglx@linutronix.de, hpa@zytor.com, x86@kernel.org,
linux-kernel@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 17/25] x86, NUMA: Enable build of generic NUMA init code on 32bit
Date: Fri, 29 Apr 2011 17:28:36 +0200 [thread overview]
Message-ID: <1304090924-8197-18-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1304090924-8197-1-git-send-email-tj@kernel.org>
Generic NUMA init code was moved to numa.c from numa_64.c but is still
guaraded by CONFIG_X86_64. This patch removes the compile guard and
enables compiling on 32bit.
* numa_add_memblk() and numa_set_distance() clash with the shim
implementation in numa_32.c and are left out.
* memory_add_physaddr_to_nid() clashes with 32bit implementation and
is left out.
* MAX_DMA_PFN definition in dma.h moved out of !CONFIG_X86_32.
* node_data definition in numa_32.c removed in favor of the one in
numa.c.
There are places where ulong is assumed to be 64bit. The next patch
will fix them up. Note that although the code is compiled it isn't
used yet and this patch doesn't cause any functional change.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
arch/x86/include/asm/dma.h | 6 +++---
arch/x86/mm/numa.c | 10 ++++------
arch/x86/mm/numa_32.c | 3 ---
3 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h
index 057099e..d1a314b 100644
--- a/arch/x86/include/asm/dma.h
+++ b/arch/x86/include/asm/dma.h
@@ -69,6 +69,9 @@
#define MAX_DMA_CHANNELS 8
+/* 16MB ISA DMA zone */
+#define MAX_DMA_PFN ((16 * 1024 * 1024) >> PAGE_SHIFT)
+
#ifdef CONFIG_X86_32
/* The maximum address that we can perform a DMA transfer to on this platform */
@@ -76,9 +79,6 @@
#else
-/* 16MB ISA DMA zone */
-#define MAX_DMA_PFN ((16 * 1024 * 1024) >> PAGE_SHIFT)
-
/* 4GB broken PCI/AGP hardware bus master zone */
#define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT)
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 3b20547..22dc9ed 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -23,7 +23,6 @@
int __initdata numa_off;
nodemask_t numa_nodes_parsed __initdata;
-#ifdef CONFIG_X86_64
struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
EXPORT_SYMBOL(node_data);
@@ -35,7 +34,6 @@ __initdata
static int numa_distance_cnt;
static u8 *numa_distance;
-#endif
static __init int numa_setup(char *opt)
{
@@ -134,7 +132,6 @@ void __init setup_node_to_cpumask_map(void)
pr_debug("Node to cpumask map for %d nodes\n", nr_node_ids);
}
-#ifdef CONFIG_X86_64
static int __init numa_add_memblk_to(int nid, u64 start, u64 end,
struct numa_meminfo *mi)
{
@@ -176,6 +173,7 @@ void __init numa_remove_memblk_from(int idx, struct numa_meminfo *mi)
(mi->nr_blks - idx) * sizeof(mi->blk[0]));
}
+#ifdef CONFIG_X86_64
/**
* numa_add_memblk - Add one numa_memblk to numa_meminfo
* @nid: NUMA node ID of the new memblk
@@ -191,6 +189,7 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
{
return numa_add_memblk_to(nid, start, end, &numa_meminfo);
}
+#endif
/* Initialize bootmem allocator for a node */
static void __init
@@ -402,6 +401,7 @@ static int __init numa_alloc_distance(void)
return 0;
}
+#ifdef CONFIG_X86_64
/**
* numa_set_distance - Set NUMA distance from one NUMA to another
* @from: the 'from' node to set distance
@@ -440,6 +440,7 @@ void __init numa_set_distance(int from, int to, int distance)
numa_distance[from * numa_distance_cnt + to] = distance;
}
+#endif
int __node_distance(int from, int to)
{
@@ -518,7 +519,6 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
return 0;
}
-#endif
/*
* There are unfortunately some poorly designed mainboards around that
@@ -542,7 +542,6 @@ void __init numa_init_array(void)
}
}
-#ifdef CONFIG_X86_64
static int __init numa_init(int (*init_func)(void))
{
int i;
@@ -627,7 +626,6 @@ void __init x86_numa_init(void)
numa_init(dummy_numa_init);
}
-#endif
static __init int find_near_online_node(int node)
{
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index 14135e5..975a76f 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -41,9 +41,6 @@
#include <asm/bios_ebda.h>
#include <asm/proto.h>
-struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
-EXPORT_SYMBOL(node_data);
-
/*
* numa interface - we expect the numa architecture specific code to have
* populated the following initialisation.
--
1.7.1
next prev parent reply other threads:[~2011-04-29 15:31 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 15:28 [PATCHSET tip] x86, NUMA: Unify 32 and 64bit NUMA initialization Tejun Heo
2011-04-29 15:28 ` [PATCH 01/25] x86-64, NUMA: Simplify hotadd memory handling Tejun Heo
2011-04-29 15:28 ` [PATCH 02/25] x86-64, NUMA: trivial cleanups for setup_node_bootmem() Tejun Heo
2011-04-29 15:28 ` [PATCH 03/25] x86-64, NUMA: simplify nodedata allocation Tejun Heo
2011-04-29 17:23 ` Yinghai Lu
2011-04-30 12:02 ` Tejun Heo
2011-04-29 15:28 ` [PATCH 04/25] x86-32, NUMA: Automatically set apicid -> node in setup_local_APIC() Tejun Heo
2011-04-29 15:28 ` [PATCH 05/25] x86, NUMA: Unify 32/64bit numa_cpu_node() implementation Tejun Heo
2011-04-29 15:28 ` [PATCH 06/25] x86-32, NUMA: Make apic->x86_32_numa_cpu_node() optional Tejun Heo
2011-04-29 15:28 ` [PATCH 07/25] x86-32, NUMA: use sparse_memory_present_with_active_regions() Tejun Heo
2011-04-29 15:28 ` [PATCH 08/25] x86, NUMA: trivial cleanups Tejun Heo
2011-04-29 17:25 ` Yinghai Lu
2011-04-30 12:03 ` Tejun Heo
2011-04-30 16:24 ` Yinghai Lu
2011-04-30 18:00 ` Tejun Heo
2011-04-30 23:10 ` Yinghai Lu
2011-04-30 23:11 ` [PATCH] x86, numa: Rename setup_node_bootmem to setup_node_data Yinghai Lu
2011-04-29 15:28 ` [PATCH 09/25] x86, NUMA: rename srat_64.c to srat.c Tejun Heo
2011-04-29 15:28 ` [PATCH 10/25] x86, NUMA: make srat.c 32bit safe Tejun Heo
2011-04-29 15:28 ` [PATCH 11/25] x86-32, NUMA: Move get_memcfg_numa() into numa_32.c Tejun Heo
2011-04-29 15:28 ` [PATCH 12/25] x86, NUMA: Move numa_nodes_parsed to numa.[hc] Tejun Heo
2011-04-29 15:28 ` [PATCH 13/25] x86-32, NUMA: implement temporary NUMA init shims Tejun Heo
2011-04-29 15:28 ` [PATCH 14/25] x86-32, NUMA: Replace srat_32.c with srat.c Tejun Heo
2011-04-29 15:28 ` [PATCH 15/25] x86-32, NUMA: Update numaq to use new NUMA init protocol Tejun Heo
2011-04-29 15:28 ` [PATCH 16/25] x86, NUMA: Move NUMA init logic from numa_64.c to numa.c Tejun Heo
2011-04-29 15:28 ` Tejun Heo [this message]
2011-04-29 15:28 ` [PATCH 18/25] x86, NUMA: Remove long 64bit assumption from numa.c Tejun Heo
2011-04-29 15:28 ` [PATCH 19/25] x86-32, NUMA: Add @start and @end to init_alloc_remap() Tejun Heo
2011-04-29 15:28 ` [PATCH 20/25] x86, NUMA: Initialize and use remap allocator from setup_node_bootmem() Tejun Heo
2011-04-29 15:28 ` [PATCH 21/25] x86, NUMA: Make 32bit use common NUMA init path Tejun Heo
2011-04-29 15:28 ` [PATCH 22/25] x86, NUMA: Make numa_init_array() static Tejun Heo
2011-04-29 15:28 ` [PATCH 23/25] x86, NUMA: Rename amdtopology_64.c to amdtopology.c Tejun Heo
2011-04-29 15:28 ` [PATCH 24/25] x86, NUMA: Enable CONFIG_AMD_NUMA on 32bit too Tejun Heo
2011-04-29 15:28 ` [PATCH 25/25] x86, NUMA: Enable emulation " Tejun Heo
2011-04-29 18:15 ` [PATCHSET tip] x86, NUMA: Unify 32 and 64bit NUMA initialization Ingo Molnar
2011-04-29 20:14 ` Yinghai Lu
2011-04-30 12:17 ` Tejun Heo
2011-04-30 12:33 ` [PATCH] x86, NUMA: Fix empty memblk detection in numa_cleanup_meminfo() Tejun Heo
2011-04-30 12:35 ` Tejun Heo
2011-05-01 0:43 ` Yinghai Lu
2011-05-01 10:20 ` Tejun Heo
2011-05-01 19:44 ` [PATCH] x86, numa: Trim numa meminfo with max_pfn in separated loop Yinghai Lu
2011-04-30 16:31 ` [PATCHSET tip] x86, NUMA: Unify 32 and 64bit NUMA initialization Yinghai Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304090924-8197-18-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rientjes@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox