diff --git a/mm/madvise.c b/mm/madvise.c index 882767d58c27..6c099f8bb8e6 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -436,8 +436,11 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd, continue; } - /* Do not interfere with other mappings of this page */ - if (page_mapcount(page) != 1) + /* + * Do not interfere with other mappings of this page and + * non-LRU page. + */ + if (!PageLRU(page) || page_mapcount(page) != 1) continue; VM_BUG_ON_PAGE(PageTransCompound(page), page);