mm, hugetlb: do not allocate non-migrateable gigantic pages from movable zones
authorMichal Hocko <[email protected]>
Wed, 6 Sep 2017 23:24:03 +0000 (16:24 -0700)
committerLinus Torvalds <[email protected]>
Thu, 7 Sep 2017 00:27:29 +0000 (17:27 -0700)
commit79b63f12abcbbd2caf7064b294af648a87de07ff
tree54214695c9d07b6096d6976e8ebc92a5956b0a11
parenta36985d31a65d5c0559fb582719e32eaf0ccec3b
mm, hugetlb: do not allocate non-migrateable gigantic pages from movable zones

alloc_gigantic_page doesn't consider movability of the gigantic hugetlb
when scanning eligible ranges for the allocation.  As 1GB hugetlb pages
are not movable currently this can break the movable zone assumption
that all allocations are migrateable and as such break memory hotplug.

Reorganize the code and use the standard zonelist allocations scheme
that we use for standard hugetbl pages.  htlb_alloc_mask will ensure
that only migratable hugetlb pages will ever see a movable zone.

Link: http://lkml.kernel.org/r/[email protected]
Fixes: 944d9fec8d7a ("hugetlb: add support for gigantic page allocation at runtime")
Signed-off-by: Michal Hocko <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Cc: Luiz Capitulino <[email protected]>
Cc: Naoya Horiguchi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/hugetlb.c