lkml.org 
[lkml]   [2008]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] [REPOST #2] mm: show node to memory section relationship with symlinks in sysfs
From
Date
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.

-- Dave



\
 
 \ /
  Last update: 2008-11-05 22:07    [W:0.070 / U:7.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site