linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] low/high water marks in free_memory_available()
@ 1998-04-14 21:38 Rik van Riel
  0 siblings, 0 replies; only message in thread
From: Rik van Riel @ 1998-04-14 21:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm

Hi Linus,

it seems that most of the thrashing in recent kernels comes
from the fact that kswapd is busy continuously.
Adding a very simple high/low water mark should help in most
cases, since kswapd won't run all of the time and the disk
will be idle more, giving other disk processes better performance.

Also, since a value is added to (num_physpages >> 5), it
isn't shifted by 4 anymore... On large-mem machines, >>5
is enough, and on small machines the added value will make
up for the difference (I hope).

The patch below is a very rough patch against 2.1.95.

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> |
+-------------------------------------------+--------------------------+

--- linux/mm/page_alloc.c.orig	Tue Apr 14 23:27:23 1998
+++ linux/mm/page_alloc.c	Tue Apr 14 23:34:21 1998
@@ -134,8 +134,10 @@
 	 * It may not be, due to fragmentation, but we
 	 * don't want to keep on forever trying to find
 	 * free unfragmented memory.
+	 * Added low/high water marks so the disk will be idle
+	 * more of the time -- Rik, 14.4.98.
 	 */
-	if (nr_free_pages > num_physpages >> 4)
+	if (nr_free_pages > (num_physpages >> 5) + (NR_MEM_LISTS - nr) * SWAP_CLUSTER_MAX)
 		return nr+1;
 
 	list = free_area + NR_MEM_LISTS;

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

only message in thread, other threads:[~1998-04-14 22:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-14 21:38 [PATCH] low/high water marks in free_memory_available() 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