From owner-svn-src-head@FreeBSD.ORG Wed Dec 10 22:17:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58743106564A; Wed, 10 Dec 2008 22:17:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44B368FC29; Wed, 10 Dec 2008 22:17:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAMHAFZ044755; Wed, 10 Dec 2008 22:17:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAMHAPo044753; Wed, 10 Dec 2008 22:17:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812102217.mBAMHAPo044753@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 10 Dec 2008 22:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185893 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 10 Dec 2008 22:17:10 -0000 Author: bz Date: Wed Dec 10 22:17:09 2008 New Revision: 185893 URL: http://svn.freebsd.org/changeset/base/185893 Log: Make sure nmbclusters are initialized before maxsockets by running the tunable_mbinit() SYSINIT at SI_ORDER_MIDDLE before the init_maxsockets() SYSINT at SI_ORDER_ANY. Reviewed by: rwatson, zec Sponsored by: The FreeBSD Foundation MFC after: 4 weeks Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_socket.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Wed Dec 10 22:10:37 2008 (r185892) +++ head/sys/kern/kern_mbuf.c Wed Dec 10 22:17:09 2008 (r185893) @@ -101,6 +101,11 @@ int nmbjumbo9; /* limits number of 9k int nmbjumbo16; /* limits number of 16k jumbo clusters */ struct mbstat mbstat; +/* + * tunable_mbinit() has to be run before init_maxsockets() thus + * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() + * runs at SI_ORDER_ANY. + */ static void tunable_mbinit(void *dummy) { @@ -113,7 +118,7 @@ tunable_mbinit(void *dummy) nmbjumbo9 = nmbjumbop / 2; nmbjumbo16 = nmbjumbo9 / 2; } -SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL); +SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); /* XXX: These should be tuneables. Can't change UMA limits on the fly. */ static int Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Dec 10 22:10:37 2008 (r185892) +++ head/sys/kern/uipc_socket.c Wed Dec 10 22:17:09 2008 (r185893) @@ -236,7 +236,8 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsock "Maximum number of sockets avaliable"); /* - * Initialise maxsockets. + * Initialise maxsockets. This SYSINIT must be run after + * tunable_mbinit(). */ static void init_maxsockets(void *ignored)