Subject: Re: Did lunch - and was told ISA != 16+ meg
To: Jukka Marin <jmarin@teeri.jmp.fi>
From: Luke Mewburn <lukem@telstra.com.au>
List: current-users
Date: 02/05/1996 09:10:07
Jukka Marin writes:
> 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?

I submitted a pr a while ago to do this - kern/1903
You can examine it via the WWW from: http://www.netbsd.org/Misc/query-pr.html

Here is the diff anyway.

Apply it, and then add

	options BUFCACHE=50

to devote 50% of physmem to buffer cache.


PS: can core or the portmasters look at putting this in each port?
It's a *USEFUL* option for non-unified buffer cache systems, and
a couple of people have asked about since I submitted the PR 1 month ago,
so it's not just me that wants it...



--- cut here --- file: ~/unix/netbsd/bufcache.dif
*** /usr/osrc/sys/arch/i386/i386/machdep.c	Mon Oct 16 12:43:28 1995
--- i386/machdep.c	Wed Jan  3 18:46:22 1996
***************
*** 115,120 ****
--- 115,128 ----
  #else
  int	bufpages = 0;
  #endif
+ #if !defined(BUFCACHE)
+ #define	BUFCACHE	10
+ #endif
+ #if (BUFCACHE < 1) || (BUFCACHE > 95)
+ #undef	BUFCACHE
+ #define	BUFCACHE	10
+ #endif
+ int	bufcache = BUFCACHE;
  
  int	physmem;
  int	dumpmem_low;
***************
*** 313,329 ****
  #endif
  
  	/*
! 	 * Determine how many buffers to allocate.  We use 10% of the
! 	 * first 2MB of memory, and 5% of the rest, with a minimum of 16
! 	 * buffers.  We allocate 1/2 as many swap buffer headers as file
! 	 * i/o buffers.
  	 */
  	if (bufpages == 0)
! 		if (physmem < btoc(2 * 1024 * 1024))
! 			bufpages = physmem / (10 * CLSIZE);
! 		else
! 			bufpages = (btoc(2 * 1024 * 1024) + physmem) /
! 			    (20 * CLSIZE);
  	if (nbuf == 0) {
  		nbuf = bufpages;
  		if (nbuf < 16)
--- 321,332 ----
  #endif
  
  	/*
! 	 * Set size of buffer cache to physmem/buffercache * 100
! 	 * (i.e., bufcache % of physmem). We allocate 1/2 as many
! 	 * swap buffer headers as file I/O buffers.
  	 */
  	if (bufpages == 0)
! 		bufpages= physmem / (CLSIZE * 100) * bufcache;
  	if (nbuf == 0) {
  		nbuf = bufpages;
  		if (nbuf < 16)
--- cut here ---


-- 
Luke Mewburn <luke.mewburn@itg.telstra.com.au>

    Don't steal. The Government (and the Banks) hate competition.  - (anon)