From owner-svn-src-head@FreeBSD.ORG Wed May 1 17:34:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CDB9B33C; Wed, 1 May 2013 17:34:44 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BFBDD1BB1; Wed, 1 May 2013 17:34:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41HYiEf038947; Wed, 1 May 2013 17:34:44 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41HYi7u038946; Wed, 1 May 2013 17:34:44 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305011734.r41HYi7u038946@svn.freebsd.org> From: Davide Italiano Date: Wed, 1 May 2013 17:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250149 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 17:34:44 -0000 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