mm: fix handling PTE-mapped THPs in page_referenced()
authorKirill A. Shutemov <[email protected]>
Fri, 24 Feb 2017 22:57:48 +0000 (14:57 -0800)
committerLinus Torvalds <[email protected]>
Sat, 25 Feb 2017 01:46:55 +0000 (17:46 -0800)
commit8eaedede825a02dbe2420b9c9be9b5b2d7515496
tree51f79985a82da0d8768b3dfe797821425cabfa52
parentace71a19cec5eb430207c3269d8a2683f0574306
mm: fix handling PTE-mapped THPs in page_referenced()

For PTE-mapped THP page_check_address_transhuge() is not adequate: it
cannot find all relevant PTEs, only the first one.  It means we can miss
some references of the page and it can result in suboptimal decisions by
vmscan.

Let's switch it to page_vma_mapped_walk().

I don't think it's subject for stable@: it's not fatal.  The only side
effect is that THP can be swapped out when it shouldn't.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Kirill A. Shutemov <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Hillf Danton <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Srikar Dronamraju <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/rmap.c