forked from analogdevicesinc/linux
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation: sysfs/memory: clarify some memory block device properties
In commit 53cdc1c ("drivers/base/memory.c: indicate all memory blocks as removable") we changed the output of the "removable" property of memory devices to return "1" if and only if the kernel supports memory offlining. Let's update documentation, stating that the interface is legacy. Also update documentation of the "state" property and "valid_zones" properties. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: David Hildenbrand <[email protected]> Acked-by: Michal Hocko <[email protected]> Reviewed-by: Oscar Salvador <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: Ilya Dryomov <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
1 parent
e9a2e48
commit a89107c
Showing
2 changed files
with
41 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,13 @@ What: /sys/devices/system/memory/memoryX/removable | |
Date: June 2008 | ||
Contact: Badari Pulavarty <[email protected]> | ||
Description: | ||
The file /sys/devices/system/memory/memoryX/removable | ||
indicates whether this memory block is removable or not. | ||
This is useful for a user-level agent to determine | ||
identify removable sections of the memory before attempting | ||
potentially expensive hot-remove memory operation | ||
The file /sys/devices/system/memory/memoryX/removable is a | ||
legacy interface used to indicated whether a memory block is | ||
likely to be offlineable or not. Newer kernel versions return | ||
"1" if and only if the kernel supports memory offlining. | ||
Users: hotplug memory remove tools | ||
http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils | ||
lsmem/chmem part of util-linux | ||
|
||
What: /sys/devices/system/memory/memoryX/phys_device | ||
Date: September 2008 | ||
|
@@ -44,23 +44,25 @@ Date: September 2008 | |
Contact: Badari Pulavarty <[email protected]> | ||
Description: | ||
The file /sys/devices/system/memory/memoryX/state | ||
is read-write. When read, its contents show the | ||
online/offline state of the memory section. When written, | ||
root can toggle the the online/offline state of a removable | ||
memory section (see removable file description above) | ||
using the following commands:: | ||
is read-write. When read, it returns the online/offline | ||
state of the memory block. When written, root can toggle | ||
the online/offline state of a memory block using the following | ||
commands:: | ||
|
||
# echo online > /sys/devices/system/memory/memoryX/state | ||
# echo offline > /sys/devices/system/memory/memoryX/state | ||
|
||
For example, if /sys/devices/system/memory/memory22/removable | ||
contains a value of 1 and | ||
/sys/devices/system/memory/memory22/state contains the | ||
string "online" the following command can be executed by | ||
by root to offline that section:: | ||
|
||
# echo offline > /sys/devices/system/memory/memory22/state | ||
|
||
On newer kernel versions, advanced states can be specified | ||
when onlining to select a target zone: "online_movable" | ||
selects the movable zone. "online_kernel" selects the | ||
applicable kernel zone (DMA, DMA32, or Normal). However, | ||
after successfully setting one of the advanced states, | ||
reading the file will return "online"; the zone information | ||
can be obtained via "valid_zones" instead. | ||
|
||
While onlining is unlikely to fail, there are no guarantees | ||
that offlining will succeed. Offlining is more likely to | ||
succeed if "valid_zones" indicates "Movable". | ||
Users: hotplug memory remove tools | ||
http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils | ||
|
||
|
@@ -70,8 +72,19 @@ Date: July 2014 | |
Contact: Zhang Zhen <[email protected]> | ||
Description: | ||
The file /sys/devices/system/memory/memoryX/valid_zones is | ||
read-only and is designed to show which zone this memory | ||
block can be onlined to. | ||
read-only. | ||
|
||
For online memory blocks, it returns in which zone memory | ||
provided by a memory block is managed. If multiple zones | ||
apply (not applicable for hotplugged memory), "None" is returned | ||
and the memory block cannot be offlined. | ||
|
||
For offline memory blocks, it returns by which zone memory | ||
provided by a memory block can be managed when onlining. | ||
The first returned zone ("default") will be used when setting | ||
the state of an offline memory block to "online". Only one of | ||
the kernel zones (DMA, DMA32, Normal) is applicable for a single | ||
memory block. | ||
|
||
What: /sys/devices/system/memoryX/nodeY | ||
Date: October 2009 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters