From: Gary Hade <garyhade@us.ibm.com>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Gary Hade <garyhade@us.ibm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
y-goto@jp.fujitsu.com, pbadari@us.ibm.com, mel@csn.ul.ie,
lcm@us.ibm.com, mingo@elte.hu, greg@kroah.com,
nish.aravamudan@gmail.com
Subject: Re: [PATCH] [REPOST #2] mm: show node to memory section relationship with symlinks in sysfs
Date: Wed, 5 Nov 2008 14:50:06 -0800 [thread overview]
Message-ID: <20081105225006.GA14663@us.ibm.com> (raw)
In-Reply-To: <1225919024.11514.4.camel@nimitz>
On Wed, Nov 05, 2008 at 01:03:44PM -0800, Dave Hansen wrote:
> On Wed, 2008-11-05 at 12:36 -0800, Andrew Morton wrote:
> > Dumb question: why do this with a symlink forest instead of, say, cat
> > /proc/sys/vm/mem-sections?
>
> The basic problem is that we on/offline memory based on sections and not
> nodes. But, physically, people care about nodes.
>
> So, the question we're answering is "to which sections does this node's
> memory belong?". We could just put all this data in one big file and
> have:
>
> $ cat /proc/sys/vm/mem-sections?
> node: section numbers
> 0: 1 2 3 4 5
> 1: 5 6 7 8
> 2: 99 100 101 102
>
> But, we have the nodes in sysfs and we also have the sections in sysfs
> and I don't want Greg to be mean to me. He's scary. We could simply
> dump the section numbers in sysfs, but the first thing userspace is
> going to do is:
>
> for section in /sys/devices/system/node/node1/memory*; do
> nr=$(cat $section)
> cat foo > /sys/devices/system/memory/memory$nr/bar
> done
>
> Making the symlinks makes it harder for us to screw this process up,
> both in the kernel and in userspace. Plus, symlinks are easy to code up
> in sysfs.
The new symlinks to the mem sections directories from within
the node directories are also consistent with the presidence set
by symlinks to the CPU directories from these same locations.
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
next prev parent reply other threads:[~2008-11-05 22:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-03 23:48 [PATCH] [REPOST #2] mm: show node to memory section relationship with symlinks in sysfs Gary Hade
2008-11-04 9:16 ` Ingo Molnar
2008-11-05 20:36 ` Andrew Morton
2008-11-05 21:03 ` Dave Hansen
2008-11-05 22:50 ` Gary Hade [this message]
2008-11-12 22:16 ` Badari Pulavarty
2008-11-13 16:54 ` Gary Hade
2008-11-13 19:12 ` Badari Pulavarty
2008-11-14 16:05 ` Badari Pulavarty
2008-11-14 16:41 ` Gary Hade
2008-11-15 0:08 ` 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=20081105225006.GA14663@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-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=mingo@elte.hu \
--cc=nish.aravamudan@gmail.com \
--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