mm: drop meminit_pfn_in_nid as it is redundant

As best as I can tell the meminit_pfn_in_nid call is completely redundant.
The deferred memory initialization is already making use of
for_each_free_mem_range which in turn will call into __next_mem_range
which will only return a memory range if it matches the node ID provided
assuming it is not NUMA_NO_NODE.

I am operating on the assumption that there are no zones or pgdata_t
structures that have a NUMA node of NUMA_NO_NODE associated with them.  If
that is the case then __next_mem_range will never return a memory range
that doesn't match the zone's node ID and as such the check is redundant.

So one piece I would like to verify on this is if this works for ia64.
Technically it was using a different approach to get the node ID, but it
seems to have the node ID also encoded into the memblock.  So I am
assuming this is okay, but would like to get confirmation on that.

On my x86_64 test system with 384GB of memory per node I saw a reduction
in initialization time from 2.80s to 1.85s as a result of this patch.

Signed-off-by: Alexander Duyck <>
Reviewed-by: Pavel Tatashin <>
Acked-by: Michal Hocko <>
Cc: Mike Rapoport <>
Cc: Dan Williams <>
Cc: Dave Jiang <>
Cc: David S. Miller <>
Cc: Ingo Molnar <>
Cc: Khalid Aziz <>
Cc: "Kirill A. Shutemov" <>
Cc: Laurent Dufour <>
Cc: Matthew Wilcox <>
Cc: Mel Gorman <>
Cc: Mike Rapoport <>
Cc: Pavel Tatashin <>
Cc: Vlastimil Babka <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed