From owner-svn-src-head@FreeBSD.ORG Thu Jul 11 12:46:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ECBA2E1A; Thu, 11 Jul 2013 12:46:35 +0000 (UTC) (envelope-from andre@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 C4ADF1AAE; Thu, 11 Jul 2013 12:46:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BCkZpx067988; Thu, 11 Jul 2013 12:46:35 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BCkZ3V067987; Thu, 11 Jul 2013 12:46:35 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307111246.r6BCkZ3V067987@svn.freebsd.org> From: Andre Oppermann Date: Thu, 11 Jul 2013 12:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253204 - 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: Thu, 11 Jul 2013 12:46:36 -0000 Author: andre Date: Thu Jul 11 12:46:35 2013 New Revision: 253204 URL: http://svnweb.freebsd.org/changeset/base/253204 Log: Fix style issues, a typo in "kern.ipc.nmbufs" and correctly plave and expose the value of the tunable maxmbufmem as "kern.ipc.maxmbufmem" through sysctl. Reported by: smh MFC after: 1 day Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Jul 11 12:42:46 2013 (r253203) +++ head/sys/kern/kern_mbuf.c Thu Jul 11 12:46:35 2013 (r253204) @@ -104,13 +104,18 @@ int nmbjumbo9; /* limits number of 9k int nmbjumbo16; /* limits number of 16k jumbo clusters */ struct mbstat mbstat; +static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ + +SYSCTL_QUAD(_kern_ipc, OID_AUTO, maxmbufmem, CTLFLAG_RDTUN, &maxmbufmem, 0, + "Maximum real memory allocateable to various mbuf types"); + /* * tunable_mbinit() has to be run before any mbuf allocations are done. */ static void tunable_mbinit(void *dummy) { - quad_t realmem, maxmbufmem; + quad_t realmem; /* * The default limit for all mbuf related memory is 1/2 of all @@ -120,7 +125,7 @@ tunable_mbinit(void *dummy) realmem = qmin((quad_t)physmem * PAGE_SIZE, vm_map_max(kmem_map) - vm_map_min(kmem_map)); maxmbufmem = realmem / 2; - TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); + TUNABLE_QUAD_FETCH("kern.ipc.maxmbufmem", &maxmbufmem); if (maxmbufmem > realmem / 4 * 3) maxmbufmem = realmem / 4 * 3; @@ -204,7 +209,7 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) newnmbjumbo9 = nmbjumbo9; error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); if (error == 0 && req->newptr) { - if (newnmbjumbo9 > nmbjumbo9&& + if (newnmbjumbo9 > nmbjumbo9 && nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbo9 = newnmbjumbo9; uma_zone_set_max(zone_jumbo9, nmbjumbo9); @@ -258,7 +263,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS) } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbuf, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, CTLTYPE_INT|CTLFLAG_RW, &nmbufs, 0, sysctl_nmbufs, "IU", "Maximum number of mbufs allowed");