Index: linux-2.6.11-rc5-ck2/include/linux/mmzone.h
===================================================================
--- linux-2.6.11-rc5-ck2.orig/include/linux/mmzone.h	2005-03-02 00:07:51.000000000 +1100
+++ linux-2.6.11-rc5-ck2/include/linux/mmzone.h	2005-03-02 00:08:33.000000000 +1100
@@ -110,7 +110,7 @@ struct per_cpu_pageset {
 struct zone {
 	/* Fields commonly accessed by the page allocator */
 	unsigned long		free_pages;
-	unsigned long		pages_min, pages_low, pages_high, pages_lots;
+	unsigned long		pages_min, pages_low, pages_high;
 	/*
 	 * We don't know if the memory that we're going to allocate will be freeable
 	 * or/and it will be released eventually, so to avoid totally wasting several
Index: linux-2.6.11-rc5-ck2/mm/page_alloc.c
===================================================================
--- linux-2.6.11-rc5-ck2.orig/mm/page_alloc.c	2005-03-02 00:07:51.000000000 +1100
+++ linux-2.6.11-rc5-ck2/mm/page_alloc.c	2005-03-02 00:08:33.000000000 +1100
@@ -1988,7 +1988,6 @@ static void setup_per_zone_pages_min(voi
 		 */
 		zone->pages_low   = (zone->pages_min * 5) / 4;
 		zone->pages_high  = (zone->pages_min * 6) / 4;
-		zone->pages_lots  = (zone->pages_min * 12) / 4;
 		spin_unlock_irqrestore(&zone->lru_lock, flags);
 	}
 }
Index: linux-2.6.11-rc5-ck2/mm/vmscan.c
===================================================================
--- linux-2.6.11-rc5-ck2.orig/mm/vmscan.c	2005-03-02 00:07:51.000000000 +1100
+++ linux-2.6.11-rc5-ck2/mm/vmscan.c	2005-03-02 00:10:15.000000000 +1100
@@ -116,7 +116,7 @@ struct shrinker {
 #endif
 
 int vm_mapped = 66;
-int vm_hardmaplimit = 0;
+int vm_hardmaplimit = 1;
 static long total_memory;
 
 static LIST_HEAD(shrinker_list);
@@ -697,12 +697,13 @@ refill_inactive_zone(struct zone *zone, 
 	 * doesn't necessarily mean that page reclaim isn't succeeding.
 	 *
 	 * The distress ratio is important - we don't want to start going oom.
-	 * This distress value is ignored if we apply a hardmaplimit.
+	 * This distress value is ignored if we apply a hardmaplimit except
+	 * in extreme distress.
 	 *
 	 * A 0% value of vm_mapped overrides this algorithm altogether.
 	 */
 	swap_tendency = mapped_ratio * 100 / (vm_mapped + 1);
-	if (!vm_hardmaplimit)
+	if (!vm_hardmaplimit && distress < 100)
 		swap_tendency += distress;
 
 	/*
@@ -1008,6 +1009,7 @@ loop_again:
 			 */
 			for (i = pgdat->nr_zones - 1; i >= 0; i--) {
 				struct zone *zone = pgdat->node_zones + i;
+				unsigned long watermark = zone->pages_high * 2;
 
 				if (zone->present_pages == 0)
 					continue;
@@ -1017,22 +1019,15 @@ loop_again:
 					continue;
 
 				/*
-				 * The pages_lots watermark is relaxed
-				 * till it drops to pages_high under anything
-				 * but very light stress (DEF_PRIORITY)
+				 * The watermark is relaxed depending on the
+				 * level of "priority" till it drops to
+				 * pages_high.
 				 */
-				if (priority != DEF_PRIORITY &&
-					zone->free_pages <= zone->pages_lots &&
-					zone->pages_lots > zone->pages_high) {
-						spin_lock(&zone->lru_lock);
-						zone->pages_lots = 
-							zone->free_pages - 1;
-						spin_unlock(&zone->lru_lock);
-				}
-					
+				watermark -= (zone->pages_high * priority /
+					DEF_PRIORITY);
 
 				if (!zone_watermark_ok(zone, order,
-						zone->pages_lots, 0, 0, 0)) {
+						watermark, 0, 0, 0)) {
 					end_zone = i;
 					goto scan;
 				}

