[PATCH] mm: remove PG_Mlocked VM_BUG_ON check

From: Minchan Kim
Date: Mon Apr 10 2017 - 22:41:54 EST


Caller of try_to_munlock doesn't guarantee he pass the page
with clearing PG_mlocked.
Look at __munlock_pagevec which doesn't hold any PG_lock
so anybody can set PG_mlocked under us.
Remove bogus PageMlocked check in try_to_munlock.

Reported-by: Sasha Levin <alexander.levin@xxxxxxxxxxx>
Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx>
---
Andrew,

This patch can be foled into mm-make-the-try_to_munlock-void-function.patch.
Thanks.

mm/rmap.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index a69a2a70d057..0773118214cc 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1557,7 +1557,6 @@ void try_to_munlock(struct page *page)
};

VM_BUG_ON_PAGE(!PageLocked(page) || PageLRU(page), page);
- VM_BUG_ON_PAGE(PageMlocked(page), page);
VM_BUG_ON_PAGE(PageCompound(page) && PageDoubleMap(page), page);

rmap_walk(page, &rwc);
--
2.7.4