All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: Kconfig: Remove ARCH_HAS_HOLES_MEMORYMODEL
@ 2018-08-31 15:19 ` James Morse
  0 siblings, 0 replies; 6+ messages in thread
From: James Morse @ 2018-08-31 15:19 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Will Deacon, Catalin Marinas, linux-mm

include/linux/mmzone.h describes ARCH_HAS_HOLES_MEMORYMODEL as
relevant when parts the memmap have been free()d. This would
happen on systems where memory is smaller than a sparsemem-section,
and the extra struct pages are expensive. pfn_valid() on these
systems returns true for the whole sparsemem-section, so an extra
memmap_valid_within() check is needed.

On arm64 we have nomap memory, so always provide pfn_valid() to test
for nomap pages. This means ARCH_HAS_HOLES_MEMORYMODEL's extra checks
are already rolled up into pfn_valid().

Remove it.

Signed-off-by: James Morse <james.morse@arm.com>
---
 arch/arm64/Kconfig            | 5 +----
 arch/arm64/include/asm/page.h | 2 --
 arch/arm64/mm/init.c          | 2 --
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 1b1a0e95c751..6082d47bfc32 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -769,9 +769,6 @@ source kernel/Kconfig.hz
 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 	def_bool y
 
-config ARCH_HAS_HOLES_MEMORYMODEL
-	def_bool y if SPARSEMEM
-
 config ARCH_SPARSEMEM_ENABLE
 	def_bool y
 	select SPARSEMEM_VMEMMAP_ENABLE
@@ -786,7 +783,7 @@ config ARCH_FLATMEM_ENABLE
 	def_bool !NUMA
 
 config HAVE_ARCH_PFN_VALID
-	def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
+	def_bool y
 
 config HW_PERF_EVENTS
 	def_bool y
diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h
index 60d02c81a3a2..c88a3cb117a1 100644
--- a/arch/arm64/include/asm/page.h
+++ b/arch/arm64/include/asm/page.h
@@ -37,9 +37,7 @@ extern void clear_page(void *to);
 
 typedef struct page *pgtable_t;
 
-#ifdef CONFIG_HAVE_ARCH_PFN_VALID
 extern int pfn_valid(unsigned long);
-#endif
 
 #include <asm/memory.h>
 
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 787e27964ab9..3cf87341859f 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -284,7 +284,6 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
 
 #endif /* CONFIG_NUMA */
 
-#ifdef CONFIG_HAVE_ARCH_PFN_VALID
 int pfn_valid(unsigned long pfn)
 {
 	phys_addr_t addr = pfn << PAGE_SHIFT;
@@ -294,7 +293,6 @@ int pfn_valid(unsigned long pfn)
 	return memblock_is_map_memory(addr);
 }
 EXPORT_SYMBOL(pfn_valid);
-#endif
 
 #ifndef CONFIG_SPARSEMEM
 static void __init arm64_memory_present(void)
-- 
2.18.0

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

* [PATCH] arm64: Kconfig: Remove ARCH_HAS_HOLES_MEMORYMODEL
@ 2018-08-31 15:19 ` James Morse
  0 siblings, 0 replies; 6+ messages in thread
From: James Morse @ 2018-08-31 15:19 UTC (permalink / raw)
  To: linux-arm-kernel

include/linux/mmzone.h describes ARCH_HAS_HOLES_MEMORYMODEL as
relevant when parts the memmap have been free()d. This would
happen on systems where memory is smaller than a sparsemem-section,
and the extra struct pages are expensive. pfn_valid() on these
systems returns true for the whole sparsemem-section, so an extra
memmap_valid_within() check is needed.

On arm64 we have nomap memory, so always provide pfn_valid() to test
for nomap pages. This means ARCH_HAS_HOLES_MEMORYMODEL's extra checks
are already rolled up into pfn_valid().

Remove it.

Signed-off-by: James Morse <james.morse@arm.com>
---
 arch/arm64/Kconfig            | 5 +----
 arch/arm64/include/asm/page.h | 2 --
 arch/arm64/mm/init.c          | 2 --
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 1b1a0e95c751..6082d47bfc32 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -769,9 +769,6 @@ source kernel/Kconfig.hz
 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 	def_bool y
 
-config ARCH_HAS_HOLES_MEMORYMODEL
-	def_bool y if SPARSEMEM
-
 config ARCH_SPARSEMEM_ENABLE
 	def_bool y
 	select SPARSEMEM_VMEMMAP_ENABLE
@@ -786,7 +783,7 @@ config ARCH_FLATMEM_ENABLE
 	def_bool !NUMA
 
 config HAVE_ARCH_PFN_VALID
-	def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
+	def_bool y
 
 config HW_PERF_EVENTS
 	def_bool y
diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h
index 60d02c81a3a2..c88a3cb117a1 100644
--- a/arch/arm64/include/asm/page.h
+++ b/arch/arm64/include/asm/page.h
@@ -37,9 +37,7 @@ extern void clear_page(void *to);
 
 typedef struct page *pgtable_t;
 
-#ifdef CONFIG_HAVE_ARCH_PFN_VALID
 extern int pfn_valid(unsigned long);
-#endif
 
 #include <asm/memory.h>
 
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 787e27964ab9..3cf87341859f 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -284,7 +284,6 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
 
 #endif /* CONFIG_NUMA */
 
-#ifdef CONFIG_HAVE_ARCH_PFN_VALID
 int pfn_valid(unsigned long pfn)
 {
 	phys_addr_t addr = pfn << PAGE_SHIFT;
@@ -294,7 +293,6 @@ int pfn_valid(unsigned long pfn)
 	return memblock_is_map_memory(addr);
 }
 EXPORT_SYMBOL(pfn_valid);
-#endif
 
 #ifndef CONFIG_SPARSEMEM
 static void __init arm64_memory_present(void)
-- 
2.18.0

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

* Re: [PATCH] arm64: Kconfig: Remove ARCH_HAS_HOLES_MEMORYMODEL
  2018-08-31 15:19 ` James Morse
@ 2018-09-03 10:50   ` Will Deacon
  -1 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2018-09-03 10:50 UTC (permalink / raw)
  To: James Morse; +Cc: linux-arm-kernel, Catalin Marinas, linux-mm

On Fri, Aug 31, 2018 at 04:19:43PM +0100, James Morse wrote:
> include/linux/mmzone.h describes ARCH_HAS_HOLES_MEMORYMODEL as
> relevant when parts the memmap have been free()d. This would
> happen on systems where memory is smaller than a sparsemem-section,
> and the extra struct pages are expensive. pfn_valid() on these
> systems returns true for the whole sparsemem-section, so an extra
> memmap_valid_within() check is needed.
> 
> On arm64 we have nomap memory, so always provide pfn_valid() to test
> for nomap pages. This means ARCH_HAS_HOLES_MEMORYMODEL's extra checks
> are already rolled up into pfn_valid().
> 
> Remove it.
> 
> Signed-off-by: James Morse <james.morse@arm.com>
> ---
>  arch/arm64/Kconfig            | 5 +----
>  arch/arm64/include/asm/page.h | 2 --
>  arch/arm64/mm/init.c          | 2 --
>  3 files changed, 1 insertion(+), 8 deletions(-)

Acked-by: Will Deacon <will.deacon@arm.com>

Will

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

* [PATCH] arm64: Kconfig: Remove ARCH_HAS_HOLES_MEMORYMODEL
@ 2018-09-03 10:50   ` Will Deacon
  0 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2018-09-03 10:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 31, 2018 at 04:19:43PM +0100, James Morse wrote:
> include/linux/mmzone.h describes ARCH_HAS_HOLES_MEMORYMODEL as
> relevant when parts the memmap have been free()d. This would
> happen on systems where memory is smaller than a sparsemem-section,
> and the extra struct pages are expensive. pfn_valid() on these
> systems returns true for the whole sparsemem-section, so an extra
> memmap_valid_within() check is needed.
> 
> On arm64 we have nomap memory, so always provide pfn_valid() to test
> for nomap pages. This means ARCH_HAS_HOLES_MEMORYMODEL's extra checks
> are already rolled up into pfn_valid().
> 
> Remove it.
> 
> Signed-off-by: James Morse <james.morse@arm.com>
> ---
>  arch/arm64/Kconfig            | 5 +----
>  arch/arm64/include/asm/page.h | 2 --
>  arch/arm64/mm/init.c          | 2 --
>  3 files changed, 1 insertion(+), 8 deletions(-)

Acked-by: Will Deacon <will.deacon@arm.com>

Will

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

* Re: [PATCH] arm64: Kconfig: Remove ARCH_HAS_HOLES_MEMORYMODEL
  2018-08-31 15:19 ` James Morse
@ 2018-09-21 11:13   ` Catalin Marinas
  -1 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2018-09-21 11:13 UTC (permalink / raw)
  To: James Morse; +Cc: linux-arm-kernel, Will Deacon, linux-mm

On Fri, Aug 31, 2018 at 04:19:43PM +0100, James Morse wrote:
> include/linux/mmzone.h describes ARCH_HAS_HOLES_MEMORYMODEL as
> relevant when parts the memmap have been free()d. This would
> happen on systems where memory is smaller than a sparsemem-section,
> and the extra struct pages are expensive. pfn_valid() on these
> systems returns true for the whole sparsemem-section, so an extra
> memmap_valid_within() check is needed.
> 
> On arm64 we have nomap memory, so always provide pfn_valid() to test
> for nomap pages. This means ARCH_HAS_HOLES_MEMORYMODEL's extra checks
> are already rolled up into pfn_valid().
> 
> Remove it.
> 
> Signed-off-by: James Morse <james.morse@arm.com>

Queued for 4.20. Thanks.

-- 
Catalin

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

* [PATCH] arm64: Kconfig: Remove ARCH_HAS_HOLES_MEMORYMODEL
@ 2018-09-21 11:13   ` Catalin Marinas
  0 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2018-09-21 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 31, 2018 at 04:19:43PM +0100, James Morse wrote:
> include/linux/mmzone.h describes ARCH_HAS_HOLES_MEMORYMODEL as
> relevant when parts the memmap have been free()d. This would
> happen on systems where memory is smaller than a sparsemem-section,
> and the extra struct pages are expensive. pfn_valid() on these
> systems returns true for the whole sparsemem-section, so an extra
> memmap_valid_within() check is needed.
> 
> On arm64 we have nomap memory, so always provide pfn_valid() to test
> for nomap pages. This means ARCH_HAS_HOLES_MEMORYMODEL's extra checks
> are already rolled up into pfn_valid().
> 
> Remove it.
> 
> Signed-off-by: James Morse <james.morse@arm.com>

Queued for 4.20. Thanks.

-- 
Catalin

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

end of thread, other threads:[~2018-09-21 11:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 15:19 [PATCH] arm64: Kconfig: Remove ARCH_HAS_HOLES_MEMORYMODEL James Morse
2018-08-31 15:19 ` James Morse
2018-09-03 10:50 ` Will Deacon
2018-09-03 10:50   ` Will Deacon
2018-09-21 11:13 ` Catalin Marinas
2018-09-21 11:13   ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.