[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

buf_daemon() improvement



greetings,

please test this and send feedback to me. it should avoid the cleaner
from running when it doesn't really need to, improving a bit performance
under heavy disk load.

cheers,
-p.

Index: vfs_bio.c
===================================================================
RCS file: /cvs/src/sys/kern/vfs_bio.c,v
retrieving revision 1.71
diff -u -r1.71 vfs_bio.c
--- vfs_bio.c	2004/11/01 15:55:38	1.71
+++ vfs_bio.c	2004/11/02 13:13:21
@@ -880,6 +880,12 @@
 	for (;;) {
 		if (numdirtypages < hidirtypages) {
 			tsleep(&bd_req, PRIBIO - 7, "cleaner", 0);
+			/*
+			 * Between being awaken and actually running, the
+			 * situation might have changed (due to the syncer
+			 * being ran, for example), so do the check again.
+			 */
+			continue;
 		}
 
 		getmicrouptime(&starttime);



Visit your host, monkey.org