]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/swap.c
vmscan: Use an indexed array for LRU variables
[linux-2.6-omap-h63xx.git] / mm / swap.c
index dd89234ee51fa230f893f6f55d9039dd01693955..82c2b3a76f9437668d74b14ff206fbf9328bbf75 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -117,7 +117,7 @@ static void pagevec_move_tail(struct pagevec *pvec)
                        spin_lock(&zone->lru_lock);
                }
                if (PageLRU(page) && !PageActive(page)) {
-                       list_move_tail(&page->lru, &zone->inactive_list);
+                       list_move_tail(&page->lru, &zone->lru[LRU_INACTIVE].list);
                        pgmoved++;
                }
        }
@@ -278,9 +278,10 @@ int lru_add_drain_all(void)
  * Avoid taking zone->lru_lock if possible, but if it is taken, retain it
  * for the remainder of the operation.
  *
- * The locking in this function is against shrink_cache(): we recheck the
- * page count inside the lock to see whether shrink_cache grabbed the page
- * via the LRU.  If it did, give up: shrink_cache will free it.
+ * The locking in this function is against shrink_inactive_list(): we recheck
+ * the page count inside the lock to see whether shrink_inactive_list()
+ * grabbed the page via the LRU.  If it did, give up: shrink_inactive_list()
+ * will free it.
  */
 void release_pages(struct page **pages, int nr, int cold)
 {
@@ -443,7 +444,7 @@ void pagevec_strip(struct pagevec *pvec)
        for (i = 0; i < pagevec_count(pvec); i++) {
                struct page *page = pvec->pages[i];
 
-               if (PagePrivate(page) && !TestSetPageLocked(page)) {
+               if (PagePrivate(page) && trylock_page(page)) {
                        if (PagePrivate(page))
                                try_to_release_page(page, 0);
                        unlock_page(page);