2019-09-16 16:18:40

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v2] mips: sgi-ip27: switch from DISCONTIGMEM to SPARSEMEM

From: Mike Rapoport <[email protected]>

The memory initialization of SGI-IP27 is already half-way to support
SPARSEMEM. It only had free_bootmem_with_active_regions() left-overs
interfering with sparse_memory_present_with_active_regions().

Replace these calls with simpler memblocks_present() call in prom_meminit()
and adjust arch/mips/Kconfig to enable SPARSEMEM and SPARSEMEM_EXTREME for
SGI-IP27.

Co-developed-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: Mike Rapoport <[email protected]>
---

v2: don't add extra sparse_init() and use memblocks_present() instead of
sparse_memory_present_with_active_regions()

arch/mips/Kconfig | 12 ++----------
arch/mips/sgi-ip27/ip27-memory.c | 6 ++----
2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d50fafd..e4b02b5 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -669,6 +669,7 @@ config SGI_IP22
config SGI_IP27
bool "SGI IP27 (Origin200/2000)"
select ARCH_HAS_PHYS_TO_DMA
+ select ARCH_SPARSEMEM_ENABLE
select FW_ARC
select FW_ARC64
select BOOT_ELF64
@@ -2633,18 +2634,9 @@ config ARCH_FLATMEM_ENABLE
def_bool y
depends on !NUMA && !CPU_LOONGSON2

-config ARCH_DISCONTIGMEM_ENABLE
- bool
- default y if SGI_IP27
- help
- Say Y to support efficient handling of discontiguous physical memory,
- for architectures which are either NUMA (Non-Uniform Memory Access)
- or have huge holes in the physical address space for other reasons.
- See <file:Documentation/vm/numa.rst> for more.
-
config ARCH_SPARSEMEM_ENABLE
bool
- select SPARSEMEM_STATIC
+ select SPARSEMEM_STATIC if !SGI_IP27

config NUMA
bool "NUMA Support"
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index fb077a9..9db8692 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -406,12 +406,8 @@ static void __init node_mem_init(cnodeid_t node)
slot_freepfn += PFN_UP(sizeof(struct pglist_data) +
sizeof(struct hub_data));

- free_bootmem_with_active_regions(node, end_pfn);
-
memblock_reserve(slot_firstpfn << PAGE_SHIFT,
((slot_freepfn - slot_firstpfn) << PAGE_SHIFT));
-
- sparse_memory_present_with_active_regions(node);
}

/*
@@ -444,6 +440,8 @@ void __init prom_meminit(void)
}
__node_data[node] = &null_node;
}
+
+ memblocks_present();
}

void __init prom_free_prom_memory(void)
--
2.7.4


2019-10-02 07:14:24

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH v2] mips: sgi-ip27: switch from DISCONTIGMEM to SPARSEMEM

Hi,

Any updates on this?

On Mon, Sep 16, 2019 at 02:13:10PM +0300, Mike Rapoport wrote:
> From: Mike Rapoport <[email protected]>
>
> The memory initialization of SGI-IP27 is already half-way to support
> SPARSEMEM. It only had free_bootmem_with_active_regions() left-overs
> interfering with sparse_memory_present_with_active_regions().
>
> Replace these calls with simpler memblocks_present() call in prom_meminit()
> and adjust arch/mips/Kconfig to enable SPARSEMEM and SPARSEMEM_EXTREME for
> SGI-IP27.
>
> Co-developed-by: Thomas Bogendoerfer <[email protected]>
> Signed-off-by: Thomas Bogendoerfer <[email protected]>
> Signed-off-by: Mike Rapoport <[email protected]>
> ---
>
> v2: don't add extra sparse_init() and use memblocks_present() instead of
> sparse_memory_present_with_active_regions()
>
> arch/mips/Kconfig | 12 ++----------
> arch/mips/sgi-ip27/ip27-memory.c | 6 ++----
> 2 files changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index d50fafd..e4b02b5 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -669,6 +669,7 @@ config SGI_IP22
> config SGI_IP27
> bool "SGI IP27 (Origin200/2000)"
> select ARCH_HAS_PHYS_TO_DMA
> + select ARCH_SPARSEMEM_ENABLE
> select FW_ARC
> select FW_ARC64
> select BOOT_ELF64
> @@ -2633,18 +2634,9 @@ config ARCH_FLATMEM_ENABLE
> def_bool y
> depends on !NUMA && !CPU_LOONGSON2
>
> -config ARCH_DISCONTIGMEM_ENABLE
> - bool
> - default y if SGI_IP27
> - help
> - Say Y to support efficient handling of discontiguous physical memory,
> - for architectures which are either NUMA (Non-Uniform Memory Access)
> - or have huge holes in the physical address space for other reasons.
> - See <file:Documentation/vm/numa.rst> for more.
> -
> config ARCH_SPARSEMEM_ENABLE
> bool
> - select SPARSEMEM_STATIC
> + select SPARSEMEM_STATIC if !SGI_IP27
>
> config NUMA
> bool "NUMA Support"
> diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
> index fb077a9..9db8692 100644
> --- a/arch/mips/sgi-ip27/ip27-memory.c
> +++ b/arch/mips/sgi-ip27/ip27-memory.c
> @@ -406,12 +406,8 @@ static void __init node_mem_init(cnodeid_t node)
> slot_freepfn += PFN_UP(sizeof(struct pglist_data) +
> sizeof(struct hub_data));
>
> - free_bootmem_with_active_regions(node, end_pfn);
> -
> memblock_reserve(slot_firstpfn << PAGE_SHIFT,
> ((slot_freepfn - slot_firstpfn) << PAGE_SHIFT));
> -
> - sparse_memory_present_with_active_regions(node);
> }
>
> /*
> @@ -444,6 +440,8 @@ void __init prom_meminit(void)
> }
> __node_data[node] = &null_node;
> }
> +
> + memblocks_present();
> }
>
> void __init prom_free_prom_memory(void)
> --
> 2.7.4
>

--
Sincerely yours,
Mike.

2019-10-07 17:54:16

by Paul Burton

[permalink] [raw]
Subject: Re: [PATCH v2] mips: sgi-ip27: switch from DISCONTIGMEM to SPARSEMEM

Hello,

Mike Rapoport wrote:
> From: Mike Rapoport <[email protected]>
>
> The memory initialization of SGI-IP27 is already half-way to support
> SPARSEMEM. It only had free_bootmem_with_active_regions() left-overs
> interfering with sparse_memory_present_with_active_regions().
>
> Replace these calls with simpler memblocks_present() call in prom_meminit()
> and adjust arch/mips/Kconfig to enable SPARSEMEM and SPARSEMEM_EXTREME for
> SGI-IP27.

Applied to mips-next.

> commit 397dc00e249e
> https://git.kernel.org/mips/c/397dc00e249e
>
> Co-developed-by: Thomas Bogendoerfer <[email protected]>
> Signed-off-by: Thomas Bogendoerfer <[email protected]>
> Signed-off-by: Mike Rapoport <[email protected]>
> Signed-off-by: Paul Burton <[email protected]>

Thanks,
Paul

[ This message was auto-generated; if you believe anything is incorrect
then please email [email protected] to report it. ]