mm/sparse: cleanup the code surrounding memory_present()
authorMike Rapoport <rppt@linux.ibm.com>
Fri, 7 Aug 2020 06:24:02 +0000 (23:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 Aug 2020 18:33:27 +0000 (11:33 -0700)
commitc89ab04febf97d2db8ca4ef8e2866fadc474351b
tree99a12f54aa9cabcdd0b1c0a91098cbbc29b04a3b
parent6cda72047ea46272ecb9cc71acf1231cea07167a
mm/sparse: cleanup the code surrounding memory_present()

After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP we have two equivalent
functions that call memory_present() for each region in memblock.memory:
sparse_memory_present_with_active_regions() and membocks_present().

Moreover, all architectures have a call to either of these functions
preceding the call to sparse_init() and in the most cases they are called
one after the other.

Mark the regions from memblock.memory as present during sparce_init() by
making sparse_init() call memblocks_present(), make memblocks_present()
and memory_present() functions static and remove redundant
sparse_memory_present_with_active_regions() function.

Also remove no longer required HAVE_MEMORY_PRESENT configuration option.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20200712083130.22919-1-rppt@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
23 files changed:
Documentation/vm/memory-model.rst
arch/arm/mm/init.c
arch/arm64/mm/init.c
arch/ia64/mm/discontig.c
arch/microblaze/mm/init.c
arch/mips/kernel/setup.c
arch/mips/loongson64/numa.c
arch/mips/sgi-ip27/ip27-memory.c
arch/parisc/mm/init.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/numa.c
arch/riscv/mm/init.c
arch/s390/mm/init.c
arch/sh/mm/init.c
arch/sh/mm/numa.c
arch/sparc/mm/init_64.c
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c
include/linux/mm.h
include/linux/mmzone.h
mm/Kconfig
mm/page_alloc.c
mm/sparse.c