Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176276
b: refs/heads/master
c: dee5d0d
h: refs/heads/master
v: v3
  • Loading branch information
Alex Chiang authored and Linus Torvalds committed Dec 15, 2009
1 parent 5431284 commit bf73d51
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d99be1a8ecf377c2c9b3372d36411ad6547bbd4c
refs/heads/master: dee5d0d518defd0337a41f1a504428c9acc87be5
14 changes: 13 additions & 1 deletion trunk/Documentation/ABI/testing/sysfs-devices-memory
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ Description:
Users: hotplug memory remove tools
https://w3.opensource.ibm.com/projects/powerpc-utils/


What: /sys/devices/system/memoryX/nodeY
Date: October 2009
Contact: Linux Memory Management list <linux-mm@kvack.org>
Description:
When CONFIG_NUMA is enabled, a symbolic link that
points to the corresponding NUMA node directory.

For example, the following symbolic link is created for
memory section 9 on node0:
/sys/devices/system/memory/memory9/node0 -> ../../node/node0


What: /sys/devices/system/node/nodeX/memoryY
Date: September 2008
Contact: Gary Hade <garyhade@us.ibm.com>
Expand All @@ -70,4 +83,3 @@ Description:
memory section directory. For example, the following symbolic
link is created for memory section 9 on node0.
/sys/devices/system/node/node0/memory9 -> ../../memory/memory9

11 changes: 7 additions & 4 deletions trunk/Documentation/memory-hotplug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,15 @@ Under each section, you can see 4 files.
NOTE:
These directories/files appear after physical memory hotplug phase.

If CONFIG_NUMA is enabled the
/sys/devices/system/memory/memoryXXX memory section
directories can also be accessed via symbolic links located in
the /sys/devices/system/node/node* directories. For example:
If CONFIG_NUMA is enabled the memoryXXX/ directories can also be accessed
via symbolic links located in the /sys/devices/system/node/node* directories.

For example:
/sys/devices/system/node/node0/memory9 -> ../../memory/memory9

A backlink will also be created:
/sys/devices/system/memory/memory9/node0 -> ../../node/node0

--------------------------------
4. Physical memory hot-add phase
--------------------------------
Expand Down
11 changes: 10 additions & 1 deletion trunk/drivers/base/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ static int get_nid_for_pfn(unsigned long pfn)
/* register memory section under specified node if it spans that node */
int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
{
int ret;
unsigned long pfn, sect_start_pfn, sect_end_pfn;

if (!mem_blk)
Expand All @@ -328,9 +329,15 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
continue;
if (page_nid != nid)
continue;
return sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj,
ret = sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj,
&mem_blk->sysdev.kobj,
kobject_name(&mem_blk->sysdev.kobj));
if (ret)
return ret;

return sysfs_create_link_nowarn(&mem_blk->sysdev.kobj,
&node_devices[nid].sysdev.kobj,
kobject_name(&node_devices[nid].sysdev.kobj));
}
/* mem section does not span the specified node */
return 0;
Expand Down Expand Up @@ -359,6 +366,8 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk)
continue;
sysfs_remove_link(&node_devices[nid].sysdev.kobj,
kobject_name(&mem_blk->sysdev.kobj));
sysfs_remove_link(&mem_blk->sysdev.kobj,
kobject_name(&node_devices[nid].sysdev.kobj));
}
return 0;
}
Expand Down

0 comments on commit bf73d51

Please sign in to comment.