linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64/mm: Make vmemmap_free() available only with CONFIG_MEMORY_HOTPLUG
@ 2021-05-24  7:40 Anshuman Khandual
  2021-05-25 18:58 ` Will Deacon
  0 siblings, 1 reply; 2+ messages in thread
From: Anshuman Khandual @ 2021-05-24  7:40 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Anshuman Khandual, Catalin Marinas, Will Deacon, Mark Rutland,
	linux-kernel

vmemmap_free() callsites (mm/sparse.c) and declaration (include/linux/mm.h)
are protected with CONFIG_MEMORY_HOTPLUG. This function is not required if
CONFIG_MEMORY_HOTPLUG is not enabled. Hence move the config wrapper outside
the function definition.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on v5.13-rc3

 arch/arm64/mm/mmu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index e3b639e2461d..207d5f26c004 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -1167,16 +1167,17 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
 	return 0;
 }
 #endif	/* !ARM64_SWAPPER_USES_SECTION_MAPS */
+
+#ifdef CONFIG_MEMORY_HOTPLUG
 void vmemmap_free(unsigned long start, unsigned long end,
 		struct vmem_altmap *altmap)
 {
-#ifdef CONFIG_MEMORY_HOTPLUG
 	WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END));
 
 	unmap_hotplug_range(start, end, true, altmap);
 	free_empty_tables(start, end, VMEMMAP_START, VMEMMAP_END);
-#endif
 }
+#endif /* CONFIG_MEMORY_HOTPLUG */
 
 static inline pud_t *fixmap_pud(unsigned long addr)
 {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm64/mm: Make vmemmap_free() available only with CONFIG_MEMORY_HOTPLUG
  2021-05-24  7:40 [PATCH] arm64/mm: Make vmemmap_free() available only with CONFIG_MEMORY_HOTPLUG Anshuman Khandual
@ 2021-05-25 18:58 ` Will Deacon
  0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2021-05-25 18:58 UTC (permalink / raw)
  To: Anshuman Khandual, linux-arm-kernel
  Cc: catalin.marinas, kernel-team, Will Deacon, linux-kernel, Mark Rutland

On Mon, 24 May 2021 13:10:30 +0530, Anshuman Khandual wrote:
> vmemmap_free() callsites (mm/sparse.c) and declaration (include/linux/mm.h)
> are protected with CONFIG_MEMORY_HOTPLUG. This function is not required if
> CONFIG_MEMORY_HOTPLUG is not enabled. Hence move the config wrapper outside
> the function definition.

Applied to arm64 (for-next/mm), thanks!

[1/1] arm64/mm: Make vmemmap_free() available only with CONFIG_MEMORY_HOTPLUG
      https://git.kernel.org/arm64/c/40221c737608

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-25 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24  7:40 [PATCH] arm64/mm: Make vmemmap_free() available only with CONFIG_MEMORY_HOTPLUG Anshuman Khandual
2021-05-25 18:58 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).