From owner-svn-src-head@FreeBSD.ORG Mon Jun 3 09:24:31 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 B3907D0D; Mon, 3 Jun 2013 09:24:31 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id A353D1FBD; Mon, 3 Jun 2013 09:24:31 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 347161A3C1A; Mon, 3 Jun 2013 02:24:30 -0700 (PDT) Message-ID: <51AC60CA.6050105@mu.org> Date: Mon, 03 Jun 2013 02:24:26 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r251282 - head/sys/kern References: <201306030416.r534GmCA001872@svn.freebsd.org> <51AC1B49.9090001@mu.org> <20130603075539.GK3047@kib.kiev.ua> In-Reply-To: <20130603075539.GK3047@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, 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: Mon, 03 Jun 2013 09:24:31 -0000 On 6/3/13 12:55 AM, Konstantin Belousov wrote: > On Sun, Jun 02, 2013 at 09:27:53PM -0700, Alfred Perlstein wrote: >> Hey Konstaintin, shouldn't this be scaled against the actual amount of >> KVA we have instead of an arbitrary limit? > The commit changes the buffer cache to scale according to the available > KVA, making the scaling less dumb. > > I do not understand what exactly do you want to do, please describe the > algorithm you propose to implement instead of my change. Sure, how about deriving the hardcoded "32" from the maxkva a machine can have? Is that possible? -Alfred > >> -Alfred >> >> On 6/2/13 9:16 PM, Konstantin Belousov wrote: >>> Author: kib >>> Date: Mon Jun 3 04:16:48 2013 >>> New Revision: 251282 >>> URL: http://svnweb.freebsd.org/changeset/base/251282 >>> >>> Log: >>> When auto-sizing the buffer cache, limit the amount of physical memory >>> used as the estimation of size, to 32GB. This provides around 100K of >>> buffer headers and corresponding KVA for buffer map at the peak. >>> Sizing the cache larger is not useful, also resulting in the wasting >>> and exhausting of KVA for large machines. >>> >>> Reported and tested by: bdrewery >>> Sponsored by: The FreeBSD Foundation >>> >>> Modified: >>> head/sys/kern/vfs_bio.c >>> >>> Modified: head/sys/kern/vfs_bio.c >>> ============================================================================== >>> --- head/sys/kern/vfs_bio.c Mon Jun 3 04:11:42 2013 (r251281) >>> +++ head/sys/kern/vfs_bio.c Mon Jun 3 04:16:48 2013 (r251282) >>> @@ -560,7 +560,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon >>> nbuf += min((physmem_est - 4096) / factor, >>> 65536 / factor); >>> if (physmem_est > 65536) >>> - nbuf += (physmem_est - 65536) * 2 / (factor * 5); >>> + nbuf += min((physmem_est - 65536) * 2 / (factor * 5), >>> + 32 * 1024 * 1024 / (factor * 5)); >>> >>> if (maxbcache && nbuf > maxbcache / BKVASIZE) >>> nbuf = maxbcache / BKVASIZE; >>>