]> git.hungrycats.org Git - linux/commitdiff
[PATCH] vmscan: preserve page referenced info in refill_inactive()
authorAndrew Morton <akpm@osdl.org>
Fri, 12 Mar 2004 00:23:01 +0000 (16:23 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 12 Mar 2004 00:23:01 +0000 (16:23 -0800)
From: Nick Piggin <piggin@cyberone.com.au>

If refill_inactive_zone() is running in its dont-reclaim-mapped-memory mode
we are tossing away the referenced infomation on active mapped pages.

So put that info back if we're not going to deactivate the page.

mm/vmscan.c

index 23d2431ece7352645193d94070f22c535c3f8bea..f8e0dff4bc01e971b8c511ebb7b173dfed9961ba 100644 (file)
@@ -662,17 +662,17 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
                page = list_entry(l_hold.prev, struct page, lru);
                list_del(&page->lru);
                if (page_mapped(page)) {
-                       pte_chain_lock(page);
-                       if (page_mapped(page) && page_referenced(page)) {
-                               pte_chain_unlock(page);
+                       if (!reclaim_mapped) {
                                list_add(&page->lru, &l_active);
                                continue;
                        }
-                       pte_chain_unlock(page);
-                       if (!reclaim_mapped) {
+                       pte_chain_lock(page);
+                       if (page_referenced(page)) {
+                               pte_chain_unlock(page);
                                list_add(&page->lru, &l_active);
                                continue;
                        }
+                       pte_chain_unlock(page);
                }
                /*
                 * FIXME: need to consider page_count(page) here if/when we