[PATCH] pagevec freeze

From: Hugh Dickins (hugh@veritas.com)
Date: Tue Oct 15 2002 - 16:03:22 EST


refill_inactive_zone stuck circling the one-page active_list with
lru_lock and interrupts disabled, if concurrent release_pages has
done its put_page_testzero and is now spinning for that lru_lock.

(I haven't done a patch for include/linux/pagevec.h, but when working
on this freeze, I noticed that pagevec_add becomes rather unfriendly
once you get into NMIs and BUGs - overshoots PAGEVEC_SIZE and corrupts
beyond. Perhaps you'd say all bets are off then anyway, or perhaps
pagevec_space should be signed, and tested before rather than after?)

--- 2.5.42-mm3/mm/vmscan.c Tue Oct 15 06:43:41 2002
+++ linux/mm/vmscan.c Tue Oct 15 13:14:35 2002
@@ -542,10 +542,13 @@
         long mapped_ratio;
         long distress;
         long swap_tendency;
+ int max_scan;
 
         lru_add_drain();
         spin_lock_irq(&zone->lru_lock);
- while (nr_pages && !list_empty(&zone->active_list)) {
+ max_scan = zone->nr_active;
+ while (max_scan && nr_pages && !list_empty(&zone->active_list)) {
+ max_scan--;
                 page = list_entry(zone->active_list.prev, struct page, lru);
                 prefetchw_prev_lru_page(page, &zone->active_list, flags);
                 if (!TestClearPageLRU(page))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:57 EST