diff --git a/mm/madvise.c b/mm/madvise.c index 77e1dc2d4e18..f71fc88f0b33 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -434,8 +434,11 @@ regular_page: 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);