diff options
author | Badari Pulavarty <pbadari@us.ibm.com> | 2008-07-24 00:28:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:21 -0400 |
commit | 5c755e9fd813810680abd56ec09a5f90143e815b (patch) | |
tree | 1686c0666f6bd630441957a53c546d90b0f61723 /Documentation/ABI | |
parent | 2f7f24eca31c4fc2fdb134b2ef743ccd67cfb9a9 (diff) |
memory-hotplug: add sysfs removable attribute for hotplug memory remove
Memory may be hot-removed on a per-memory-block basis, particularly on
POWER where the SPARSEMEM section size often matches the memory-block
size. A user-level agent must be able to identify which sections of
memory are likely to be removable before attempting the potentially
expensive operation. This patch adds a file called "removable" to the
memory directory in sysfs to help such an agent. In this patch, a memory
block is considered removable if;
o It contains only MOVABLE pageblocks
o It contains only pageblocks with free pages regardless of pageblock type
On the other hand, a memory block starting with a PageReserved() page will
never be considered removable. Without this patch, the user-agent is
forced to choose a memory block to remove randomly.
Sample output of the sysfs files:
./memory/memory0/removable: 0
./memory/memory1/removable: 0
./memory/memory2/removable: 0
./memory/memory3/removable: 0
./memory/memory4/removable: 0
./memory/memory5/removable: 0
./memory/memory6/removable: 0
./memory/memory7/removable: 1
./memory/memory8/removable: 0
./memory/memory9/removable: 0
./memory/memory10/removable: 0
./memory/memory11/removable: 0
./memory/memory12/removable: 0
./memory/memory13/removable: 0
./memory/memory14/removable: 0
./memory/memory15/removable: 0
./memory/memory16/removable: 0
./memory/memory17/removable: 1
./memory/memory18/removable: 1
./memory/memory19/removable: 1
./memory/memory20/removable: 1
./memory/memory21/removable: 1
./memory/memory22/removable: 1
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/ABI')
-rw-r--r-- | Documentation/ABI/testing/sysfs-devices-memory | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory new file mode 100644 index 000000000000..7a16fe1e2270 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-memory | |||
@@ -0,0 +1,24 @@ | |||
1 | What: /sys/devices/system/memory | ||
2 | Date: June 2008 | ||
3 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
4 | Description: | ||
5 | The /sys/devices/system/memory contains a snapshot of the | ||
6 | internal state of the kernel memory blocks. Files could be | ||
7 | added or removed dynamically to represent hot-add/remove | ||
8 | operations. | ||
9 | |||
10 | Users: hotplug memory add/remove tools | ||
11 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | ||
12 | |||
13 | What: /sys/devices/system/memory/memoryX/removable | ||
14 | Date: June 2008 | ||
15 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
16 | Description: | ||
17 | The file /sys/devices/system/memory/memoryX/removable | ||
18 | indicates whether this memory block is removable or not. | ||
19 | This is useful for a user-level agent to determine | ||
20 | identify removable sections of the memory before attempting | ||
21 | potentially expensive hot-remove memory operation | ||
22 | |||
23 | Users: hotplug memory remove tools | ||
24 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | ||