summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorChristoph Lameter2006-02-12 02:55:53 +0100
committerLinus Torvalds2006-02-12 06:41:11 +0100
commit80e4342601abfafacb5f20571e40b56d73d10819 (patch)
treec03c988860aa8b6a1cc24ba8adff3778c1705928 /mm/vmscan.c
parent[PATCH] select: fix returned timeval (diff)
downloadkernel-qcow2-linux-80e4342601abfafacb5f20571e40b56d73d10819.tar.gz
kernel-qcow2-linux-80e4342601abfafacb5f20571e40b56d73d10819.tar.xz
kernel-qcow2-linux-80e4342601abfafacb5f20571e40b56d73d10819.zip
[PATCH] zone reclaim: do not check references to a page during zone reclaim
shrink_list() and refill_inactive() check all ptes pointing to a page for reference bits in order to decide if the page should be put on the active list. This is not necessary for zone_reclaim since we are only interested in removing unmapped pages. Skip the checks in both functions. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5db32fdfaf39..e1c64230ffdd 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -443,6 +443,10 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
BUG_ON(PageActive(page));
sc->nr_scanned++;
+
+ if (!sc->may_swap && page_mapped(page))
+ goto keep_locked;
+
/* Double the slab pressure for mapped and swapcache pages */
if (page_mapped(page) || PageSwapCache(page))
sc->nr_scanned++;
@@ -1231,7 +1235,7 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
* Now use this metric to decide whether to start moving mapped memory
* onto the inactive list.
*/
- if (swap_tendency >= 100)
+ if (swap_tendency >= 100 && sc->may_swap)
reclaim_mapped = 1;
while (!list_empty(&l_hold)) {