Subject: misc/27233: 'options BUFCACHE' vs. 'sysctl vm.bufcache' documentation differs
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <arto@selonen.org>
List: netbsd-bugs
Date: 10/12/2004 10:42:23
>Number:         27233
>Category:       misc
>Synopsis:       'options BUFCACHE' vs. 'sysctl vm.bufcache' documentation differs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 12 10:43:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Arto Selonen
>Release:        NetBSD-current ~20041011
>Organization:
>Environment:
NetBSD blah 2.99.9 NetBSD 2.99.9 (BLAH) #73: Tue Oct 12 09:54:48 EEST 2004  blah@blah:/obj/sys/arch/i386/compile/BLAH i386

>Description:
Trying to understand how options(4) BUFCACHE affects memory usage I looked
at man pages for options(4), sysctl(3), sysctl(8), and sysctl(9).

options(4) states:
"Size of the buffer cache as a percentage of total available RAM.". So,
with a 1GB of RAM, 10% should be ~100MB (depending on how much kernel
reserves for itself).

sysctl(3) does not mention 'bufcache', and nor do sysctl(8) or sysctl(9).
However, 'sysctl -d vm.bufcache' states:
"Percentage of kernel memory to use for buffer cache". So, for a 1GB
system where kernel is using ~25MB, 10% would be ~2.5MB.

There is a bit of a difference there. Is bufcache using a couple of MB
or hundreds of MB? And I still do not know how it relates to all the
other caches (like file cache controlled by vm.file{min,max}).
>How-To-Repeat:
man 4 options
vs.
sysctl -d vm.bufcache
>Fix:
update manual pages and/or possibly sysctl source (or wherever the
descriptions are kept)
>Release-Note:
>Audit-Trail:
>Unformatted: