Unevictable LRU Infrastructure
[linux-2.6.git] / include / linux / mm_inline.h
index f451fed..67d7697 100644 (file)
@@ -91,11 +91,16 @@ del_page_from_lru(struct zone *zone, struct page *page)
        enum lru_list l = LRU_BASE;
 
        list_del(&page->lru);
-       if (PageActive(page)) {
-               __ClearPageActive(page);
-               l += LRU_ACTIVE;
+       if (PageUnevictable(page)) {
+               __ClearPageUnevictable(page);
+               l = LRU_UNEVICTABLE;
+       } else {
+               if (PageActive(page)) {
+                       __ClearPageActive(page);
+                       l += LRU_ACTIVE;
+               }
+               l += page_is_file_cache(page);
        }
-       l += page_is_file_cache(page);
        __dec_zone_state(zone, NR_LRU_BASE + l);
 }
 
@@ -110,9 +115,13 @@ static inline enum lru_list page_lru(struct page *page)
 {
        enum lru_list lru = LRU_BASE;
 
-       if (PageActive(page))
-               lru += LRU_ACTIVE;
-       lru += page_is_file_cache(page);
+       if (PageUnevictable(page))
+               lru = LRU_UNEVICTABLE;
+       else {
+               if (PageActive(page))
+                       lru += LRU_ACTIVE;
+               lru += page_is_file_cache(page);
+       }
 
        return lru;
 }