aboutsummaryrefslogtreecommitdiff
path: root/arch/i386/mm/discontig.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-11 00:07:03 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-11 00:07:03 -0400
commitcd04b947bc674f8fc9cac38ec30497bae5d664ad (patch)
tree988b0b7ea08063e5499672346eb2f619f0629717 /arch/i386/mm/discontig.c
parentb3df9f813bc7b9db62ae0c90b8990b1cebf97345 (diff)
parentbc68552faad0e134eb22281343d5ae5a4873fa80 (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'arch/i386/mm/discontig.c')
-rw-r--r--arch/i386/mm/discontig.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index c369a8bf7cb..6711ce3f691 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)
/* now the roundup is correct, convert to PAGE_SIZE pages */
size = size * PTRS_PER_PTE;
- if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) {
- /*
- * Adjust size if node_end_pfn is not on a proper
- * pmd boundary. remap_numa_kva will barf otherwise.
- */
- size += node_end_pfn[nid] & (PTRS_PER_PTE-1);
- }
-
/*
* Validate the region we are allocating only contains valid
* pages.
@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void)
reserve_pages += size;
printk("Shrinking node %d from %ld pages to %ld pages\n",
nid, node_end_pfn[nid], node_end_pfn[nid] - size);
+
+ if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) {
+ /*
+ * Align node_end_pfn[] and node_remap_start_pfn[] to
+ * pmd boundary. remap_numa_kva will barf otherwise.
+ */
+ printk("Shrinking node %d further by %ld pages for proper alignment\n",
+ nid, node_end_pfn[nid] & (PTRS_PER_PTE-1));
+ size += node_end_pfn[nid] & (PTRS_PER_PTE-1);
+ }
+
node_end_pfn[nid] -= size;
node_remap_start_pfn[nid] = node_end_pfn[nid];
}