From owner-svn-src-all@FreeBSD.ORG Thu Oct 25 10:02:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EABE88D; Thu, 25 Oct 2012 10:02:29 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 879DC8FC08; Thu, 25 Oct 2012 10:02:28 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so1811727oag.13 for ; Thu, 25 Oct 2012 03:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rVGLDLIzg1fatdSRNnt7bKVq0G8MZtuidsHv0q0cI7U=; b=MRH7q1etD0o0R61+sei42zNJcI44wLQzpgC9KjcRn2ICyHlDMfmtU4YG5MfoyMBqRi zMLN3vTiKHGI3oki5Vo5sDukX+WvGAhDfKkU3yNRC4Zl+qFUlVzP2GkhPvir1e7bmTbT BYtqSlXIPMi9KzftaE4AsEdjs9dsYOza84MNQWtWJr3RFAs5jSfytNw0bfL7B3OXcKc8 3LshUZWakLYG+cXSH07+4hMSkXOy4D/EAm6WBdYMQTxDyZiBLgwL5jUsrpVqhnjmvZjD uTLRTZVxOTdyYRA2L6gcLmwiVwqjr9jj9nnLASfvVunXB9jgLtiaDm2ACOjyDSIS5dp6 vTog== MIME-Version: 1.0 Received: by 10.182.131.100 with SMTP id ol4mr15122178obb.38.1351159348078; Thu, 25 Oct 2012 03:02:28 -0700 (PDT) Received: by 10.76.143.33 with HTTP; Thu, 25 Oct 2012 03:02:27 -0700 (PDT) In-Reply-To: <201210250146.q9P1kLi8043704@svn.freebsd.org> References: <201210250146.q9P1kLi8043704@svn.freebsd.org> Date: Thu, 25 Oct 2012 03:02:27 -0700 Message-ID: Subject: Re: svn commit: r242029 - head/sys/kern From: Garrett Cooper To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 10:02:29 -0000 On Wed, Oct 24, 2012 at 6:46 PM, Alfred Perlstein wrote: > Author: alfred > Date: Thu Oct 25 01:46:20 2012 > New Revision: 242029 > URL: http://svn.freebsd.org/changeset/base/242029 > > Log: > Allow autotune maxusers > 384 on 64 bit machines > > A default install on large memory machines with multiple 10gigE interfaces > were not being given enough mbufs to do full bandwidth TCP or NFS traffic. > > To keep the value somewhat reasonable, we scale back the number of > maxuers by 1/6 past the 384 point. This gives us enough mbufs for most > of our pretty basic 10gigE line-speed tests to complete. > > Modified: > head/sys/kern/subr_param.c > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Thu Oct 25 01:27:01 2012 (r242028) > +++ head/sys/kern/subr_param.c Thu Oct 25 01:46:20 2012 (r242029) > @@ -278,8 +278,16 @@ init_param2(long physpages) > maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); > if (maxusers < 32) > maxusers = 32; > - if (maxusers > 384) > - maxusers = 384; > + /* > + * Clips maxusers to 384 on machines with <= 4GB RAM or 32bit. > + * Scales it down 6x for large memory machines. > + */ > + if (maxusers > 384) { > + if (sizeof(void *) <= 4) > + maxusers = 384; > + else > + maxusers = 384 + ((maxusers - 384) / 6); Why `/ 6` (other than the fact that it makes the value presumably a multiple of 64)? Also, shouldn't some kind of clamping be taking place to ensure that this the end result of the calculation is a multiple of a power of two, e.g. 16, 32, 64, etc? And as usual, got ministat :)? Thanks! -Garrett