diff options
author | Ravikiran G Thirumalai <kiran@scalex86.org> | 2005-08-07 12:42:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-07 13:00:39 -0400 |
commit | 4b0271eb9da5170ab5cadf2edf97c84712c82550 (patch) | |
tree | 80fbfdcae56d07e7bcf27c3927e383ad3e35e378 /arch/i386/mm/discontig.c | |
parent | 079da354db3473b56eb938ca53a2cb0804ea9c8c (diff) |
[PATCH] Move the fix to align node_end_pfns to a proper location
Move the fix to align node_end_pfns to a proper location. The earlier fix
made the node_remap_start_vaddr to get misaligned causing remap_numa_kva to
barf again :-/
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/mm/discontig.c')
-rw-r--r-- | arch/i386/mm/discontig.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index c369a8bf7cbe..6711ce3f6916 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c | |||
@@ -243,14 +243,6 @@ static unsigned long calculate_numa_remap_pages(void) | |||
243 | /* now the roundup is correct, convert to PAGE_SIZE pages */ | 243 | /* now the roundup is correct, convert to PAGE_SIZE pages */ |
244 | size = size * PTRS_PER_PTE; | 244 | size = size * PTRS_PER_PTE; |
245 | 245 | ||
246 | if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) { | ||
247 | /* | ||
248 | * Adjust size if node_end_pfn is not on a proper | ||
249 | * pmd boundary. remap_numa_kva will barf otherwise. | ||
250 | */ | ||
251 | size += node_end_pfn[nid] & (PTRS_PER_PTE-1); | ||
252 | } | ||
253 | |||
254 | /* | 246 | /* |
255 | * Validate the region we are allocating only contains valid | 247 | * Validate the region we are allocating only contains valid |
256 | * pages. | 248 | * pages. |
@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void) | |||
270 | reserve_pages += size; | 262 | reserve_pages += size; |
271 | printk("Shrinking node %d from %ld pages to %ld pages\n", | 263 | printk("Shrinking node %d from %ld pages to %ld pages\n", |
272 | nid, node_end_pfn[nid], node_end_pfn[nid] - size); | 264 | nid, node_end_pfn[nid], node_end_pfn[nid] - size); |
265 | |||
266 | if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) { | ||
267 | /* | ||
268 | * Align node_end_pfn[] and node_remap_start_pfn[] to | ||
269 | * pmd boundary. remap_numa_kva will barf otherwise. | ||
270 | */ | ||
271 | printk("Shrinking node %d further by %ld pages for proper alignment\n", | ||
272 | nid, node_end_pfn[nid] & (PTRS_PER_PTE-1)); | ||
273 | size += node_end_pfn[nid] & (PTRS_PER_PTE-1); | ||
274 | } | ||
275 | |||
273 | node_end_pfn[nid] -= size; | 276 | node_end_pfn[nid] -= size; |
274 | node_remap_start_pfn[nid] = node_end_pfn[nid]; | 277 | node_remap_start_pfn[nid] = node_end_pfn[nid]; |
275 | } | 278 | } |