path: root/mm/sparse-vmemmap.c
diff options
authorMichal Hocko <>2017-09-06 16:20:41 -0700
committerLinus Torvalds <>2017-09-06 17:27:26 -0700
commitb95046b0472f7a805fa28fbcfc7205a76ff7a7d0 (patch)
treeb024100d9cc8525f8dc80cddbc908cb08f5ab17c /mm/sparse-vmemmap.c
parentb93e0f329e24f3615aa551fd9b99a75fb7c9195f (diff)
mm, sparse, page_ext: drop ugly N_HIGH_MEMORY branches for allocations
Commit f52407ce2dea ("memory hotplug: alloc page from other node in memory online") has introduced N_HIGH_MEMORY checks to only use NUMA aware allocations when there is some memory present because the respective node might not have any memory yet at the time and so it could fail or even OOM. Things have changed since then though. Zonelists are now always initialized before we do any allocations even for hotplug (see 959ecc48fc75 ("mm/memory_hotplug.c: fix building of node hotplug zonelist")). Therefore these checks are not really needed. In fact caller of the allocator should never care about whether the node is populated because that might change at any time. Link: Signed-off-by: Michal Hocko <> Acked-by: Vlastimil Babka <> Cc: Shaohua Li <> Cc: Joonsoo Kim <> Cc: Johannes Weiner <> Cc: Mel Gorman <> Cc: Toshi Kani <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/sparse-vmemmap.c')
1 files changed, 3 insertions, 8 deletions
diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index c50b1a14d55e..d1a39b8051e0 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -54,14 +54,9 @@ void * __meminit vmemmap_alloc_block(unsigned long size, int node)
if (slab_is_available()) {
struct page *page;
- if (node_state(node, N_HIGH_MEMORY))
- page = alloc_pages_node(
- get_order(size));
- else
- page = alloc_pages(
- get_order(size));
+ page = alloc_pages_node(node,
+ get_order(size));
if (page)
return page_address(page);
return NULL;