From: Nikita Danilov <Nikita@Namesys.COM>

This patch initializes zone->{prev,temp}_priority to DEF_PRIORITY. 
Otherwise they are left zeroed, and first run of VM scanner thinks that
zones are under enormous stress.



---

 include/linux/mmzone.h |    7 +++++++
 mm/page_alloc.c        |    2 ++
 mm/vmscan.c            |    7 -------
 3 files changed, 9 insertions(+), 7 deletions(-)

diff -puN include/linux/mmzone.h~init-zone-priorities include/linux/mmzone.h
--- 25/include/linux/mmzone.h~init-zone-priorities	2004-01-09 10:58:09.000000000 -0800
+++ 25-akpm/include/linux/mmzone.h	2004-01-09 10:58:09.000000000 -0800
@@ -166,6 +166,13 @@ struct zone {
 #define GFP_ZONEMASK	0x03
 
 /*
+ * The "priority" of VM scanning is how much of the queues we will scan in one
+ * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
+ * queues ("queue_length >> 12") during an aging round.
+ */
+#define DEF_PRIORITY 12
+
+/*
  * One allocation request operates on a zonelist. A zonelist
  * is a list of zones, the first one is the 'goal' of the
  * allocation, the other zones are fallback zones, in decreasing
diff -puN mm/page_alloc.c~init-zone-priorities mm/page_alloc.c
--- 25/mm/page_alloc.c~init-zone-priorities	2004-01-09 10:58:09.000000000 -0800
+++ 25-akpm/mm/page_alloc.c	2004-01-09 10:58:09.000000000 -0800
@@ -1266,6 +1266,8 @@ static void __init free_area_init_core(s
 		zone->zone_pgdat = pgdat;
 		zone->free_pages = 0;
 
+		zone->temp_priority = zone->prev_priority = DEF_PRIORITY;
+
 		/*
 		 * The per-cpu-pages pools are set to around 1000th of the
 		 * size of the zone.  But no more than 1/4 of a meg - there's
diff -puN mm/vmscan.c~init-zone-priorities mm/vmscan.c
--- 25/mm/vmscan.c~init-zone-priorities	2004-01-09 10:58:09.000000000 -0800
+++ 25-akpm/mm/vmscan.c	2004-01-09 10:58:09.000000000 -0800
@@ -38,13 +38,6 @@
 #include <linux/swapops.h>
 
 /*
- * The "priority" of VM scanning is how much of the queues we will scan in one
- * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
- * queues ("queue_length >> 12") during an aging round.
- */
-#define DEF_PRIORITY 12
-
-/*
  * From 0 .. 100.  Higher means more swappy.
  */
 int vm_swappiness = 60;

_