Commit 921eea1c authored by Bob Picco's avatar Bob Picco Committed by Tony Luck

[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: default avatarBob Picco <bob.picco@hp.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 0a69ca91
...@@ -277,7 +277,8 @@ paging_init (void) ...@@ -277,7 +277,8 @@ paging_init (void)
/* allocate virtual_mem_map */ /* allocate virtual_mem_map */
map_size = PAGE_ALIGN(max_low_pfn * sizeof(struct page)); map_size = PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
sizeof(struct page));
vmalloc_end -= map_size; vmalloc_end -= map_size;
vmem_map = (struct page *) vmalloc_end; vmem_map = (struct page *) vmalloc_end;
efi_memmap_walk(create_mem_map_page_table, NULL); efi_memmap_walk(create_mem_map_page_table, NULL);
......
...@@ -751,7 +751,8 @@ void __init paging_init(void) ...@@ -751,7 +751,8 @@ void __init paging_init(void)
efi_memmap_walk(filter_rsvd_memory, count_node_pages); efi_memmap_walk(filter_rsvd_memory, count_node_pages);
#ifdef CONFIG_VIRTUAL_MEM_MAP #ifdef CONFIG_VIRTUAL_MEM_MAP
vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page)); vmalloc_end -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
sizeof(struct page));
vmem_map = (struct page *) vmalloc_end; vmem_map = (struct page *) vmalloc_end;
efi_memmap_walk(create_mem_map_page_table, NULL); efi_memmap_walk(create_mem_map_page_table, NULL);
printk("Virtual mem_map starts at 0x%p\n", vmem_map); printk("Virtual mem_map starts at 0x%p\n", vmem_map);
......
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