From owner-svn-src-head@FreeBSD.ORG Thu Oct 25 13:51:06 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 69BC9A3D; Thu, 25 Oct 2012 13:51:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3AF948FC21; Thu, 25 Oct 2012 13:51:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 80DAEB982; Thu, 25 Oct 2012 09:51:05 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r242029 - head/sys/kern Date: Thu, 25 Oct 2012 09:50:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121025080551.GG35915@deviant.kiev.zoral.com.ua> In-Reply-To: <20121025080551.GG35915@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Message-Id: <201210250950.57161.jhb@freebsd.org> Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 25 Oct 2012 09:51:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org 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, 25 Oct 2012 13:51:06 -0000 On Thursday, October 25, 2012 4:05:51 am Konstantin Belousov wrote: > On Thu, Oct 25, 2012 at 01:46:21AM +0000, 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); > > + } > This is unbelievably weird way to express the '64bit'. The > #ifdef _LP64 is enough there instead of the runtime check. > > Also, are you sure that all our 64bit arches do not have KVA limitations ? There is an active thread on current@ with a different patch that uses a KVA constant to derive 384 instead. When we have updated tuning in the past (e.g. adjusting the cap on maxvnodes), there was a bit of discussion rather than a random drive by commit. I think we should probably hold off on making changes here and figure out what the right way to fix this is in the thread on current@ instead. Andre has already suggested divorcing mbuf tuning from maxusers entirely for example. -- John Baldwin