From: Minchan Kim Date: Wed, 11 May 2011 22:13:30 +0000 (-0700) Subject: mm: check PageUnevictable in lru_deactivate_fn() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bad49d9c89d8755a1289d68e6d0127a6ee79e119;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mm: check PageUnevictable in lru_deactivate_fn() 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 Tested-by: Ying Han Signed-off-by: Minchan Kim Reviewed-by: KOSAKI Motohiro Reviewed-by: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/swap.c b/mm/swap.c index a448db377cb0..5602f1a1b1e7 100644 --- 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;