From owner-svn-src-head@FreeBSD.ORG Fri Dec 7 22:23:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79076BAA; Fri, 7 Dec 2012 22:23:54 +0000 (UTC) (envelope-from pjd@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 40D6E8FC0C; Fri, 7 Dec 2012 22:23:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB7MNsEJ097349; Fri, 7 Dec 2012 22:23:54 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB7MNs42097348; Fri, 7 Dec 2012 22:23:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212072223.qB7MNs42097348@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 7 Dec 2012 22:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243997 - head/sys/kern 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: Fri, 07 Dec 2012 22:23:54 -0000 Author: pjd Date: Fri Dec 7 22:23:53 2012 New Revision: 243997 URL: http://svnweb.freebsd.org/changeset/base/243997 Log: Make use of the fact that uma_zone_set_max(9) already returns actual limit set. Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri Dec 7 22:22:04 2012 (r243996) +++ head/sys/kern/kern_mbuf.c Fri Dec 7 22:23:53 2012 (r243997) @@ -304,10 +304,8 @@ mbuf_init(void *dummy) NULL, NULL, #endif MSIZE - 1, UMA_ZONE_MAXBUCKET); - if (nmbufs > 0) { - uma_zone_set_max(zone_mbuf, nmbufs); - nmbufs = uma_zone_get_max(zone_mbuf); - } + if (nmbufs > 0) + nmbufs = uma_zone_set_max(zone_mbuf, nmbufs); zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES, mb_ctor_clust, mb_dtor_clust, @@ -317,10 +315,8 @@ mbuf_init(void *dummy) NULL, NULL, #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); - if (nmbclusters > 0) { - uma_zone_set_max(zone_clust, nmbclusters); - nmbclusters = uma_zone_get_max(zone_clust); - } + if (nmbclusters > 0) + nmbclusters = uma_zone_set_max(zone_clust, nmbclusters); zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack, mb_dtor_pack, mb_zinit_pack, mb_zfini_pack, zone_mbuf); @@ -334,10 +330,8 @@ mbuf_init(void *dummy) NULL, NULL, #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); - if (nmbjumbop > 0) { - uma_zone_set_max(zone_jumbop, nmbjumbop); - nmbjumbop = uma_zone_get_max(zone_jumbop); - } + if (nmbjumbop > 0) + nmbjumbop = uma_zone_set_max(zone_jumbop, nmbjumbop); zone_jumbo9 = uma_zcreate(MBUF_JUMBO9_MEM_NAME, MJUM9BYTES, mb_ctor_clust, mb_dtor_clust, @@ -348,10 +342,8 @@ mbuf_init(void *dummy) #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); uma_zone_set_allocf(zone_jumbo9, mbuf_jumbo_alloc); - if (nmbjumbo9 > 0) { - uma_zone_set_max(zone_jumbo9, nmbjumbo9); - nmbjumbo9 = uma_zone_get_max(zone_jumbo9); - } + if (nmbjumbo9 > 0) + nmbjumbo9 = uma_zone_set_max(zone_jumbo9, nmbjumbo9); zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES, mb_ctor_clust, mb_dtor_clust, @@ -362,10 +354,8 @@ mbuf_init(void *dummy) #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); uma_zone_set_allocf(zone_jumbo16, mbuf_jumbo_alloc); - if (nmbjumbo16 > 0) { - uma_zone_set_max(zone_jumbo16, nmbjumbo16); - nmbjumbo16 = uma_zone_get_max(zone_jumbo16); - } + if (nmbjumbo16 > 0) + nmbjumbo16 = uma_zone_set_max(zone_jumbo16, nmbjumbo16); zone_ext_refcnt = uma_zcreate(MBUF_EXTREFCNT_MEM_NAME, sizeof(u_int), NULL, NULL,