Skip to content

Commit c9b02d9

Browse files
Wu FengguangLinus Torvalds
authored andcommitted
[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 <[email protected]> Signed-off-by: Wu Fengguang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7fb2d46 commit c9b02d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/vmscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,9 +1074,9 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
10741074
{
10751075
unsigned long nr_taken = 0;
10761076
struct page *page;
1077-
unsigned long scan = 0;
1077+
unsigned long scan;
10781078

1079-
while (scan++ < nr_to_scan && !list_empty(src)) {
1079+
for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) {
10801080
struct list_head *target;
10811081
page = lru_to_page(src);
10821082
prefetchw_prev_lru_page(page, src, flags);

0 commit comments

Comments
 (0)