diff --git a/mm/madvise.c b/mm/madvise.c index 1107e99e498b..ac8d68c488b5 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -428,8 +428,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);