diff options
| -rw-r--r-- | arch/i386/mm/discontig.c | 14 | ||||
| -rw-r--r-- | arch/i386/mm/init.c | 2 | ||||
| -rw-r--r-- | include/asm-i386/page.h | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index dcc71f969b01..088ca4722183 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c | |||
| @@ -216,6 +216,7 @@ static unsigned long calculate_numa_remap_pages(void) | |||
| 216 | { | 216 | { |
| 217 | int nid; | 217 | int nid; |
| 218 | unsigned long size, reserve_pages = 0; | 218 | unsigned long size, reserve_pages = 0; |
| 219 | unsigned long pfn; | ||
| 219 | 220 | ||
| 220 | for_each_online_node(nid) { | 221 | for_each_online_node(nid) { |
| 221 | /* | 222 | /* |
| @@ -234,6 +235,19 @@ static unsigned long calculate_numa_remap_pages(void) | |||
| 234 | size = (size + LARGE_PAGE_BYTES - 1) / LARGE_PAGE_BYTES; | 235 | size = (size + LARGE_PAGE_BYTES - 1) / LARGE_PAGE_BYTES; |
| 235 | /* now the roundup is correct, convert to PAGE_SIZE pages */ | 236 | /* now the roundup is correct, convert to PAGE_SIZE pages */ |
| 236 | size = size * PTRS_PER_PTE; | 237 | size = size * PTRS_PER_PTE; |
| 238 | |||
| 239 | /* | ||
| 240 | * Validate the region we are allocating only contains valid | ||
| 241 | * pages. | ||
| 242 | */ | ||
| 243 | for (pfn = node_end_pfn[nid] - size; | ||
| 244 | pfn < node_end_pfn[nid]; pfn++) | ||
| 245 | if (!page_is_ram(pfn)) | ||
| 246 | break; | ||
| 247 | |||
| 248 | if (pfn != node_end_pfn[nid]) | ||
| 249 | size = 0; | ||
| 250 | |||
| 237 | printk("Reserving %ld pages of KVA for lmem_map of node %d\n", | 251 | printk("Reserving %ld pages of KVA for lmem_map of node %d\n", |
| 238 | size, nid); | 252 | size, nid); |
| 239 | node_remap_size[nid] = size; | 253 | node_remap_size[nid] = size; |
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index 8766c771bb45..666ca79fb50a 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c | |||
| @@ -191,7 +191,7 @@ static inline int page_kills_ppro(unsigned long pagenr) | |||
| 191 | 191 | ||
| 192 | extern int is_available_memory(efi_memory_desc_t *); | 192 | extern int is_available_memory(efi_memory_desc_t *); |
| 193 | 193 | ||
| 194 | static inline int page_is_ram(unsigned long pagenr) | 194 | int page_is_ram(unsigned long pagenr) |
| 195 | { | 195 | { |
| 196 | int i; | 196 | int i; |
| 197 | unsigned long addr, end; | 197 | unsigned long addr, end; |
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 41400d342d44..8f3dded01bff 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h | |||
| @@ -120,6 +120,8 @@ static __inline__ int get_order(unsigned long size) | |||
| 120 | 120 | ||
| 121 | extern int sysctl_legacy_va_layout; | 121 | extern int sysctl_legacy_va_layout; |
| 122 | 122 | ||
| 123 | extern int page_is_ram(unsigned long pagenr); | ||
| 124 | |||
| 123 | #endif /* __ASSEMBLY__ */ | 125 | #endif /* __ASSEMBLY__ */ |
| 124 | 126 | ||
| 125 | #ifdef __ASSEMBLY__ | 127 | #ifdef __ASSEMBLY__ |
