Skip to contentSkip to conversation

mm: isolate_lru_pages() scan count fix

PATCH New Wu Fengguang 1 participant 1 message Mar 7, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: isolate_lru_pages() scan count fix

In isolate_lru_pages(), *scanned reports one more scan because the scan counter is increased one more time on exit of the while-loop.

Change the while-loop to for-loop to fix it.

---

mm/vmscan.c +2 -2
@@ -1074,9 +1074,9 @@ static unsigned long isolate_lru_pages(u
 {
 	unsigned long nr_taken = 0;
 	struct page *page;
-	unsigned long scan = 0;
+	unsigned long scan;
 
-	while (scan++ < nr_to_scan && !list_empty(src)) {
+	for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) {
 		struct list_head *target;
 		page = lru_to_page(src);
 		prefetchw_prev_lru_page(page, src, flags);