mm: check PageUnevictable in lru_deactivate_fn()
authorMinchan Kim <[email protected]>
Wed, 11 May 2011 22:13:30 +0000 (15:13 -0700)
committerLinus Torvalds <[email protected]>
Thu, 12 May 2011 01:50:44 +0000 (18:50 -0700)
The lru_deactivate_fn should not move page which in on unevictable lru
into inactive list.  Otherwise, we can meet BUG when we use
isolate_lru_pages as __isolate_lru_page could return -EINVAL.

Reported-by: Ying Han <[email protected]>
Tested-by: Ying Han <[email protected]>
Signed-off-by: Minchan Kim <[email protected]>
Reviewed-by: KOSAKI Motohiro <[email protected]>
Reviewed-by: Rik van Riel<[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/swap.c

index a448db377cb046d0871506f156b430dceed818fe..5602f1a1b1e724ba547bdee3ef21d773fd24ee04 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -396,6 +396,9 @@ static void lru_deactivate_fn(struct page *page, void *arg)
        if (!PageLRU(page))
                return;
 
+       if (PageUnevictable(page))
+               return;
+
        /* Some processes are using the page */
        if (page_mapped(page))
                return;