Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2001 16:00:52 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        Peter Wemm <peter@wemm.org>, <cvs-committers@FreeBSD.ORG>, <cvs-all@FreeBSD.ORG>
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 
Message-ID:  <20010821141007.Y1177-100000@besplex.bde.org>
In-Reply-To: <200108201633.f7KGXGJ51695@earth.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010821141007.Y1177-100000>