linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Gary Hade <garyhade@us.ibm.com>
To: Greg KH <greg@kroah.com>
Cc: Gary Hade <garyhade@us.ibm.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Yasunori Goto <y-goto@jp.fujitsu.com>,
	Badari Pulavarty <pbadari@us.ibm.com>, Mel Gorman <mel@csn.ul.ie>,
	Chris McDermott <lcm@us.ibm.com>
Subject: Re: [PATCH] Show memory section to node relationship in sysfs
Date: Thu, 4 Sep 2008 20:18:04 -0700	[thread overview]
Message-ID: <20080905031803.GH26795@us.ibm.com> (raw)
In-Reply-To: <20080905012110.GA3170@kroah.com>

On Thu, Sep 04, 2008 at 06:21:10PM -0700, Greg KH wrote:
> On Thu, Sep 04, 2008 at 06:15:00PM -0700, Gary Hade wrote:
> > On Thu, Sep 04, 2008 at 05:40:44PM -0700, Greg KH wrote:
> > > On Thu, Sep 04, 2008 at 03:15:46PM -0700, Dave Hansen wrote:
> > > > On Thu, 2008-09-04 at 13:22 -0700, Gary Hade wrote:
> > > > > 
> > > > > --- linux-2.6.27-rc5.orig/drivers/base/memory.c 2008-09-03 14:24:54.000000000 -0700
> > > > > +++ linux-2.6.27-rc5/drivers/base/memory.c      2008-09-03 14:25:14.000000000 -0700
> > > > > @@ -150,6 +150,22 @@
> > > > >         return len;
> > > > >  }
> > > > > 
> > > > > +/*
> > > > > + * node on which memory section resides
> > > > > + */
> > > > > +static ssize_t show_mem_node(struct sys_device *dev,
> > > > > +                       struct sysdev_attribute *attr, char *buf)
> > > > > +{
> > > > > +       unsigned long start_pfn;
> > > > > +       int ret;
> > > > > +       struct memory_block *mem =
> > > > > +               container_of(dev, struct memory_block, sysdev);
> > > > > +
> > > > > +       start_pfn = section_nr_to_pfn(mem->phys_index);
> > > > > +       ret = pfn_to_nid(start_pfn);
> > > > > +       return sprintf(buf, "%d\n", ret);
> > > > > +}
> > > > 
> > > > I only wonder if this is the "sysfs" way to do it.
> > > > 
> > > > I mean, we don't put a file with the PCI id of a device in the device's
> > > > sysfs directory.  We put a symlink to its place in the bus tree.
> > > > 
> > > > Should we just link over to the NUMA node directory?  We have it there,
> > > > so we might as well use it.
> > > 
> > > That sounds reasonable to me.  Someone is documenting this new addition
> > > with an entry in Documentation/ABI/, right?
> > 
> > Yes, my bad.  Revision will add that to Documentation/memory-hotplug.txt
> > as well as a description of the 'removable' file that Badari mentioned,
> > if OK to include both in the same patch.
> 
> Care to move the information from memory-hotplug.txt into the proper
> place for this kind of stuff (Documentation/ABI for all external kernel
> ABIs).

Sorry, I think I got it now.  Badari has already documented the
memory section 'removable' file in
  Documentation/ABI/testing/sysfs-devices-memory
but descriptions for the other memory section files are not yet
included there.  I will make sure this gets fixed.

Gary

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

--
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:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-09-05  3:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-04 20:22 Gary Hade
2008-09-04 22:14 ` Nish Aravamudan
2008-09-04 23:31   ` Badari Pulavarty
2008-09-05  2:07     ` Gary Hade
2008-09-05  2:29       ` Yasunori Goto
2008-09-04 22:15 ` Dave Hansen
2008-09-05  0:40   ` Greg KH
2008-09-05  1:15     ` Gary Hade
2008-09-05  1:21       ` Greg KH
2008-09-05  3:18         ` Gary Hade [this message]
2008-09-05  1:00   ` Gary Hade
2008-09-05 17:42     ` Dave Hansen
2008-09-05 17:46       ` Gary Hade

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=20080905031803.GH26795@us.ibm.com \
    --to=garyhade@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=greg@kroah.com \
    --cc=lcm@us.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=pbadari@us.ibm.com \
    --cc=y-goto@jp.fujitsu.com \
    /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