aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/mm/discontig.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/mm/discontig.c')
-rw-r--r--arch/ia64/mm/discontig.c65
1 files changed, 2 insertions, 63 deletions
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 8eeb669917fa..d260bffa01ab 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -534,68 +534,6 @@ void __cpuinit *per_cpu_init(void)
534} 534}
535#endif /* CONFIG_SMP */ 535#endif /* CONFIG_SMP */
536 536
537#ifdef CONFIG_VIRTUAL_MEM_MAP
538static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
539{
540 unsigned long end_address, hole_next_pfn;
541 unsigned long stop_address;
542
543 end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
544 end_address = PAGE_ALIGN(end_address);
545
546 stop_address = (unsigned long) &vmem_map[
547 pgdat->node_start_pfn + pgdat->node_spanned_pages];
548
549 do {
550 pgd_t *pgd;
551 pud_t *pud;
552 pmd_t *pmd;
553 pte_t *pte;
554
555 pgd = pgd_offset_k(end_address);
556 if (pgd_none(*pgd)) {
557 end_address += PGDIR_SIZE;
558 continue;
559 }
560
561 pud = pud_offset(pgd, end_address);
562 if (pud_none(*pud)) {
563 end_address += PUD_SIZE;
564 continue;
565 }
566
567 pmd = pmd_offset(pud, end_address);
568 if (pmd_none(*pmd)) {
569 end_address += PMD_SIZE;
570 continue;
571 }
572
573 pte = pte_offset_kernel(pmd, end_address);
574retry_pte:
575 if (pte_none(*pte)) {
576 end_address += PAGE_SIZE;
577 pte++;
578 if ((end_address < stop_address) &&
579 (end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
580 goto retry_pte;
581 continue;
582 }
583 /* Found next valid vmem_map page */
584 break;
585 } while (end_address < stop_address);
586
587 end_address = min(end_address, stop_address);
588 end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
589 hole_next_pfn = end_address / sizeof(struct page);
590 return hole_next_pfn - pgdat->node_start_pfn;
591}
592#else
593static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
594{
595 return i + 1;
596}
597#endif
598
599/** 537/**
600 * show_mem - give short summary of memory stats 538 * show_mem - give short summary of memory stats
601 * 539 *
@@ -625,7 +563,8 @@ void show_mem(void)
625 if (pfn_valid(pgdat->node_start_pfn + i)) 563 if (pfn_valid(pgdat->node_start_pfn + i))
626 page = pfn_to_page(pgdat->node_start_pfn + i); 564 page = pfn_to_page(pgdat->node_start_pfn + i);
627 else { 565 else {
628 i = find_next_valid_pfn_for_pgdat(pgdat, i) - 1; 566 i = vmemmap_find_next_valid_pfn(pgdat->node_id,
567 i) - 1;
629 continue; 568 continue;
630 } 569 }
631 if (PageReserved(page)) 570 if (PageReserved(page))