Re: [PATCH] mm: show node to memory section relationship with symlinks in sysfs

Gary Hade
2008-09-30T19:42:26Z

On Tue, Sep 30, 2008 at 08:50:37AM -0700, Dave Hansen wrote:
> On Tue, 2008-09-30 at 17:06 +0900, Yasunori Goto wrote:
> > > +#define section_nr_to_nid(section_nr) pfn_to_nid(section_nr_to_pfn(section_nr))
> > > #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
> >
> > If the first page of the section is not valid, then this section_nr_to_nid()
> > doesn't return correct value.
> >
> > I tested this patch. In my box, the start_pfn of node 1 is 1200400, but
> > section_nr_to_pfn(mem_blk->phys_index) returns 1200000. As a result,
> > the section is linked to node 0.
>
> Crap, I was worried about that.
>
> Gary, this means that we have a N:1 relationship between NUMA nodes and
> sections. This normally isn't a problem because sections don't really
> care about nodes and they layer underneath them.

So, using Yasunori-san's example the memory section starting at
pfn 1200000 actually resides on both node 0 and node 1.

>
> We'll probably need multiple symlinks in each section directory.

or perhaps symlinks to the same section directory from >1 node directory.

Gary

--
Gary Hade
System x Enablement
IBM Linux Technology Center
503-578-4503 IBM T/L: 775-4503
garyhade@us.ibm.com