Date: Sat, 23 May 2009 23:08:07 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r192673 - user/kmacy/releng_7_2_fcs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <200905232308.n4NN873h070593@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905232308.n4NN873h070593>