From owner-cvs-all Mon Aug 20 23: 1:18 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 847B937B40A; Mon, 20 Aug 2001 23:01:10 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id QAA14344; Tue, 21 Aug 2001 16:00:56 +1000 Date: Tue, 21 Aug 2001 16:00:52 +1000 (EST) From: Bruce Evans X-X-Sender: To: Matt Dillon Cc: Peter Wemm , , Subject: Re: cvs commit: src/sys/boot/common loader.8 src/sys/conf options src/sys/i386/i386 machdep.c src/sys/i386/include param.h src/sys/kern subr_param.c src/sys/sys buf.h src/sys/vm swap_pager.c In-Reply-To: <200108201633.f7KGXGJ51695@earth.backplane.com> Message-ID: <20010821141007.Y1177-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 20 Aug 2001, Matt Dillon wrote: [I wrote] > :Actually, by not updating all copies of this MD include to define > :suitable MD constants for VM_BCACHE_SIZE_MAX and VM_SWZONE_SIZE_MAX. > :These constants need to be MD since the amount of KVM is MD. Except > :these constants shouldn't exist. Just use a suitable fraction of total > :KVM. Alternatively, set these constants to "infinity" by default and > :override them on i386's only. 64-bit machines should have enough KVM > :to map the buffer cache millions of times. > > There is no 'suitable fraction'. That's one of the problems. If > you have a machine with 64MB of ram then having 512MB of swap is > reasonable. If you have a machine with 4G of them then having 32G > of swap is typically unreasonable. This argument doesn't apply to buffer kvm. We've already scaled `nbuf' to a non-constant fraction of RAM, where the scale factor decreases with the amount of RAM. Buffer kvm is reasonably limited provided this scaling is reasonable. > Also, the kernel_map, clean_map, > buffer_map, etc... all the initialization code for these maps is > *improperly* sitting in machine-dependant sections. It should be > machine-indendant sections. I fixed the buffer map allocation code > in IA32 because it is the basis for all the dups, and that is the code > that will eventually be migrated to MI. The i386 code is sort of backwards. physmem_est is in pages and BKVASIZE is in bytes, so `physmem_est / BKVASIZE' is normally 0 and nbuf is adjusted _up_ to maxbcache / BKVASIZE (default 12500) on almost all machines. On a machine with 32MB of RAM, this caused severe thrashing, and eventually hangs and a panic, after about 20MB of RAM was firmly allocated to buffers. Index: machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.470 diff -u -1 -r1.470 machdep.c --- machdep.c 20 Aug 2001 00:41:11 -0000 1.470 +++ machdep.c 21 Aug 2001 00:57:50 -0000 @@ -316,4 +314,3 @@ nbuf += (physmem_est - 16384) * 2 / (factor * 5); - - if (maxbcache && nbuf > physmem_est / BKVASIZE) + if (maxbcache != 0 && nbuf > maxbcache / BKVASIZE) nbuf = maxbcache / BKVASIZE; Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message