---

 mm/vmscan.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -puN mm/vmscan.c~vm-shrink-zone-div-by-0-fix mm/vmscan.c
--- 25/mm/vmscan.c~vm-shrink-zone-div-by-0-fix	2004-02-04 02:35:49.000000000 -0800
+++ 25-akpm/mm/vmscan.c	2004-02-04 02:36:46.000000000 -0800
@@ -807,14 +807,16 @@ shrink_zone(struct zone *zone, unsigned 
 	 * the inactive list is huge, and imbalance evaluates to zero all the
 	 * time which would pin the active list memory.
 	 */
-	if (zone->nr_active >= zone->nr_inactive*4)
+	if (zone->nr_active >= zone->nr_inactive * 4) {
 		/* ratio will be >= 2 */
 		imbalance = 8*nr_pages;
-	else if (zone->nr_active >= zone->nr_inactive*2)
+	} else if (zone->nr_active >= zone->nr_inactive * 2) {
 		/* 1 < ratio < 2 */
-		imbalance = 4*nr_pages*zone->nr_active / (zone->nr_inactive*2);
-	else
+		imbalance = 4 * nr_pages*zone->nr_active /
+				(zone->nr_inactive * 2 + 1);
+	} else {
 		imbalance = nr_pages / 2;
+	}
 
 	imbalance++;
 

_