All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Olof Johansson <olof@lixom.net>
Cc: Andy Whitcroft <apw@shadowen.org>,
	PPC64 External List <linuxppc64-dev@ozlabs.org>,
	Paul Mackerras <paulus@samba.org>,
	Anton Blanchard <anton@samba.org>, linux-mm <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kravetz@us.ibm.com
Subject: Re: [2/3] add memory present for ppc64
Date: Wed, 04 May 2005 21:43:18 -0700	[thread overview]
Message-ID: <1115268198.9286.11.camel@localhost> (raw)
In-Reply-To: <20050505023119.GA20283@austin.ibm.com>

On Wed, 2005-05-04 at 21:31 -0500, Olof Johansson wrote:
> On Wed, May 04, 2005 at 09:29:57PM +0100, Andy Whitcroft wrote:
> > diff -X /home/apw/brief/lib/vdiff.excl -rupN reference/arch/ppc64/Kconfig current/arch/ppc64/Kconfig
> > --- reference/arch/ppc64/Kconfig	2005-05-04 20:54:50.000000000 +0100
> > +++ current/arch/ppc64/Kconfig	2005-05-04 20:54:50.000000000 +0100
> > @@ -212,8 +212,8 @@ config ARCH_FLATMEM_ENABLE
> >  source "mm/Kconfig"
> >  
> >  config HAVE_ARCH_EARLY_PFN_TO_NID
> > -	bool
> > -	default y
> > +	def_bool y
> > +	depends on NEED_MULTIPLE_NODES
> 
> Ok, time to show my lack of undestanding here, but when can we ever be
> CONFIG_NUMA and NOT need multiple nodes?

NEED_MULTIPLE_NODES is for DISCONTIG || NUMA.  It is a blanket config
option that helps us separate those two very intertwined options.

> > @@ -481,6 +483,7 @@ static void __init setup_nonnuma(void)
> >  
> >  	for (i = 0 ; i < top_of_ram; i += MEMORY_INCREMENT)
> >  		numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = 0;
> > +	memory_present(0, 0, init_node_data[0].node_end_pfn);
> 
> Isn't the memory_present stuff and numa_memory_lookup_table two
> implementations doing the same thing (mapping memory to nodes)?

They have similar functions: record the physical layout of the system.
But, memory_present() is for sparsemem, which basically implements
pfn_to_page() and page_to_pfn().

The numa_memory_lookup_table[] is used for pfn_to_nid(), which is
actually orthogonal to what sparsemem needs.

> Can we kill numa_memory_lookup_table with this?

Nope, we still need it for pfn_to_nid().  We could possibly replace the
current implementation like this:

#define pfn_to_nid(pfn)
page_zone(__pfn_to_section(pfn)->section_mem_map[pfn])->zone_pgdat->node_id

But, that might have a few performance implications :)  There are
certainly some options that sparsemem opens up here, and I hope that we
explore them further as we move away from discontig.

We could even do something like store the nid directly in the
mem_section.  But, as I said, that's an optimization that can come
later.

-- Dave


WARNING: multiple messages have this Message-ID (diff)
From: Dave Hansen <haveblue@us.ibm.com>
To: Olof Johansson <olof@lixom.net>
Cc: Andy Whitcroft <apw@shadowen.org>,
	PPC64 External List <linuxppc64-dev@ozlabs.org>,
	Paul Mackerras <paulus@samba.org>,
	Anton Blanchard <anton@samba.org>, linux-mm <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kravetz@us.ibm.com
Subject: Re: [2/3] add memory present for ppc64
Date: Wed, 04 May 2005 21:43:18 -0700	[thread overview]
Message-ID: <1115268198.9286.11.camel@localhost> (raw)
In-Reply-To: <20050505023119.GA20283@austin.ibm.com>

On Wed, 2005-05-04 at 21:31 -0500, Olof Johansson wrote:
> On Wed, May 04, 2005 at 09:29:57PM +0100, Andy Whitcroft wrote:
> > diff -X /home/apw/brief/lib/vdiff.excl -rupN reference/arch/ppc64/Kconfig current/arch/ppc64/Kconfig
> > --- reference/arch/ppc64/Kconfig	2005-05-04 20:54:50.000000000 +0100
> > +++ current/arch/ppc64/Kconfig	2005-05-04 20:54:50.000000000 +0100
> > @@ -212,8 +212,8 @@ config ARCH_FLATMEM_ENABLE
> >  source "mm/Kconfig"
> >  
> >  config HAVE_ARCH_EARLY_PFN_TO_NID
> > -	bool
> > -	default y
> > +	def_bool y
> > +	depends on NEED_MULTIPLE_NODES
> 
> Ok, time to show my lack of undestanding here, but when can we ever be
> CONFIG_NUMA and NOT need multiple nodes?

NEED_MULTIPLE_NODES is for DISCONTIG || NUMA.  It is a blanket config
option that helps us separate those two very intertwined options.

> > @@ -481,6 +483,7 @@ static void __init setup_nonnuma(void)
> >  
> >  	for (i = 0 ; i < top_of_ram; i += MEMORY_INCREMENT)
> >  		numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = 0;
> > +	memory_present(0, 0, init_node_data[0].node_end_pfn);
> 
> Isn't the memory_present stuff and numa_memory_lookup_table two
> implementations doing the same thing (mapping memory to nodes)?

They have similar functions: record the physical layout of the system.
But, memory_present() is for sparsemem, which basically implements
pfn_to_page() and page_to_pfn().

The numa_memory_lookup_table[] is used for pfn_to_nid(), which is
actually orthogonal to what sparsemem needs.

> Can we kill numa_memory_lookup_table with this?

Nope, we still need it for pfn_to_nid().  We could possibly replace the
current implementation like this:

#define pfn_to_nid(pfn)
page_zone(__pfn_to_section(pfn)->section_mem_map[pfn])->zone_pgdat->node_id

But, that might have a few performance implications :)  There are
certainly some options that sparsemem opens up here, and I hope that we
explore them further as we move away from discontig.

We could even do something like store the nid directly in the
mem_section.  But, as I said, that's an optimization that can come
later.

-- Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-05-05  4:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-04 20:29 [2/3] add memory present for ppc64 Andy Whitcroft
2005-05-04 20:29 ` Andy Whitcroft
2005-05-05  2:31 ` Olof Johansson
2005-05-05  2:31   ` Olof Johansson
2005-05-05  4:43   ` Dave Hansen [this message]
2005-05-05  4:43     ` Dave Hansen
2005-05-05 12:04   ` Andy Whitcroft
2005-05-05 12:04     ` Andy Whitcroft

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=1115268198.9286.11.camel@localhost \
    --to=haveblue@us.ibm.com \
    --cc=anton@samba.org \
    --cc=apw@shadowen.org \
    --cc=kravetz@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=olof@lixom.net \
    --cc=paulus@samba.org \
    /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 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.