diff options
author | Wu Fengguang <wfg@mail.ustc.edu.cn> | 2006-03-22 00:08:28 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 07:54:00 -0800 |
commit | fb8d14e172a29ba5ac69a73b61196be86fdfc3e1 (patch) | |
tree | 5b31eac00f8fc5860170d7f8b2e7e961dbda0ddf /mm | |
parent | c9b02d970c385a253edb36c87643b0df706b50b4 (diff) | |
download | lwn-fb8d14e172a29ba5ac69a73b61196be86fdfc3e1.tar.gz lwn-fb8d14e172a29ba5ac69a73b61196be86fdfc3e1.zip |
[PATCH] mm: shrink_inactive_lis() nr_scan accounting fix
In shrink_inactive_list(), nr_scan is not accounted when nr_taken is 0.
But 0 pages taken does not mean 0 pages scanned.
Move the goto statement below the accounting code to fix it.
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.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 85e95f445022..486184d2b50c 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1132,9 +1132,6 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, zone->pages_scanned += nr_scan; spin_unlock_irq(&zone->lru_lock); - if (nr_taken == 0) - goto done; - nr_scanned += nr_scan; nr_freed = shrink_page_list(&page_list, sc); nr_reclaimed += nr_freed; @@ -1146,6 +1143,9 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, __mod_page_state_zone(zone, pgscan_direct, nr_scan); __mod_page_state_zone(zone, pgsteal, nr_freed); + if (nr_taken == 0) + goto done; + spin_lock(&zone->lru_lock); /* * Put back any unfreeable pages. @@ -1166,8 +1166,9 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, } } } while (nr_scanned < max_scan); - spin_unlock_irq(&zone->lru_lock); + spin_unlock(&zone->lru_lock); done: + local_irq_enable(); pagevec_release(&pvec); return nr_reclaimed; } |