svn commit: r192673 - user/kmacy/releng_7_2_fcs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Kip Macy kmacy at FreeBSD.org
Sat May 23 23:08:08 UTC 2009


Author: kmacy
Date: Sat May 23 23:08:07 2009
New Revision: 192673
URL: http://svn.freebsd.org/changeset/base/192673

Log:
  print out hash table size, retry large failed allocations

Modified:
  user/kmacy/releng_7_2_fcs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c

Modified: user/kmacy/releng_7_2_fcs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- user/kmacy/releng_7_2_fcs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Sat May 23 22:57:49 2009	(r192672)
+++ user/kmacy/releng_7_2_fcs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Sat May 23 23:08:07 2009	(r192673)
@@ -234,7 +234,7 @@ dbuf_init(void)
 {
 	uint64_t hsize = 1ULL << 16;
 	dbuf_hash_table_t *h = &dbuf_hash_table;
-	int i;
+	int i = 0;
 
 	/*
 	 * The hash table is big enough to fill all of physical memory
@@ -250,10 +250,15 @@ retry:
 	if (h->hash_table == NULL) {
 		/* XXX - we should really return an error instead of assert */
 		ASSERT(hsize > (1ULL << 10));
+		/* try a few times  before dropping */
+		if (i++ < 4)
+			goto retry;
+		i = 0;
 		hsize >>= 1;
 		goto retry;
 	}
 
+	printf("ZFS hash table has %ld buckets\n", hsize);
 	dbuf_cache = kmem_cache_create("dmu_buf_impl_t",
 	    sizeof (dmu_buf_impl_t),
 	    0, dbuf_cons, dbuf_dest, NULL, NULL, NULL, 0);


More information about the svn-src-user mailing list