From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 14 15:31:05 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 859F537B404 for ; Thu, 14 Aug 2003 15:31:05 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC30243FCB for ; Thu, 14 Aug 2003 15:31:04 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h7EMUujX067626; Thu, 14 Aug 2003 15:30:57 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h7EMUu2T067625; Thu, 14 Aug 2003 15:30:56 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Thu, 14 Aug 2003 15:30:56 -0700 From: David Schultz To: Eno Thereska Message-ID: <20030814223056.GA67495@HAL9000.homeunix.com> Mail-Followup-To: Eno Thereska , freebsd hackers References: <3F3BD31A.8080808@andrew.cmu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F3BD31A.8080808@andrew.cmu.edu> cc: freebsd hackers Subject: Re: increasing number of buffers in BSD4.4 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2003 22:31:05 -0000 On Thu, Aug 14, 2003, Eno Thereska wrote: > In McKusick's book "The design and Implementation of the 4.4BSD > Operating system", in the "Buffer Management subsection > of the I/O system overview, there is a a sentence that says > "...depending on available memory, a system is configured with from > 100 to 1000 buffers.." referring to the number of struct buf* in the > integrated VM/IO buffer cache. > > I have plenty of RAM in my computer, but it seems like there are always > 1000 buffers configured (empirical observation, if I try to allocate > one more after that the system freezes). How do I increase the nubmer of > buffers? More consicely, how do I allocate more memory to the buffer > management subsystem? In FreeBSD, you get 1 buffer for every megabyte of memory up to 64 MB of RAM, and 1 buffer for every 2.5 megabytes after that. See kern_vfs_bio_buffer_alloc() in vfs_bio.c. On i386 and amd64, there's a cap of about 1000 due to KVA limits, although that cap should not be needed for amd64.