Subject: new sysctl tunables for UVM page-replacement
To: None <tech-kern@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 12/08/2001 19:26:23
hi folks,

I've just checked in changes to create three new sysctl tunables
that enforce a maximum amount of memory used for the different types
of page allocations (anonymous process memory, cached file data,
and cached executable data).  I've also renamed some of the old sysctl
tunables to have less obscure names for the uninitiated.  the old tunables
are now named:

	vm.anonmin
	vm.filemin	(instead of vm.vnodemin)
	vm.execmin	(instead of vm.vtextmin)

and the new tunables are (you guessed it):

	vm.anonmax
	vm.filemax
	vm.execmax

the values for the new tunables are percentages of RAM, just like the old ones.
the "max" limits in this context are only enforced when there isn't enough
memory to satisfy all requests, so the usage for a given type can exceed the
maximum if there is no demand for the other types.

the current defaults are:

	type	min	max
	---	---	---
	anon	10	80
	file	10	50
	exec	5	30

when the system needs to reclaim memory to satisfy new allocations,
it will choose the pages to reclaim so that the usage stays within
the min and max values for each usage type.  if the system doesn't
need to reclaim memory to fulfill new allocation requests, that's
when the usage can exceed the maximum.  so if only 10% of memory is
in use for things other than cached file data, then the other 90%
of memory is available to cache file data.  however, if the demand
for other types of memory increases, the pages reclaimed to satisfy
that demand will be exclusively file pages, until the amount of
memory used for file data falls below the maximum.

-Chuck