@@ -13,13 +13,13 @@ What: /sys/devices/system/memory/memoryX/removable
13
13
Date: June 2008
14
14
Contact: Badari Pulavarty <
[email protected] >
15
15
Description:
16
- The file /sys/devices/system/memory/memoryX/removable
17
- indicates whether this memory block is removable or not.
18
- This is useful for a user-level agent to determine
19
- identify removable sections of the memory before attempting
20
- potentially expensive hot-remove memory operation
16
+ The file /sys/devices/system/memory/memoryX/removable is a
17
+ legacy interface used to indicated whether a memory block is
18
+ likely to be offlineable or not. Newer kernel versions return
19
+ "1" if and only if the kernel supports memory offlining.
21
20
Users: hotplug memory remove tools
22
21
http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils
22
+ lsmem/chmem part of util-linux
23
23
24
24
What: /sys/devices/system/memory/memoryX/phys_device
25
25
Date: September 2008
@@ -44,23 +44,25 @@ Date: September 2008
44
44
Contact: Badari Pulavarty <
[email protected] >
45
45
Description:
46
46
The file /sys/devices/system/memory/memoryX/state
47
- is read-write. When read, its contents show the
48
- online/offline state of the memory section. When written,
49
- root can toggle the the online/offline state of a removable
50
- memory section (see removable file description above)
51
- using the following commands::
47
+ is read-write. When read, it returns the online/offline
48
+ state of the memory block. When written, root can toggle
49
+ the online/offline state of a memory block using the following
50
+ commands::
52
51
53
52
# echo online > /sys/devices/system/memory/memoryX/state
54
53
# echo offline > /sys/devices/system/memory/memoryX/state
55
54
56
- For example, if /sys/devices/system/memory/memory22/removable
57
- contains a value of 1 and
58
- /sys/devices/system/memory/memory22/state contains the
59
- string "online" the following command can be executed by
60
- by root to offline that section::
61
-
62
- # echo offline > /sys/devices/system/memory/memory22/state
63
-
55
+ On newer kernel versions, advanced states can be specified
56
+ when onlining to select a target zone: "online_movable"
57
+ selects the movable zone. "online_kernel" selects the
58
+ applicable kernel zone (DMA, DMA32, or Normal). However,
59
+ after successfully setting one of the advanced states,
60
+ reading the file will return "online"; the zone information
61
+ can be obtained via "valid_zones" instead.
62
+
63
+ While onlining is unlikely to fail, there are no guarantees
64
+ that offlining will succeed. Offlining is more likely to
65
+ succeed if "valid_zones" indicates "Movable".
64
66
Users: hotplug memory remove tools
65
67
http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils
66
68
@@ -70,8 +72,19 @@ Date: July 2014
70
72
Contact: Zhang Zhen <
[email protected] >
71
73
Description:
72
74
The file /sys/devices/system/memory/memoryX/valid_zones is
73
- read-only and is designed to show which zone this memory
74
- block can be onlined to.
75
+ read-only.
76
+
77
+ For online memory blocks, it returns in which zone memory
78
+ provided by a memory block is managed. If multiple zones
79
+ apply (not applicable for hotplugged memory), "None" is returned
80
+ and the memory block cannot be offlined.
81
+
82
+ For offline memory blocks, it returns by which zone memory
83
+ provided by a memory block can be managed when onlining.
84
+ The first returned zone ("default") will be used when setting
85
+ the state of an offline memory block to "online". Only one of
86
+ the kernel zones (DMA, DMA32, Normal) is applicable for a single
87
+ memory block.
75
88
76
89
What: /sys/devices/system/memoryX/nodeY
77
90
Date: October 2009
0 commit comments