linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] background swapping enabled again
@ 1998-03-19 19:50 Rik van Riel
  0 siblings, 0 replies; only message in thread
From: Rik van Riel @ 1998-03-19 19:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm

Hi Linus,

I decided to go with your free_pages_available() test,
since Ben and Stephen will provide the framework to
implement it properly even on small-mem machines...

But background swapping (when eg. BUFFER_MEM > max)
has been made impossible in .90.
Since this breaks the maximum limit for buffermem, I
have made the following patch...

It makes sure we at least do SWAP_CLUSTER_MAX calls
to try_to_free_page(), so background works again...

Rik.
+-------------------------------------------+--------------------------+
| Linux: - LinuxHQ MM-patches page          | Scouting       webmaster |
|        - kswapd ask-him & complain-to guy | Vries    cubscout leader |
|     http://www.fys.ruu.nl/~riel/          | <H.H.vanRiel@fys.ruu.nl> |
+-------------------------------------------+--------------------------+

--- vmscan.c.orig	Thu Mar 19 01:45:42 1998
+++ vmscan.c	Thu Mar 19 20:46:09 1998
@@ -545,6 +545,7 @@
 	add_wait_queue(&kswapd_wait, &wait);
 	while (1) {
 		int tries;
+		int tried = 0;
 
 		current->state = TASK_INTERRUPTIBLE;
 		kswapd_awake = 0;
@@ -563,12 +564,12 @@
 		if (tries < freepages.min) {
 			tries = freepages.min;
 		}
-		if (nr_free_pages < freepages.high + freepages.low)
+		if (nr_free_pages < freepages.low)
 			tries <<= 1;
 		while (tries--) {
 			int gfp_mask;
 
-			if (free_memory_available())
+			if (free_memory_available() && ++tried > SWAP_CLUSTER_MAX)
 				break;
 			gfp_mask = __GFP_IO;
 			try_to_free_page(gfp_mask);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-03-19 19:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-19 19:50 [PATCH] background swapping enabled again Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox