Skip to content

Commit ef77ba5

Browse files
Michal Hockotorvalds
authored andcommitted
mm, hugetlb, soft_offline: use new_page_nodemask for soft offline migration
new_page is yet another duplication of the migration callback which has to handle hugetlb migration specially. We can safely use the generic new_page_nodemask for the same purpose. Please note that gigantic hugetlb pages do not need any special handling because alloc_huge_page_nodemask will make sure to check pages in all per node pools. The reason this was done previously was that alloc_huge_page_node treated NO_NUMA_NODE and a specific node differently and so alloc_huge_page_node(nid) would check on this specific node. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Michal Hocko <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Reported-by: Vlastimil Babka <[email protected]> Reviewed-by: Mike Kravetz <[email protected]> Tested-by: Mike Kravetz <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3e59fcb commit ef77ba5

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

mm/memory-failure.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,16 +1484,8 @@ EXPORT_SYMBOL(unpoison_memory);
14841484
static struct page *new_page(struct page *p, unsigned long private, int **x)
14851485
{
14861486
int nid = page_to_nid(p);
1487-
if (PageHuge(p)) {
1488-
struct hstate *hstate = page_hstate(compound_head(p));
14891487

1490-
if (hstate_is_gigantic(hstate))
1491-
return alloc_huge_page_node(hstate, NUMA_NO_NODE);
1492-
1493-
return alloc_huge_page_node(hstate, nid);
1494-
} else {
1495-
return __alloc_pages_node(nid, GFP_HIGHUSER_MOVABLE, 0);
1496-
}
1488+
return new_page_nodemask(p, nid, &node_states[N_MEMORY]);
14971489
}
14981490

14991491
/*

0 commit comments

Comments
 (0)