aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorWu Fengguang <wfg@mail.ustc.edu.cn>2006-03-22 00:08:23 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-22 07:54:00 -0800
commitc9b02d970c385a253edb36c87643b0df706b50b4 (patch)
tree0e1990c1ced842a923221b36ee1546bf9aac8509 /mm
parent7fb2d46d396b2491818f8e43b01049b3234e6c07 (diff)
downloadkernel_samsung_smdk4412-c9b02d970c385a253edb36c87643b0df706b50b4.zip
kernel_samsung_smdk4412-c9b02d970c385a253edb36c87643b0df706b50b4.tar.gz
kernel_samsung_smdk4412-c9b02d970c385a253edb36c87643b0df706b50b4.tar.bz2
[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 <npiggin@suse.de> Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/vmscan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index c712b94..85e95f4 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);