From owner-freebsd-net@FreeBSD.ORG Thu Aug 23 05:50:06 2012 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 468C11065672 for ; Thu, 23 Aug 2012 05:50:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 135AD8FC14 for ; Thu, 23 Aug 2012 05:50:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7N5o50u037426 for ; Thu, 23 Aug 2012 05:50:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7N5o5oD037425; Thu, 23 Aug 2012 05:50:05 GMT (envelope-from gnats) Date: Thu, 23 Aug 2012 05:50:05 GMT Message-Id: <201208230550.q7N5o5oD037425@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Garrett Cooper Cc: Subject: Re: kern/170713: [cxgb] Driver must be loaded after boot due to timing issues checking for kern.ipc.nmb* values set via /boot/loader.conf X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Garrett Cooper List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2012 05:50:06 -0000 The following reply was made to PR kern/170713; it has been noted by GNATS. From: Garrett Cooper To: Navdeep Parhar Cc: bug-followup@freebsd.org Subject: Re: kern/170713: [cxgb] Driver must be loaded after boot due to timing issues checking for kern.ipc.nmb* values set via /boot/loader.conf Date: Wed, 22 Aug 2012 22:48:23 -0700 On Wed, Aug 22, 2012 at 5:56 PM, Navdeep Parhar wrote: > First, note that only kern.ipc.nmbclusters is a valid tunable. The rest of > the nmbXXX settings in your loader.conf have no effect. There are sysctls > but no tunables for the rest. Yes. I've been tweaking things between both areas, and I agree that sysctl-only works for non-nmbclusters. > Take a look at tunable_mbinit in kern_mbuf.c -- on recent FreeBSD versions > it starts with nmbclusters and sizes others based on this. You can set > nmbclusters really high and influence the values of the other parameters. > > In my opinion we should have a TUNABLE_INT_FETCH for all of the nmbXXX and > autocalculate the ones that are not set, just like what we do for > nmbclusters today. > > static void > tunable_mbinit(void *dummy) > { > TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); > > /* This has to be done before VM init. */ > if (nmbclusters == 0) > nmbclusters = 1024 + maxusers * 64; > nmbjumbop = nmbclusters / 2; > nmbjumbo9 = nmbjumbop / 2; > nmbjumbo16 = nmbjumbo9 / 2; > } > > > Compare this to the tunable_mbinit in 7 and you can see why the nmbclusters > tunable does not affect the others -- it is updated after the other values > have already been calculated. > static void > tunable_mbinit(void *dummy) > { > > /* This has to be done before VM init. */ > nmbclusters = 1024 + maxusers * 64; > nmbjumbop = nmbclusters / 2; > nmbjumbo9 = nmbjumbop / 2; > nmbjumbo16 = nmbjumbo9 / 2; > TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); > } Funny. I'll do some poking around in our sourcebase and see whether this has been backported.. Thanks, -Garrett