Subject: Re: Did lunch - and was told ISA != 16+ meg
To: Jukka Marin <jmarin@teeri.jmp.fi>
From: matthew green <mrg@eterna.com.au>
List: current-users
Date: 02/04/1996 23:50:19
   This is slightly off-topic, but is there a simple way to tell NetBSD to
   devote a larger portion of RAM to disk buffers?  A news server can live
   with 32 MB RAM, so I'd like to give the other 32 megs to disk buffering.
   How to?

it will be in your machines machdep.c.  you can (probably) define

options BUFPAGES=<X>

in your kernel config, and make it use that many pages (easily
way is to look at the kernel messages at boot up to allocate
that much space.  ie, mine says

using 713 buffers containing 2920448 bytes of memory

if i wanted 6M, i would double and bit 713.  you could alternatively
work it out correctly  :-)

alternatively, i modified my machdep.c such that i could say
"use 1/N of memory".  it's a fairly lame hack and i don't
suggest that any commits this as it reads, but, it works  :-)

(ie, `options BUFFER_CACHE_DIVISOR=2' gives 1/2 of memory to
the buffer cache).

Index: machdep.c
===================================================================
RCS file: /local/cvs/src/sys/arch/sparc/sparc/machdep.c,v
retrieving revision 1.1.1.12
diff -c -r1.1.1.12 machdep.c
*** machdep.c	1996/01/13 22:31:26	1.1.1.12
--- machdep.c	1996/02/04 12:47:32
***************
*** 326,332 ****
  	 * Allocate 1/2 as many swap buffer headers as file i/o buffers.
  	 */
  	if (bufpages == 0)
! 		bufpages = (physmem / 20) / CLSIZE;
  	if (nbuf == 0) {
  		nbuf = bufpages;
  		if (nbuf < 16)
--- 327,336 ----
  	 * Allocate 1/2 as many swap buffer headers as file i/o buffers.
  	 */
  	if (bufpages == 0)
! #ifndef BUFFER_CACHE_DIVISOR
! #define BUFFER_CACHE_DIVISOR 20
! #endif
! 		bufpages = (physmem / BUFFER_CACHE_DIVISOR) / CLSIZE;
  	if (nbuf == 0) {
  		nbuf = bufpages;
  		if (nbuf < 16)

hope this helps,

.mrg.