aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2009-09-21 20:02:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 10:17:35 -0400
commit401a8e1c1670085b8177330ca47d4f7c4ac88761 (patch)
tree5883daaed42fa2a186e5769bab1c10535dc39a41 /mm/vmscan.c
parentb7c46d151cb82856a429709d1227ba1648028232 (diff)
mm: introduce page_lru_base_type()
Instead of abusing page_is_file_cache() for LRU list index arithmetic, add another helper with a more appropriate name and convert the non-boolean users of page_is_file_cache() accordingly. This new helper gives the LRU base type a page is supposed to live on, inactive anon or inactive file. [hugh.dickins@tiscali.co.uk: convert del_page_from_lru() also] Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index cad5d528a6f0..30e56ee833f8 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -531,7 +531,7 @@ redo:
531 * unevictable page on [in]active list. 531 * unevictable page on [in]active list.
532 * We know how to handle that. 532 * We know how to handle that.
533 */ 533 */
534 lru = active + page_is_file_cache(page); 534 lru = active + page_lru_base_type(page);
535 lru_cache_add_lru(page, lru); 535 lru_cache_add_lru(page, lru);
536 } else { 536 } else {
537 /* 537 /*
@@ -986,7 +986,7 @@ static unsigned long clear_active_flags(struct list_head *page_list,
986 struct page *page; 986 struct page *page;
987 987
988 list_for_each_entry(page, page_list, lru) { 988 list_for_each_entry(page, page_list, lru) {
989 lru = page_is_file_cache(page); 989 lru = page_lru_base_type(page);
990 if (PageActive(page)) { 990 if (PageActive(page)) {
991 lru += LRU_ACTIVE; 991 lru += LRU_ACTIVE;
992 ClearPageActive(page); 992 ClearPageActive(page);
@@ -2652,7 +2652,7 @@ static void check_move_unevictable_page(struct page *page, struct zone *zone)
2652retry: 2652retry:
2653 ClearPageUnevictable(page); 2653 ClearPageUnevictable(page);
2654 if (page_evictable(page, NULL)) { 2654 if (page_evictable(page, NULL)) {
2655 enum lru_list l = LRU_INACTIVE_ANON + page_is_file_cache(page); 2655 enum lru_list l = page_lru_base_type(page);
2656 2656
2657 __dec_zone_state(zone, NR_UNEVICTABLE); 2657 __dec_zone_state(zone, NR_UNEVICTABLE);
2658 list_move(&page->lru, &zone->lru[l].list); 2658 list_move(&page->lru, &zone->lru[l].list);