svn commit: r250149 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Davide Italiano davide at FreeBSD.org
Wed May 1 17:34:44 UTC 2013


Author: davide
Date: Wed May  1 17:34:44 2013
New Revision: 250149
URL: http://svnweb.freebsd.org/changeset/base/250149

Log:
  In case ZFS doesn't use UMA for buffers there's no need to waste memory
  creating zones that will remain empty.
  
  Reviewed by:	pjd

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Wed May  1 17:29:42 2013	(r250148)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Wed May  1 17:34:44 2013	(r250149)
@@ -154,6 +154,8 @@ zio_init(void)
 	    sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0);
 	zio_link_cache = kmem_cache_create("zio_link_cache",
 	    sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0);
+	if (!zio_use_uma)
+		goto out;
 
 	/*
 	 * For small buffers, we want a cache for each multiple of
@@ -217,6 +219,7 @@ zio_init(void)
 		if (zio_data_buf_cache[c - 1] == NULL)
 			zio_data_buf_cache[c - 1] = zio_data_buf_cache[c];
 	}
+out:
 
 	/*
 	 * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs


More information about the svn-src-head mailing list