Commit c9b02d97 authored by Wu Fengguang's avatar Wu Fengguang Committed by Linus Torvalds

[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: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarWu Fengguang <wfg@mail.ustc.edu.cn>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7fb2d46d
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment