vmscan: move ClearPageActive from move_active_pages() to shrink_active_list()
authorKOSAKI Motohiro <[email protected]>
Tue, 22 Sep 2009 00:01:44 +0000 (17:01 -0700)
committerLinus Torvalds <[email protected]>
Tue, 22 Sep 2009 14:17:30 +0000 (07:17 -0700)
The move_active_pages_to_lru() function is called under irq disabled and
ClearPageActive() doesn't need irq disabling.

Then, this patch move it into shrink_active_list().

Signed-off-by: KOSAKI Motohiro <[email protected]>
Reviewed-by: Johannes Weiner <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Wu Fengguang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/vmscan.c

index ece2ecb081025dd5f1ebf74ed24c0ce70bd5a4bf..ca81d0d05c09575ecf810c09b2b9a27448e6b3b9 100644 (file)
@@ -1278,10 +1278,6 @@ static void move_active_pages_to_lru(struct zone *zone,
                VM_BUG_ON(PageLRU(page));
                SetPageLRU(page);
 
-               VM_BUG_ON(!PageActive(page));
-               if (!is_active_lru(lru))
-                       ClearPageActive(page);  /* we are de-activating */
-
                list_move(&page->lru, &zone->lru[lru].list);
                mem_cgroup_add_lru_list(page, lru);
                pgmoved++;
@@ -1363,6 +1359,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
                        }
                }
 
+               ClearPageActive(page);  /* we are de-activating */
                list_add(&page->lru, &l_inactive);
        }