[PATCH] numa placement for dynamically added memory

Mike Kravetz kravetz at us.ibm.com
Sat Dec 3 05:43:33 EST 2005


On Thu, Dec 01, 2005 at 10:02:30PM -0500, Nathan Lynch wrote:
> > +#ifdef CONFIG_MEMORY_HOTPLUG
> > +static unsigned long read_n_cells(int n, unsigned int **buf)
> > +#else
> >  static unsigned long __init read_n_cells(int n, unsigned int **buf)
> > +#endif
> 
> Any reason not to use __devinit here?  Or maybe look into devising a
> macro like __cpuinit for memory hotplug.

Nope that makes sense. Thanks.

> > +		/* Domains not present at boot default to 0 */
> > +		if (!node_online(numa_domain))
> > +			numa_domain = 0;
> 
> Nope, 0 is not always a valid node on pSeries lpar.  I suggest using
> any_online_node(), or revisiting the idea of logical<->physical
> mapping of node/domain ids.  I tried the latter a few months ago but
> I've been working on other stuff lately and haven't been able to
> revisit it.

Yeah, I can do that.  As a side note, it looks like 0 will always be a
valid node in the current code.  If we successfully execute
parse_numa_properties(), then this code will be run.

        for (i = 0; i <= max_domain; i++)
                node_set_online(i);

If we execute setup_nonnuma() instead, then the following is executed:

	node_set_online(0);

I've previously wondered about the above code in parse_numa_properties().
You seem to confirm that is not the desired behavior.  Should this be
changed?

> > +#ifdef CONFIG_NUMA
> > +extern int hot_add_scn_to_nid(unsigned long scn_addr);
> > +#else
> > +#define hot_add_scn_to_nid(scn_addr) (0)
> > +#endif
> 
> Make hot_add_scn_to_nid a static inline in the !CONFIG_NUMA case,
> please.

OK

-- 
Mike



More information about the Linuxppc64-dev mailing list