-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Eric Tangman wrote:
| Using a 2.6 kernel, is there any way to control the percentage of memory
| used for buffers and/or caching?
|

Hi, Eric.

There is only one rather complex formula the kernel uses in balancing
its own bias between reusing stale cached pages vs. swapping actively
allocated pages out as soon as it needs extra cache (which is rather
silly for non-desktop use, except in special cases, because then you end
up with, f.e., 100MB of actively claimed memory on swap, while 300MB of
it is used for cache).

The formula itself is spread across about approximately 20 lines of
mm/vmscan.c (somewhere between lines 680-730, depending on your exact
kernel version), and it's rather arcane, but the bottom line is, you
have the /proc/sys/vm/swappiness sysctl variable, that can also be
pronounced "sysctl vm.swappiness".

You can, in two extreme cases, tell the kernel to always favor reusing
cache (sysctl -w vm.swappiness=0) or to always be greedy about cache and
prefer to swap out allocated, but stale pages of memory, in order to get
more of it used for cache (sysctl -w vm.swappiness=100).

Your results may vary, but it's definitely worth a shot, especially with
the default of 90 being heavily biased towards desktop systems.

Hope this helped,
- --
~    Grega Bremec
~    gregab at p0f dot net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFDoMGkfu4IwuB3+XoRA/CCAJ40iL5ZHIDjwbjOx6RgKcscHHii4ACggeHu
GMMRP2zoGzcik94RIjPdQAs=
=RR2d
-----END PGP SIGNATURE-----

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to