Re: Hang on x86-64, 2.6.9-rc3-bk4

From: Jeff Garzik
Date: Sat Oct 16 2004 - 22:07:04 EST


The attached patch does indeed seem to solve the problem.

Now (really) on to Andrew's patches...

Jeff



diff -Naurp -X /g/g/lib/dontdiff linux-2.6.9-rc3-bk4/localversion linux-2.6.9-rc3-bk4-np1/localversion
--- linux-2.6.9-rc3-bk4/localversion 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.9-rc3-bk4-np1/localversion 2004-10-17 01:58:33.000000000 +0000
@@ -0,0 +1 @@
+-np1
diff -Naurp -X /g/g/lib/dontdiff linux-2.6.9-rc3-bk4/mm/vmscan.c linux-2.6.9-rc3-bk4-np1/mm/vmscan.c
--- linux-2.6.9-rc3-bk4/mm/vmscan.c 2004-10-16 17:59:21.000000000 +0000
+++ linux-2.6.9-rc3-bk4-np1/mm/vmscan.c 2004-10-17 02:44:37.000000000 +0000
@@ -181,7 +181,7 @@ static int shrink_slab(unsigned long sca
struct shrinker *shrinker;

if (scanned == 0)
- return 0;
+ scanned = 1;

if (!down_read_trylock(&shrinker_rwsem))
return 0;
@@ -1056,7 +1056,8 @@ scan:
total_reclaimed += sc.nr_reclaimed;
if (zone->all_unreclaimable)
continue;
- if (zone->pages_scanned > zone->present_pages * 2)
+ if (zone->pages_scanned >= (zone->nr_active +
+ zone->nr_inactive) * 4)
zone->all_unreclaimable = 1;
/*
* If we've done a decent amount of scanning and
@@ -1093,8 +1094,10 @@ out:

zone->prev_priority = zone->temp_priority;
}
- if (!all_zones_ok)
+ if (!all_zones_ok) {
+ cond_resched();
goto loop_again;
+ }

return total_reclaimed;
}