mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 22:58:29 +00:00
[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>
This commit is contained in:
parent
7fb2d46d39
commit
c9b02d970c
1 changed files with 2 additions and 2 deletions
|
@ -1074,9 +1074,9 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
|
||||||
{
|
{
|
||||||
unsigned long nr_taken = 0;
|
unsigned long nr_taken = 0;
|
||||||
struct page *page;
|
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;
|
struct list_head *target;
|
||||||
page = lru_to_page(src);
|
page = lru_to_page(src);
|
||||||
prefetchw_prev_lru_page(page, src, flags);
|
prefetchw_prev_lru_page(page, src, flags);
|
||||||
|
|
Loading…
Add table
Reference in a new issue