patch-2.1.100 linux/Documentation/sysctl/vm.txt

Next file: linux/Makefile
Previous file: linux/Documentation/mtrr.txt
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/Documentation/sysctl/vm.txt linux/Documentation/sysctl/vm.txt
@@ -18,6 +18,7 @@
 - bdflush
 - buffermem
 - freepages
+- kswapd
 - overcommit_memory
 - pagecache
 - swapctl
@@ -112,9 +113,58 @@
 This file contains the values in the struct freepages. That
 struct contains three members: min, low and high.
 
-These variables are currently unused (?), but they're
-very likely to be abused for something else in the near
-future, so don't yet remove it from the source...
+Although the goal of the Linux memory management subsystem
+is to avoid fragmentation and make large chunks of free
+memory (so that we can hand out DMA buffers and such), there
+still are some page-based limits in the system, mainly to
+make sure we don't waste too much memory trying to get large
+free area's.
+
+The meaning of the numbers is:
+
+freepages.min	When the number of free pages in the system
+		reaches this number, only the kernel can
+		allocate more memory.
+freepages.low	If memory is too fragmented, the swapout
+		daemon is started, except when the number
+		of free pages is larger than freepages.low.
+freepages.high	The swapping daemon exits when memory is
+		sufficiently defragmented, when the number
+		of free pages reaches freepages.high or when
+		it has tried the maximum number of times. 
+
+==============================================================
+
+kswapd:
+
+Kswapd is the kernel swapout daemon. That is, kswapd is that
+piece of the kernel that frees memory when it get's fragmented
+or full. Since every system is different, you'll probably want
+some control over this piece of the system.
+
+The numbers in this page correspond to the numbers in the
+struct pager_daemon {tries_base, tries_min, swap_cluster
+}; The tries_base and swap_cluster probably have the
+largest influence on system performance.
+
+tries_base	The maximum number of pages kswapd tries to
+		free in one round is calculated from this
+		number. Usually this number will be divided
+		by 4 or 8 (see mm/vmscan.c), so it isn't as
+		big as it looks.
+		When you need to increase the bandwith to/from
+		swap, you'll want to increase this number.
+tries_min	This is the minimum number of times kswapd
+		tries to free a page each time it is called.
+		Basically it's just there to make sure that
+		kswapd frees some pages even when it's being
+		called with minimum priority.
+swap_cluster	This is the number of pages kswapd writes in
+		one turn. You want this large so that kswapd
+		does it's I/O in large chunks and the disk
+		doesn't have to seek often, but you don't want
+		it to be too large since that would flood the
+		request queue.
 
 ==============================================================
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov