--- linux-2.6.22.noarch/mm/vmscan.c.swapfree 2007-07-14 00:36:26.000000000 -0400 +++ linux-2.6.22.noarch/mm/vmscan.c 2007-07-14 00:35:58.000000000 -0400 @@ -892,6 +892,13 @@ static void get_scan_ratio(struct zone * unsigned long anon_prio, file_prio; unsigned long rotate_sum; + /* If there is no free swap space, do not scan anonymous pages. */ + if (nr_swap_pages <= 0) { + *anon_percent = 0; + *file_percent = 100; + return; + } + anon = zone_page_state(zone, NR_ACTIVE_ANON) + zone_page_state(zone, NR_INACTIVE_ANON); file = zone_page_state(zone, NR_ACTIVE_FILE) +