]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - mm/vmscan.c
unevictable lru: add event counting with statistics
[net-next-2.6.git] / mm / vmscan.c
index 154b9b608da6e9b304f41bd32238bbaa9a633a75..2804d23e2da737e5b91d315989971fcdbbde77cf 100644 (file)
@@ -484,6 +484,7 @@ void putback_lru_page(struct page *page)
 {
        int lru;
        int active = !!TestClearPageActive(page);
+       int was_unevictable = PageUnevictable(page);
 
        VM_BUG_ON(PageLRU(page));
 
@@ -525,6 +526,11 @@ redo:
                 */
        }
 
+       if (was_unevictable && lru != LRU_UNEVICTABLE)
+               count_vm_event(UNEVICTABLE_PGRESCUED);
+       else if (!was_unevictable && lru == LRU_UNEVICTABLE)
+               count_vm_event(UNEVICTABLE_PGCULLED);
+
        put_page(page);         /* drop ref from isolate */
 }