Re: kswapd in tight loop 2.6.9-rc3-bk-recent

From: Nick Piggin
Date: Thu Oct 07 2004 - 22:02:00 EST




Andrew Morton wrote:

Chris Wright <chrisw@xxxxxxxx> wrote:

(whereas I could get the mainline code, and the
one-liner to spin right off).


How? (up to and including .config please).




Ah, free_pages <= pages_high, ie. 0 <= 0, which is true;
commence spinning.

How's this go?




Signed-off-by: Nick Piggin <nickpiggin@xxxxxxxxxxxx>


---

linux-2.6-npiggin/mm/vmscan.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN mm/vmscan.c~vm-fix-empty-zones mm/vmscan.c
--- linux-2.6/mm/vmscan.c~vm-fix-empty-zones 2004-10-08 12:44:14.000000000 +1000
+++ linux-2.6-npiggin/mm/vmscan.c 2004-10-08 12:44:48.000000000 +1000
@@ -1003,7 +1003,7 @@ static int balance_pgdat(pg_data_t *pgda
priority != DEF_PRIORITY)
continue;

- if (zone->free_pages <= zone->pages_high) {
+ if (zone->free_pages < zone->pages_high) {
end_zone = i;
goto scan;
}
@@ -1035,7 +1035,7 @@ scan:
continue;

if (nr_pages == 0) { /* Not software suspend */
- if (zone->free_pages <= zone->pages_high)
+ if (zone->free_pages < zone->pages_high)
all_zones_ok = 0;
}
zone->temp_priority = priority;
@@ -1142,7 +1142,7 @@ static int kswapd(void *p)
*/
void wakeup_kswapd(struct zone *zone)
{
- if (zone->free_pages > zone->pages_low)
+ if (zone->free_pages >= zone->pages_low)
return;
if (!waitqueue_active(&zone->zone_pgdat->kswapd_wait))
return;

_