Subject: vm tuning/monitoring
To: None <tech-kern@NetBSD.org, soda@NetBSD.org>
From: Hubert Feyrer <hubert@feyrer.de>
List: tech-kern
Date: 09/09/2004 01:37:48
Following up some discussion from earlier today, below is my patch to
print a bit more when the {file,anon,exec}{max,min} barriers are bit.

When doing a "cvs update" or other disk intensive action, I expect to see
the (file) buffer cache filling up, but why that makes the system think
that not enough exec pages are present is beyond me:

	HF: fileover hit in uvm_pdaemon::uvmpd_scan_inactive()!
	HF: execunder hit in uvm_pdaemon::uvmpd_scan_inactive()!
	HF: fileover hit in uvm_pdaemon::uvmpd_scan_inactive()!
	HF: execunder hit in uvm_pdaemon::uvmpd_scan_inactive()!
	HF: fileover hit in uvm_pdaemon::uvmpd_scan_inactive()!
	HF: execunder hit in uvm_pdaemon::uvmpd_scan_inactive()!
	HF: fileover hit in uvm_pdaemon::uvmpd_scan_inactive()!
	HF: execunder hit in uvm_pdaemon::uvmpd_scan_inactive()!
	HF: fileover hit in uvm_pdaemon::uvmpd_scan_inactive()!

I guess that some other funny effects could be observed.
FWIW, this is on 2.0_BETA/i386.

Maybe some counters should be kept to see how often the various limits are
bit, possible even noting a rate of how often per time unit...


 - Hubert


Index: uvm_pdaemon.c
===================================================================
RCS file: /cvsroot/src/sys/uvm/uvm_pdaemon.c,v
retrieving revision 1.59
diff -u -r1.59 uvm_pdaemon.c
--- uvm_pdaemon.c	24 Mar 2004 07:55:01 -0000	1.59
+++ uvm_pdaemon.c	8 Sep 2004 23:32:22 -0000
@@ -407,6 +407,18 @@
 	anonover = uvmexp.anonpages > ((t * uvmexp.anonmax) >> 8);
 	fileover = uvmexp.filepages > ((t * uvmexp.filemax) >> 8);
 	execover = uvmexp.execpages > ((t * uvmexp.execmax) >> 8);
+#ifdef DEBUG /*HF*/
+#define HF_TEST_AND_PRINT(x) \
+	if (x) printf("HF: " # x " hit in uvm_pdaemon::uvmpd_scan_inactive()!\n");
+
+	HF_TEST_AND_PRINT(anonunder);
+	HF_TEST_AND_PRINT(fileunder);
+	HF_TEST_AND_PRINT(execunder);
+	HF_TEST_AND_PRINT(anonover);
+	HF_TEST_AND_PRINT(fileover);
+	HF_TEST_AND_PRINT(execover);
+#undef HF_TEST_AND_PRINT
+#endif /* HF */
 	anonreact = anonunder || (!anonover && (fileover || execover));
 	filereact = fileunder || (!fileover && (anonover || execover));
 	execreact = execunder || (!execover && (anonover || fileover));

-- 
                         ,,_
If wishes were wings,  o"   )~  would fly.            -- Go www.NetBSD.org!
                        ''''