diff options
author | Amul Shah <amul.shah@unisys.com> | 2007-02-13 07:26:20 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 07:26:20 -0500 |
commit | 54413927f022292aeccadd268fbf1c0b42129945 (patch) | |
tree | ce5aa0834b56519e8a202e1ae25b878fb124b9e1 /arch/x86_64/mm/numa.c | |
parent | 076422d2af7e3d8e72c6e70843f6ea377714b082 (diff) |
[PATCH] x86-64: x86_64-make-the-numa-hash-function-nodemap-allocation fix fix
- Removed an extraneous debug message from allocate_cachealigned_map
- Changed extract_lsb_from_nodes to return 63 for the case where there was
only one memory node. The prevents the creation of the dynamic hashmap.
- Changed extract_lsb_from_nodes to use only the starting memory address of
a node. On an ES7000, our nodes overlap the starting and ending address,
meaning, that we see nodes like
00000 - 10000
10000 - 20000
But other systems have nodes whose start and end addresses do not overlap.
For example:
00000 - 0FFFF
10000 - 1FFFF
In this case, using the ending address will result in an LSB much lower
than what is possible. In this case an LSB of 1 when in reality it should
be 16.
Cc: Andi Kleen <ak@suse.de>
Cc: Rohit Seth <rohitseth@google.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/mm/numa.c')
-rw-r--r-- | arch/x86_64/mm/numa.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c index 7d9c428f4094..1ec16ea97519 100644 --- a/arch/x86_64/mm/numa.c +++ b/arch/x86_64/mm/numa.c | |||
@@ -78,11 +78,8 @@ static int __init allocate_cachealigned_memnodemap(void) | |||
78 | unsigned long pad, pad_addr; | 78 | unsigned long pad, pad_addr; |
79 | 79 | ||
80 | memnodemap = memnode.embedded_map; | 80 | memnodemap = memnode.embedded_map; |
81 | if (memnodemapsize <= 48) { | 81 | if (memnodemapsize <= 48) |
82 | printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n", | ||
83 | nodemap_addr, nodemap_addr + nodemap_size); | ||
84 | return 0; | 82 | return 0; |
85 | } | ||
86 | 83 | ||
87 | pad = L1_CACHE_BYTES - 1; | 84 | pad = L1_CACHE_BYTES - 1; |
88 | pad_addr = 0x8000; | 85 | pad_addr = 0x8000; |
@@ -110,7 +107,7 @@ static int __init allocate_cachealigned_memnodemap(void) | |||
110 | static int __init | 107 | static int __init |
111 | extract_lsb_from_nodes (const struct bootnode *nodes, int numnodes) | 108 | extract_lsb_from_nodes (const struct bootnode *nodes, int numnodes) |
112 | { | 109 | { |
113 | int i; | 110 | int i, nodes_used = 0; |
114 | unsigned long start, end; | 111 | unsigned long start, end; |
115 | unsigned long bitfield = 0, memtop = 0; | 112 | unsigned long bitfield = 0, memtop = 0; |
116 | 113 | ||
@@ -119,11 +116,15 @@ extract_lsb_from_nodes (const struct bootnode *nodes, int numnodes) | |||
119 | end = nodes[i].end; | 116 | end = nodes[i].end; |
120 | if (start >= end) | 117 | if (start >= end) |
121 | continue; | 118 | continue; |
122 | bitfield |= start | end; | 119 | bitfield |= start; |
120 | nodes_used++; | ||
123 | if (end > memtop) | 121 | if (end > memtop) |
124 | memtop = end; | 122 | memtop = end; |
125 | } | 123 | } |
126 | i = find_first_bit(&bitfield, sizeof(unsigned long)*8); | 124 | if (nodes_used <= 1) |
125 | i = 63; | ||
126 | else | ||
127 | i = find_first_bit(&bitfield, sizeof(unsigned long)*8); | ||
127 | memnodemapsize = (memtop >> i)+1; | 128 | memnodemapsize = (memtop >> i)+1; |
128 | return i; | 129 | return i; |
129 | } | 130 | } |