- remove last vestiges of CKRM
authorMark Huang <mlhuang@cs.princeton.edu>
Sun, 21 Aug 2005 00:24:34 +0000 (00:24 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Sun, 21 Aug 2005 00:24:34 +0000 (00:24 +0000)
mm/vmscan.c

index 0453c8e..2395eeb 100644 (file)
@@ -39,7 +39,6 @@
 
 #include <linux/swapops.h>
 
-
 /* possible outcome of pageout() */
 typedef enum {
        /* failed to write page out, page is locked */
@@ -603,8 +602,6 @@ static void shrink_cache(struct zone *zone, struct scan_control *sc)
        LIST_HEAD(page_list);
        struct pagevec pvec;
        int max_scan = sc->nr_to_scan;
-       struct list_head *inactive_list = &zone->inactive_list;
-       struct list_head *active_list = &zone->active_list;
 
        pagevec_init(&pvec, 1);
 
@@ -646,13 +643,10 @@ static void shrink_cache(struct zone *zone, struct scan_control *sc)
                        if (TestSetPageLRU(page))
                                BUG();
                        list_del(&page->lru);
-                       if (PageActive(page)) {
-                               zone->nr_active++;
-                               list_add(&page->lru, active_list);
-                       } else {
-                               zone->nr_inactive++;
-                               list_add(&page->lru, inactive_list);
-                       }
+                       if (PageActive(page))
+                               add_page_to_active_list(zone, page);
+                       else
+                               add_page_to_inactive_list(zone, page);
                        if (!pagevec_add(&pvec, page)) {
                                spin_unlock_irq(&zone->lru_lock);
                                __pagevec_release(&pvec);
@@ -698,8 +692,6 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
        long mapped_ratio;
        long distress;
        long swap_tendency;
-       struct list_head *active_list = &zone->active_list;
-       struct list_head *inactive_list = &zone->inactive_list;
 
        lru_add_drain();
        spin_lock_irq(&zone->lru_lock);
@@ -765,7 +757,7 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
                        BUG();
                if (!TestClearPageActive(page))
                        BUG();
-               list_move(&page->lru, inactive_list);
+               list_move(&page->lru, &zone->inactive_list);
                pgmoved++;
                if (!pagevec_add(&pvec, page)) {
                        zone->nr_inactive += pgmoved;
@@ -793,7 +785,7 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
                if (TestSetPageLRU(page))
                        BUG();
                BUG_ON(!PageActive(page));
-               list_move(&page->lru, active_list);
+               list_move(&page->lru, &zone->active_list);
                pgmoved++;
                if (!pagevec_add(&pvec, page)) {
                        zone->nr_active += pgmoved;
@@ -1111,7 +1103,7 @@ scan:
                        shrink_slab(sc.nr_scanned, GFP_KERNEL, lru_pages);
                        sc.nr_reclaimed += reclaim_state->reclaimed_slab;
                        total_reclaimed += sc.nr_reclaimed;
-                       total_scanned += sc.nr_scanned;
+                       total_scanned += sc.nr_scanned;
                        if (zone->all_unreclaimable)
                                continue;
                        if (zone->pages_scanned >= (zone->nr_active +