From: Wu Fengguang Date: Wed, 22 Mar 2006 08:08:23 +0000 (-0800) Subject: [PATCH] mm: isolate_lru_pages() scan count fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c9b02d970c385a253edb36c87643b0df706b50b4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [PATCH] 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. Signed-off-by: Nick Piggin Signed-off-by: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index c712b946e4ff..85e95f445022 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1074,9 +1074,9 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, { 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);