Skip to content

Commit

Permalink
mm: check PageUnevictable in lru_deactivate_fn()
Browse files Browse the repository at this point in the history
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 <yinghan@google.com>
Tested-by: Ying Han <yinghan@google.com>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: Rik van Riel<riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Minchan Kim authored and Linus Torvalds committed May 12, 2011
1 parent 52cd4e5 commit bad49d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bad49d9

Please sign in to comment.