patch-pre2.0.13 linux/mm/vmscan.c

Next file: linux/net/Config.in
Previous file: linux/mm/mmap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.12/linux/mm/vmscan.c linux/mm/vmscan.c
@@ -334,7 +334,12 @@
 {
 	static int state = 0;
 	int i=6;
+	int stop;
 
+	/* we don't try as hard if we're not waiting.. */
+	stop = 3;
+	if (wait)
+		stop = 0;
 	switch (state) {
 		do {
 		case 0:
@@ -349,7 +354,8 @@
 			if (swap_out(i, dma, wait))
 				return 1;
 			state = 0;
-		} while (i--);
+		i--;
+		} while ((i - stop) >= 0);
 	}
 	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this