linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: Paul Burton <paul.burton@mips.com>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mike Rapoport <rppt@linux.ibm.com>
Subject: Re: [PATCH] mips: sgi-ip27: switch from DISCONTIGMEM to SPARSEMEM
Date: Thu, 12 Sep 2019 11:58:33 +0100	[thread overview]
Message-ID: <20190912105831.GA10677@rapoport-lnx> (raw)
In-Reply-To: <20190911160939.19f776535770d12ff51a2af7@suse.de>

On Wed, Sep 11, 2019 at 04:09:39PM +0200, Thomas Bogendoerfer wrote:
> On Tue, 10 Sep 2019 12:32:44 +0100
> Mike Rapoport <rppt@kernel.org> wrote:
> 
> > [..]
> 
> Patch below works on the same Origin.
> 
> Does memblocks_present() deal better with the one reserved page per node
> than sparse_memory_present_with_active_regions() ? Or is there a better
> explanation ? My debug prints didn't make sense out of it...

I think the problem is that when we call
sparse_memory_present_with_active_regions() per node, the page for the node
data of the next nodes is not yet reserved and since memory_present() does
memblock allocations it may use that memory.

We can try to verify that with "memblock=debug" in the command line.

Another thing we could try to rule out the differences between
memblocks_present() and sparse_memory_present_with_active_regions() is to
replace memblocks_present() in your patch with
sparse_memory_present_with_active_regions(MAX_NUMNODES).

 
> Thomas.
> 
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index d50fafd7bf3a..e4b02b5f3487 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 fb077a947575..370f2ba14a89 100644
> --- a/arch/mips/sgi-ip27/ip27-memory.c
> +++ b/arch/mips/sgi-ip27/ip27-memory.c
> @@ -410,8 +410,6 @@ static void __init node_mem_init(cnodeid_t node)
>  
>  	memblock_reserve(slot_firstpfn << PAGE_SHIFT,
>  			 ((slot_freepfn - slot_firstpfn) << PAGE_SHIFT));
> -
> -	sparse_memory_present_with_active_regions(node);
>  }
>  
>  /*
> @@ -444,6 +442,7 @@ void __init prom_meminit(void)
>  		}
>  		__node_data[node] = &null_node;
>  	}
> +	memblocks_present();
>  }
>  
>  void __init prom_free_prom_memory(void)
> 
> -- 
> SUSE Software Solutions Germany GmbH
> HRB 247165 (AG München)
> Geschäftsführer: Felix Imendörffer

-- 
Sincerely yours,
Mike.

  parent reply	other threads:[~2019-09-12 10:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05  5:47 [PATCH] mips: sgi-ip27: switch from DISCONTIGMEM to SPARSEMEM Mike Rapoport
2019-09-05 13:21 ` Thomas Bogendoerfer
2019-09-05 13:32   ` Mike Rapoport
2019-09-05 13:48     ` Thomas Bogendoerfer
2019-09-05 15:47       ` Mike Rapoport
2019-09-05 21:38         ` Thomas Bogendoerfer
2019-09-06 13:02           ` Mike Rapoport
2019-09-09 16:22             ` Thomas Bogendoerfer
2019-09-10 11:32               ` Mike Rapoport
2019-09-10 12:44                 ` Thomas Bogendoerfer
2019-09-11 14:09                 ` Thomas Bogendoerfer
2019-09-11 14:57                   ` Mike Rapoport
2019-09-12 10:58                   ` Mike Rapoport [this message]
2019-09-12 13:55                     ` Thomas Bogendoerfer
2019-09-12 14:09                       ` Thomas Bogendoerfer
2019-09-12 15:58                         ` Mike Rapoport
2019-09-14 10:41                         ` Mike Rapoport
2019-09-16  9:07                           ` Thomas Bogendoerfer
2019-09-16  9:52                             ` Mike Rapoport
2019-09-16 10:07                               ` Thomas Bogendoerfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190912105831.GA10677@rapoport-lnx \
    --to=rppt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=rppt@linux.ibm.com \
    --cc=tbogendoerfer@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).