Align virtual memoryu map to MAX_ORDER boundary This avoids calling pfn_valid and its easy to do given the virtual nature of the memory map. Signed-off-by: Christoph Lameter > PAGE_SHIFT) & + ~(MAX_ORDER_NR_PAGES - 1)); + map_end = pfn_to_page(ALIGN(__pa(end) >> PAGE_SHIFT, + MAX_ORDER_NR_PAGES)); start_page = (unsigned long) map_start & PAGE_MASK; end_page = PAGE_ALIGN((unsigned long) map_end); Index: linux-2.6.18-mm3/mm/page_alloc.c =================================================================== --- linux-2.6.18-mm3.orig/mm/page_alloc.c 2006-10-06 20:41:58.593416489 -0700 +++ linux-2.6.18-mm3/mm/page_alloc.c 2006-10-06 21:09:02.755981924 -0700 @@ -154,7 +154,7 @@ static int page_outside_zone_boundaries( static int page_is_consistent(struct zone *zone, struct page *page) { -#ifdef CONFIG_HOLES_IN_ZONE +#if !defined(VIRTUAL_MEM_MAP) && defined(CONFIG_HOLES_IN_ZONE) if (!pfn_valid(page_to_pfn(page))) return 0; #endif @@ -359,7 +359,7 @@ __find_combined_index(unsigned long page static inline int page_is_buddy(struct page *page, struct page *buddy, int order) { -#ifdef CONFIG_HOLES_IN_ZONE +#if !defined(VIRTUAL_MEM_MAP) && defined(CONFIG_HOLES_IN_ZONE) if (!pfn_valid(page_to_pfn(buddy))) return 0; #endif