aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Picco <bob.picco@hp.com>2006-06-28 12:54:55 -0400
committerTony Luck <tony.luck@intel.com>2006-08-03 13:12:30 -0400
commit921eea1cdf6ce7f0db88e4579474a04b1fb0fe6d (patch)
tree51a9099562dffa2276100f1bff429cc5dc2e4118
parent0a69ca91be2b36f99a48daacd1f12d9d49ecaf87 (diff)
[IA64] align high endpoint of VIRTUAL_MEM_MAP
Assure that vmem_map's high endpoint is MAX_ORDER aligned. Not doing so violates the buddy allocator algorithm. Also anyone using mem=XXX on boot line and not aligned to MAX_ORDER requires this patch in order to satisfy buddy allocator. vmem_map always starts at pfn 0. The potentially large MAX_ORDER on ia64 (due to hugetlbfs) requires that the end of vmem_map be aligned to MAX_ORDER_NR_PAGES. This was boot tested for: FLATMEM, FLATMEM+VIRTUAL_MEM_MAP, DISCONTIGMEM+VIRTUAL_MEM_MAP and SPARSEMEM. Signed-off-by: Bob Picco <bob.picco@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/mm/contig.c3
-rw-r--r--arch/ia64/mm/discontig.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index 2a88cdd6d924..8919fed9666a 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -277,7 +277,8 @@ paging_init (void)
277 277
278 /* allocate virtual_mem_map */ 278 /* allocate virtual_mem_map */
279 279
280 map_size = PAGE_ALIGN(max_low_pfn * sizeof(struct page)); 280 map_size = PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
281 sizeof(struct page));
281 vmalloc_end -= map_size; 282 vmalloc_end -= map_size;
282 vmem_map = (struct page *) vmalloc_end; 283 vmem_map = (struct page *) vmalloc_end;
283 efi_memmap_walk(create_mem_map_page_table, NULL); 284 efi_memmap_walk(create_mem_map_page_table, NULL);
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 99bd9e30db96..8eeb669917fa 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -751,7 +751,8 @@ void __init paging_init(void)
751 efi_memmap_walk(filter_rsvd_memory, count_node_pages); 751 efi_memmap_walk(filter_rsvd_memory, count_node_pages);
752 752
753#ifdef CONFIG_VIRTUAL_MEM_MAP 753#ifdef CONFIG_VIRTUAL_MEM_MAP
754 vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page)); 754 vmalloc_end -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
755 sizeof(struct page));
755 vmem_map = (struct page *) vmalloc_end; 756 vmem_map = (struct page *) vmalloc_end;
756 efi_memmap_walk(create_mem_map_page_table, NULL); 757 efi_memmap_walk(create_mem_map_page_table, NULL);
757 printk("Virtual mem_map starts at 0x%p\n", vmem_map); 758 printk("Virtual mem_map starts at 0x%p\n", vmem_map);