Commit 4b0271eb authored by Ravikiran G Thirumalai's avatar Ravikiran G Thirumalai Committed by Linus Torvalds

[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: default avatarRavikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: default avatarShai Fultheim <shai@scalex86.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 079da354
...@@ -243,14 +243,6 @@ static unsigned long calculate_numa_remap_pages(void) ...@@ -243,14 +243,6 @@ static unsigned long calculate_numa_remap_pages(void)
/* now the roundup is correct, convert to PAGE_SIZE pages */ /* now the roundup is correct, convert to PAGE_SIZE pages */
size = size * PTRS_PER_PTE; 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 * Validate the region we are allocating only contains valid
* pages. * pages.
...@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void) ...@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void)
reserve_pages += size; reserve_pages += size;
printk("Shrinking node %d from %ld pages to %ld pages\n", printk("Shrinking node %d from %ld pages to %ld pages\n",
nid, node_end_pfn[nid], node_end_pfn[nid] - size); 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_end_pfn[nid] -= size;
node_remap_start_pfn[nid] = node_end_pfn[nid]; node_remap_start_pfn[nid] = node_end_pfn[nid];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment