diff options
author | Matt Tolentino <metolent@snoqualmie.dp.intel.com> | 2005-06-23 03:08:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-23 12:45:07 -0400 |
commit | bbfceef47fb9467424113a004070bf37a806a97c (patch) | |
tree | 3c12cef85abaaa0ca42088fc7600ed687b74fb5e /arch/x86_64/mm | |
parent | 2b97690f4cd960779fb351b7cd9974390afabb36 (diff) |
[PATCH] add x86-64 specific support for sparsemem
This patch adds in the necessary support for sparsemem such that x86-64
kernels may use sparsemem as an alternative to discontigmem for NUMA
kernels. Note that this does no preclude one from continuing to build NUMA
kernels using discontigmem, but merely allows the option to build NUMA
kernels with sparsemem.
Interestingly, the use of sparsemem in lieu of discontigmem in NUMA kernels
results in reduced text size for otherwise equivalent kernels as shown in
the example builds below:
text data bss dec hex filename
2371036 765884 1237108 4374028 42be0c vmlinux.discontig
2366549 776484 1302772 4445805 43d66d vmlinux.sparse
Signed-off-by: Matt Tolentino <matthew.e.tolentino@intel.com>
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/mm')
-rw-r--r-- | arch/x86_64/mm/numa.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c index fd9f25d7a6c4..84cde796ecb1 100644 --- a/arch/x86_64/mm/numa.c +++ b/arch/x86_64/mm/numa.c | |||
@@ -66,6 +66,13 @@ int __init compute_hash_shift(struct node *nodes, int numnodes) | |||
66 | return -1; | 66 | return -1; |
67 | } | 67 | } |
68 | 68 | ||
69 | #ifdef CONFIG_SPARSEMEM | ||
70 | int early_pfn_to_nid(unsigned long pfn) | ||
71 | { | ||
72 | return phys_to_nid(pfn << PAGE_SHIFT); | ||
73 | } | ||
74 | #endif | ||
75 | |||
69 | /* Initialize bootmem allocator for a node */ | 76 | /* Initialize bootmem allocator for a node */ |
70 | void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) | 77 | void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) |
71 | { | 78 | { |
@@ -80,6 +87,7 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long en | |||
80 | start_pfn = start >> PAGE_SHIFT; | 87 | start_pfn = start >> PAGE_SHIFT; |
81 | end_pfn = end >> PAGE_SHIFT; | 88 | end_pfn = end >> PAGE_SHIFT; |
82 | 89 | ||
90 | memory_present(nodeid, start_pfn, end_pfn); | ||
83 | nodedata_phys = find_e820_area(start, end, pgdat_size); | 91 | nodedata_phys = find_e820_area(start, end, pgdat_size); |
84 | if (nodedata_phys == -1L) | 92 | if (nodedata_phys == -1L) |
85 | panic("Cannot find memory pgdat in node %d\n", nodeid); | 93 | panic("Cannot find memory pgdat in node %d\n", nodeid); |