Subject: kern/8954: buffer cache is too little when BUFCACHE is defined.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ura@hiru.aoba.yokohama.jp>
List: netbsd-bugs
Date: 12/05/1999 07:01:30
>Number: 8954
>Category: kern
>Synopsis: buffer cache is too little when BUFCACHE is defined.
>Confidential: yes
>Severity: critical
>Priority: high
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Dec 5 07:00:01 1999
>Last-Modified:
>Originator: URA Hiroshi
>Organization:
>Release: NetBSD-current (1999/12/05)
>Environment:
System: NetBSD satsuki.hiru.aoba.yokohama.jp 1.4P NetBSD 1.4P (SATSUKI) #5: Sun Dec 5 06:18:00 JST 1999 ura@satsuki.hiru.aoba.yokohama.jp:/usr/local/src/NetBSD/current/src/sys/arch/i386/compile/SATSUKI i386
>Description:
I found that buffer cache is too little.
NetBSD 1.4P (SATSUKI) #4: Sun Dec 5 06:18:00 JST 1999
ura@satsuki:/usr/local/src/NetBSD/current/src/sys/arch/i386/compile/SATSUKI
cpu0: family 6 model 6 step 5
cpu0: Intel Pentium II (Celeron) (686-class)
total memory = 127 MB
avail memory = 122 MB
using 21 buffers containing 86016 of memory
BIOS32 rev. 0 found at 0xfb450
mainbus0 (root)
<snip.>
I define BUFCACHE option to my kernel config file.
>How-To-Repeat:
1. add your kernel configuration file to `options BUFCACHE 20'
2. recompile kernel
3. reboot machine using new kernel
4. see dmesg
>Fix:
Apply this patch.
Index: kern_allocsys.c
===================================================================
RCS file: /cvsroot/netbsd/syssrc/sys/kern/kern_allocsys.c,v
retrieving revision 1.6
diff -u -u -r1.6 kern_allocsys.c
--- kern_allocsys.c 1999/12/03 21:43:19 1.6
+++ kern_allocsys.c 1999/12/05 10:00:11
@@ -165,7 +165,7 @@
if (bufcache < 5 || bufcache > 95)
panic("bufcache is out of range (%d)\n",
bufcache);
- bufpages = physmem / bufcache / 100;
+ bufpages = physmem * bufcache / 100;
} else {
if (physmem < btoc(2 * 1024 * 1024))
>Audit-Trail:
>Unformatted: