aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/mm/discontig.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index b358f0702a44fa..c369a8bf7cbec4 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -243,6 +243,14 @@ 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.