linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kswapd goal setting
@ 1998-03-30 16:28 Rik van Riel
  0 siblings, 0 replies; only message in thread
From: Rik van Riel @ 1998-03-30 16:28 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm, linux-kernel

Hi Linus,

after reading the messages in linux-kernel carefully, I
made the following patch (with fixed switch-points).

The choice of the switching points is based on the messages
posted to linux-kernel in the last few days.

It patches cleanly against 2.1.92-pre1, but should also
work for 2.1.91 and 2.1.90 (?).

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.pre92.1	Mon Mar 30 18:09:44 1998
+++ vmscan.c	Mon Mar 30 18:25:46 1998
@@ -39,6 +39,13 @@
  */
 int swapout_interval = HZ / 4;
 
+/*
+ * This variable is used to determine the final goal of
+ * kswapd's quest...
+ */
+ 
+static int kswapd_goal = 0;
+
 /* 
  * The wait queue for waking up the pageout daemon:
  */
@@ -508,6 +515,16 @@
                s++, i = e - s;
        else
                s = revision, i = -1;
+       /* Here we set the goal for kswapd,
+        * if it's a 40+ MB machine, the full goal
+        * is used, for 16- MB machines we use a even
+        * less agressive goal. -- Rik.
+        */
+       if (num_physpages < 10240) {
+               kswapd_goal++;
+               if (num_physpages < 4096)
+                      kswapd_goal++;
+       }
        printk ("Starting kswapd v%.*s\n", i, s);
 }
 
@@ -574,7 +591,7 @@
 		while (tries--) {
 			int gfp_mask;
 
-			if (++tried > SWAP_CLUSTER_MAX && free_memory_available(0))
+			if (++tried > SWAP_CLUSTER_MAX && free_memory_available(kswapd_goal))
 				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-30 17:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-30 16:28 [PATCH] kswapd goal setting 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