Commit d7ab3672 authored by Michal Hocko's avatar Michal Hocko Committed by Linus Torvalds

mm, page_alloc: fail has_unmovable_pages when seeing reserved pages

Reserved pages should be completely ignored by the core mm because they
have a special meaning for their owners.  has_unmovable_pages doesn't
check those so we rely on other tests (reference count, or PageLRU) to
fail on such pages.  Althought this happens to work it is safer to
simply check for those explicitly and do not rely on the owner of the
page to abuse those fields for special purposes.

Please note that this is more of a further fortification of the code
rahter than a fix of an existing issue.

Link: default avatarMichal Hocko <>
Acked-by: default avatarVlastimil Babka <>
Cc: Igor Mammedov <>
Cc: KAMEZAWA Hiroyuki <>
Cc: Michael Ellerman <>
Cc: Reza Arbab <>
Cc: Vitaly Kuznetsov <>
Cc: Xishi Qiu <>
Cc: Yasuaki Ishimatsu <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 4da2ce25
......@@ -7383,6 +7383,9 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
page = pfn_to_page(check);
if (PageReserved(page))
return true;
* Hugepages are not in LRU lists, but they're movable.
* We need not scan over tail pages bacause we don't
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment