diff options
author | Gary Hade <garyhade@us.ibm.com> | 2009-01-06 17:39:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:00 -0500 |
commit | c04fc586c1a480ba198f03ae7b6cbd7b57380b91 (patch) | |
tree | 9d6544a3b62cc01dbcbb1e315b84378b45ba86d2 /Documentation | |
parent | ee53a891f47444c53318b98dac947ede963db400 (diff) |
mm: show node to memory section relationship with symlinks in sysfs
Show node to memory section relationship with symlinks in sysfs
Add /sys/devices/system/node/nodeX/memoryY symlinks for all
the memory sections located on nodeX. For example:
/sys/devices/system/node/node1/memory135 -> ../../memory/memory135
indicates that memory section 135 resides on node1.
Also revises documentation to cover this change as well as updating
Documentation/ABI/testing/sysfs-devices-memory to include descriptions
of memory hotremove files 'phys_device', 'phys_index', and 'state'
that were previously not described there.
In addition to it always being a good policy to provide users with
the maximum possible amount of physical location information for
resources that can be hot-added and/or hot-removed, the following
are some (but likely not all) of the user benefits provided by
this change.
Immediate:
- Provides information needed to determine the specific node
on which a defective DIMM is located. This will reduce system
downtime when the node or defective DIMM is swapped out.
- Prevents unintended onlining of a memory section that was
previously offlined due to a defective DIMM. This could happen
during node hot-add when the user or node hot-add assist script
onlines _all_ offlined sections due to user or script inability
to identify the specific memory sections located on the hot-added
node. The consequences of reintroducing the defective memory
could be ugly.
- Provides information needed to vary the amount and distribution
of memory on specific nodes for testing or debugging purposes.
Future:
- Will provide information needed to identify the memory
sections that need to be offlined prior to physical removal
of a specific node.
Symlink creation during boot was tested on 2-node x86_64, 2-node
ppc64, and 2-node ia64 systems. Symlink creation during physical
memory hot-add tested on a 2-node x86_64 system.
Signed-off-by: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/sysfs-devices-memory | 51 | ||||
-rw-r--r-- | Documentation/memory-hotplug.txt | 16 |
2 files changed, 63 insertions, 4 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory index 7a16fe1e2270..9fe91c02ee40 100644 --- a/Documentation/ABI/testing/sysfs-devices-memory +++ b/Documentation/ABI/testing/sysfs-devices-memory | |||
@@ -6,7 +6,6 @@ Description: | |||
6 | internal state of the kernel memory blocks. Files could be | 6 | internal state of the kernel memory blocks. Files could be |
7 | added or removed dynamically to represent hot-add/remove | 7 | added or removed dynamically to represent hot-add/remove |
8 | operations. | 8 | operations. |
9 | |||
10 | Users: hotplug memory add/remove tools | 9 | Users: hotplug memory add/remove tools |
11 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | 10 | https://w3.opensource.ibm.com/projects/powerpc-utils/ |
12 | 11 | ||
@@ -19,6 +18,56 @@ Description: | |||
19 | This is useful for a user-level agent to determine | 18 | This is useful for a user-level agent to determine |
20 | identify removable sections of the memory before attempting | 19 | identify removable sections of the memory before attempting |
21 | potentially expensive hot-remove memory operation | 20 | potentially expensive hot-remove memory operation |
21 | Users: hotplug memory remove tools | ||
22 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | ||
23 | |||
24 | What: /sys/devices/system/memory/memoryX/phys_device | ||
25 | Date: September 2008 | ||
26 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
27 | Description: | ||
28 | The file /sys/devices/system/memory/memoryX/phys_device | ||
29 | is read-only and is designed to show the name of physical | ||
30 | memory device. Implementation is currently incomplete. | ||
22 | 31 | ||
32 | What: /sys/devices/system/memory/memoryX/phys_index | ||
33 | Date: September 2008 | ||
34 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
35 | Description: | ||
36 | The file /sys/devices/system/memory/memoryX/phys_index | ||
37 | is read-only and contains the section ID in hexadecimal | ||
38 | which is equivalent to decimal X contained in the | ||
39 | memory section directory name. | ||
40 | |||
41 | What: /sys/devices/system/memory/memoryX/state | ||
42 | Date: September 2008 | ||
43 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
44 | Description: | ||
45 | The file /sys/devices/system/memory/memoryX/state | ||
46 | is read-write. When read, it's contents show the | ||
47 | online/offline state of the memory section. When written, | ||
48 | root can toggle the the online/offline state of a removable | ||
49 | memory section (see removable file description above) | ||
50 | using the following commands. | ||
51 | # echo online > /sys/devices/system/memory/memoryX/state | ||
52 | # echo offline > /sys/devices/system/memory/memoryX/state | ||
53 | |||
54 | For example, if /sys/devices/system/memory/memory22/removable | ||
55 | contains a value of 1 and | ||
56 | /sys/devices/system/memory/memory22/state contains the | ||
57 | string "online" the following command can be executed by | ||
58 | by root to offline that section. | ||
59 | # echo offline > /sys/devices/system/memory/memory22/state | ||
23 | Users: hotplug memory remove tools | 60 | Users: hotplug memory remove tools |
24 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | 61 | https://w3.opensource.ibm.com/projects/powerpc-utils/ |
62 | |||
63 | What: /sys/devices/system/node/nodeX/memoryY | ||
64 | Date: September 2008 | ||
65 | Contact: Gary Hade <garyhade@us.ibm.com> | ||
66 | Description: | ||
67 | When CONFIG_NUMA is enabled | ||
68 | /sys/devices/system/node/nodeX/memoryY is a symbolic link that | ||
69 | points to the corresponding /sys/devices/system/memory/memoryY | ||
70 | memory section directory. For example, the following symbolic | ||
71 | link is created for memory section 9 on node0. | ||
72 | /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 | ||
73 | |||
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt index 168117bd6ee8..4c2ecf537a4a 100644 --- a/Documentation/memory-hotplug.txt +++ b/Documentation/memory-hotplug.txt | |||
@@ -124,7 +124,7 @@ config options. | |||
124 | This option can be kernel module too. | 124 | This option can be kernel module too. |
125 | 125 | ||
126 | -------------------------------- | 126 | -------------------------------- |
127 | 3 sysfs files for memory hotplug | 127 | 4 sysfs files for memory hotplug |
128 | -------------------------------- | 128 | -------------------------------- |
129 | All sections have their device information under /sys/devices/system/memory as | 129 | All sections have their device information under /sys/devices/system/memory as |
130 | 130 | ||
@@ -138,11 +138,12 @@ For example, assume 1GiB section size. A device for a memory starting at | |||
138 | (0x100000000 / 1Gib = 4) | 138 | (0x100000000 / 1Gib = 4) |
139 | This device covers address range [0x100000000 ... 0x140000000) | 139 | This device covers address range [0x100000000 ... 0x140000000) |
140 | 140 | ||
141 | Under each section, you can see 3 files. | 141 | Under each section, you can see 4 files. |
142 | 142 | ||
143 | /sys/devices/system/memory/memoryXXX/phys_index | 143 | /sys/devices/system/memory/memoryXXX/phys_index |
144 | /sys/devices/system/memory/memoryXXX/phys_device | 144 | /sys/devices/system/memory/memoryXXX/phys_device |
145 | /sys/devices/system/memory/memoryXXX/state | 145 | /sys/devices/system/memory/memoryXXX/state |
146 | /sys/devices/system/memory/memoryXXX/removable | ||
146 | 147 | ||
147 | 'phys_index' : read-only and contains section id, same as XXX. | 148 | 'phys_index' : read-only and contains section id, same as XXX. |
148 | 'state' : read-write | 149 | 'state' : read-write |
@@ -150,10 +151,20 @@ Under each section, you can see 3 files. | |||
150 | at write: user can specify "online", "offline" command | 151 | at write: user can specify "online", "offline" command |
151 | 'phys_device': read-only: designed to show the name of physical memory device. | 152 | 'phys_device': read-only: designed to show the name of physical memory device. |
152 | This is not well implemented now. | 153 | This is not well implemented now. |
154 | 'removable' : read-only: contains an integer value indicating | ||
155 | whether the memory section is removable or not | ||
156 | removable. A value of 1 indicates that the memory | ||
157 | section is removable and a value of 0 indicates that | ||
158 | it is not removable. | ||
153 | 159 | ||
154 | NOTE: | 160 | NOTE: |
155 | These directories/files appear after physical memory hotplug phase. | 161 | These directories/files appear after physical memory hotplug phase. |
156 | 162 | ||
163 | If CONFIG_NUMA is enabled the | ||
164 | /sys/devices/system/memory/memoryXXX memory section | ||
165 | directories can also be accessed via symbolic links located in | ||
166 | the /sys/devices/system/node/node* directories. For example: | ||
167 | /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 | ||
157 | 168 | ||
158 | -------------------------------- | 169 | -------------------------------- |
159 | 4. Physical memory hot-add phase | 170 | 4. Physical memory hot-add phase |
@@ -365,7 +376,6 @@ node if necessary. | |||
365 | - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like | 376 | - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like |
366 | sysctl or new control file. | 377 | sysctl or new control file. |
367 | - showing memory section and physical device relationship. | 378 | - showing memory section and physical device relationship. |
368 | - showing memory section and node relationship (maybe good for NUMA) | ||
369 | - showing memory section is under ZONE_MOVABLE or not | 379 | - showing memory section is under ZONE_MOVABLE or not |
370 | - test and make it better memory offlining. | 380 | - test and make it better memory offlining. |
371 | - support HugeTLB page migration and offlining. | 381 | - support HugeTLB page migration and offlining. |