mm/swap.c: clear PageActive before adding pages onto unevictable list
authorNaoya Horiguchi <[email protected]>
Wed, 31 Jul 2013 20:53:37 +0000 (13:53 -0700)
committerLinus Torvalds <[email protected]>
Wed, 31 Jul 2013 21:41:03 +0000 (14:41 -0700)
commitef2a2cbdda7e9d084a85846770fcc844958881f6
tree8942f9f69822e234bb0c2da6e0ccc0756ed2d27b
parent31a1b26f16e822577def5402ffc79cfe4aed2db9
mm/swap.c: clear PageActive before adding pages onto unevictable list

As a result of commit 13f7f78981e4 ("mm: pagevec: defer deciding which
LRU to add a page to until pagevec drain time"), pages on unevictable
lists can have both of PageActive and PageUnevictable set.  This is not
only confusing, but also corrupts page migration and
shrink_[in]active_list.

This patch fixes the problem by adding ClearPageActive before adding
pages into unevictable list.  It also cleans up VM_BUG_ONs.

Signed-off-by: Naoya Horiguchi <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/swap.c