From 6afbd002f91f571c8f5a31d2fa39f8b0f556b74e Mon Sep 17 00:00:00 2001 From: josephb Date: Mon, 25 Jun 2007 09:19:10 -0700 Subject: 6569219 wasted time at amd64 boot - issues with htable_walk() --- usr/src/uts/i86pc/vm/htable.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/i86pc/vm/htable.c b/usr/src/uts/i86pc/vm/htable.c index 44718d836d..20762e2cd0 100644 --- a/usr/src/uts/i86pc/vm/htable.c +++ b/usr/src/uts/i86pc/vm/htable.c @@ -1432,9 +1432,13 @@ htable_walk( * Find the level of the largest pagesize used by this HAT. */ max_mapped_level = 0; - for (l = 1; l <= mmu.max_page_level; ++l) - if (hat->hat_pages_mapped[l] != 0) - max_mapped_level = l; + if (hat->hat_ism_pgcnt > 0) { + max_mapped_level = mmu.max_page_level; + } else { + for (l = 1; l <= mmu.max_page_level; ++l) + if (hat->hat_pages_mapped[l] != 0) + max_mapped_level = l; + } while (va < eaddr && va >= *vaddr) { ASSERT(!IN_VA_HOLE(va)); @@ -1455,21 +1459,14 @@ htable_walk( break; } - /* - * The ht is never NULL at the top level since - * the top level htable is created in hat_alloc(). - */ - ASSERT(l < TOP_LEVEL(hat)); - /* * No htable covers the address. If there is no * larger page size that could cover it, we * skip to the start of the next page table. */ - if (l >= max_mapped_level) { + ASSERT(l < TOP_LEVEL(hat)); + if (l >= max_mapped_level) va = NEXT_ENTRY_VA(va, l + 1); - break; - } } } -- cgit v1.2.3