changeset 11058:abfa2ec42964

6835500 Superfluous ASSERT(ht->ht_lock_cnt == 0) in htable_release() 6893736 htable_reap() always reaps only 10 page tables 6893744 ptable_alloc() does not track active_ptables reliably
author Jakub Jermar <Jakub.Jermar@Sun.COM>
date Thu, 12 Nov 2009 16:01:54 +0100
parents 96e69999e761
children d7f549e03f90
files usr/src/uts/i86pc/vm/htable.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/i86pc/vm/htable.c	Thu Nov 12 09:52:05 2009 -0500
+++ b/usr/src/uts/i86pc/vm/htable.c	Thu Nov 12 16:01:54 2009 +0100
@@ -270,7 +270,6 @@
 	page_t *pp;
 
 	pfn = PFN_INVALID;
-	atomic_add_32(&active_ptables, 1);
 
 	/*
 	 * The first check is to see if there is memory in the system. If we
@@ -305,6 +304,7 @@
 	pfn = pp->p_pagenum;
 	if (pfn == PFN_INVALID)
 		panic("ptable_alloc(): Invalid PFN!!");
+	atomic_add_32(&active_ptables, 1);
 	HATSTAT_INC(hs_ptable_allocs);
 	return (pfn);
 }
@@ -695,7 +695,7 @@
 	 * Try to reap 5% of the page tables bounded by a maximum of
 	 * 5% of physmem and a minimum of 10.
 	 */
-	reap_cnt = MIN(MAX(physmem / 20, active_ptables / 20), 10);
+	reap_cnt = MAX(MIN(physmem / 20, active_ptables / 20), 10);
 
 	/*
 	 * Let htable_steal() do the work, we just call htable_free()
@@ -1186,7 +1186,6 @@
 			 * Handle release of a table and freeing the htable_t.
 			 * Unlink it from the table higher (ie. ht_parent).
 			 */
-			ASSERT(ht->ht_lock_cnt == 0);
 			higher = ht->ht_parent;
 			ASSERT(higher != NULL);