diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 81e18ceef579..3d974cb2a1a1 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/stop_machine.h> | 46 | #include <linux/stop_machine.h> |
47 | #include <linux/sort.h> | 47 | #include <linux/sort.h> |
48 | #include <linux/pfn.h> | 48 | #include <linux/pfn.h> |
49 | #include <xen/xen.h> | ||
49 | #include <linux/backing-dev.h> | 50 | #include <linux/backing-dev.h> |
50 | #include <linux/fault-inject.h> | 51 | #include <linux/fault-inject.h> |
51 | #include <linux/page-isolation.h> | 52 | #include <linux/page-isolation.h> |
@@ -347,6 +348,9 @@ static inline bool update_defer_init(pg_data_t *pgdat, | |||
347 | /* Always populate low zones for address-constrained allocations */ | 348 | /* Always populate low zones for address-constrained allocations */ |
348 | if (zone_end < pgdat_end_pfn(pgdat)) | 349 | if (zone_end < pgdat_end_pfn(pgdat)) |
349 | return true; | 350 | return true; |
351 | /* Xen PV domains need page structures early */ | ||
352 | if (xen_pv_domain()) | ||
353 | return true; | ||
350 | (*nr_initialised)++; | 354 | (*nr_initialised)++; |
351 | if ((*nr_initialised > pgdat->static_init_pgcnt) && | 355 | if ((*nr_initialised > pgdat->static_init_pgcnt) && |
352 | (pfn & (PAGES_PER_SECTION - 1)) == 0) { | 356 | (pfn & (PAGES_PER_SECTION - 1)) == 0) { |
@@ -5355,9 +5359,14 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, | |||
5355 | /* | 5359 | /* |
5356 | * Skip to the pfn preceding the next valid one (or | 5360 | * Skip to the pfn preceding the next valid one (or |
5357 | * end_pfn), such that we hit a valid pfn (or end_pfn) | 5361 | * end_pfn), such that we hit a valid pfn (or end_pfn) |
5358 | * on our next iteration of the loop. | 5362 | * on our next iteration of the loop. Note that it needs |
5363 | * to be pageblock aligned even when the region itself | ||
5364 | * is not. move_freepages_block() can shift ahead of | ||
5365 | * the valid region but still depends on correct page | ||
5366 | * metadata. | ||
5359 | */ | 5367 | */ |
5360 | pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1; | 5368 | pfn = (memblock_next_valid_pfn(pfn, end_pfn) & |
5369 | ~(pageblock_nr_pages-1)) - 1; | ||
5361 | #endif | 5370 | #endif |
5362 | continue; | 5371 | continue; |
5363 | } | 5372 | } |