xref: /linux/Documentation/ABI/testing/sysfs-devices-memory (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
15c755e9fSBadari PulavartyWhat:		/sys/devices/system/memory
25c755e9fSBadari PulavartyDate:		June 2008
35c755e9fSBadari PulavartyContact:	Badari Pulavarty <pbadari@us.ibm.com>
45c755e9fSBadari PulavartyDescription:
55c755e9fSBadari Pulavarty		The /sys/devices/system/memory contains a snapshot of the
65c755e9fSBadari Pulavarty		internal state of the kernel memory blocks. Files could be
75c755e9fSBadari Pulavarty		added or removed dynamically to represent hot-add/remove
85c755e9fSBadari Pulavarty		operations.
95c755e9fSBadari PulavartyUsers:		hotplug memory add/remove tools
100ea6e611SJustin P. Mattock		http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils
115c755e9fSBadari Pulavarty
125c755e9fSBadari PulavartyWhat:		/sys/devices/system/memory/memoryX/removable
135c755e9fSBadari PulavartyDate:		June 2008
145c755e9fSBadari PulavartyContact:	Badari Pulavarty <pbadari@us.ibm.com>
155c755e9fSBadari PulavartyDescription:
16a89107c0SDavid Hildenbrand		The file /sys/devices/system/memory/memoryX/removable is a
17a89107c0SDavid Hildenbrand		legacy interface used to indicated whether a memory block is
18a89107c0SDavid Hildenbrand		likely to be offlineable or not.  Newer kernel versions return
19a89107c0SDavid Hildenbrand		"1" if and only if the kernel supports memory offlining.
205c755e9fSBadari PulavartyUsers:		hotplug memory remove tools
210ea6e611SJustin P. Mattock		http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils
22a89107c0SDavid Hildenbrand		lsmem/chmem part of util-linux
23c04fc586SGary Hade
24c04fc586SGary HadeWhat:		/sys/devices/system/memory/memoryX/phys_device
25c04fc586SGary HadeDate:		September 2008
26c04fc586SGary HadeContact:	Badari Pulavarty <pbadari@us.ibm.com>
27c04fc586SGary HadeDescription:
28c04fc586SGary Hade		The file /sys/devices/system/memory/memoryX/phys_device
29e9a2e48eSDavid Hildenbrand		is read-only;  it is a legacy interface only ever used on s390x
30e9a2e48eSDavid Hildenbrand		to expose the covered storage increment.
31e9a2e48eSDavid HildenbrandUsers:		Legacy s390-tools lsmem/chmem
32c04fc586SGary Hade
33c04fc586SGary HadeWhat:		/sys/devices/system/memory/memoryX/phys_index
34c04fc586SGary HadeDate:		September 2008
35c04fc586SGary HadeContact:	Badari Pulavarty <pbadari@us.ibm.com>
36c04fc586SGary HadeDescription:
37c04fc586SGary Hade		The file /sys/devices/system/memory/memoryX/phys_index
38c04fc586SGary Hade		is read-only and contains the section ID in hexadecimal
39c04fc586SGary Hade		which is equivalent to decimal X contained in the
40c04fc586SGary Hade		memory section directory name.
41c04fc586SGary Hade
42c04fc586SGary HadeWhat:		/sys/devices/system/memory/memoryX/state
43c04fc586SGary HadeDate:		September 2008
44c04fc586SGary HadeContact:	Badari Pulavarty <pbadari@us.ibm.com>
45c04fc586SGary HadeDescription:
46c04fc586SGary Hade		The file /sys/devices/system/memory/memoryX/state
47a89107c0SDavid Hildenbrand		is read-write.  When read, it returns the online/offline
48a89107c0SDavid Hildenbrand		state of the memory block.  When written, root can toggle
49a89107c0SDavid Hildenbrand		the online/offline state of a memory block using the following
50a89107c0SDavid Hildenbrand		commands::
5154a19b4dSMauro Carvalho Chehab
52c04fc586SGary Hade		  # echo online > /sys/devices/system/memory/memoryX/state
53c04fc586SGary Hade		  # echo offline > /sys/devices/system/memory/memoryX/state
54c04fc586SGary Hade
55a89107c0SDavid Hildenbrand		On newer kernel versions, advanced states can be specified
56a89107c0SDavid Hildenbrand		when onlining to select a target zone: "online_movable"
57a89107c0SDavid Hildenbrand		selects the movable zone.  "online_kernel" selects the
58a89107c0SDavid Hildenbrand		applicable kernel zone (DMA, DMA32, or Normal).  However,
59a89107c0SDavid Hildenbrand		after successfully setting one of the advanced states,
60a89107c0SDavid Hildenbrand		reading the file will return "online"; the zone information
61a89107c0SDavid Hildenbrand		can be obtained via "valid_zones" instead.
6254a19b4dSMauro Carvalho Chehab
63a89107c0SDavid Hildenbrand		While onlining is unlikely to fail, there are no guarantees
64a89107c0SDavid Hildenbrand		that offlining will succeed.  Offlining is more likely to
65a89107c0SDavid Hildenbrand		succeed if "valid_zones" indicates "Movable".
66c04fc586SGary HadeUsers:		hotplug memory remove tools
670ea6e611SJustin P. Mattock		http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils
68c04fc586SGary Hade
69dee5d0d5SAlex Chiang
70ed2f2400SZhang ZhenWhat:           /sys/devices/system/memory/memoryX/valid_zones
71ed2f2400SZhang ZhenDate:           July 2014
72ed2f2400SZhang ZhenContact:	Zhang Zhen <zhenzhang.zhang@huawei.com>
73ed2f2400SZhang ZhenDescription:
74ed2f2400SZhang Zhen		The file /sys/devices/system/memory/memoryX/valid_zones	is
75a89107c0SDavid Hildenbrand		read-only.
76a89107c0SDavid Hildenbrand
77a89107c0SDavid Hildenbrand		For online memory blocks, it returns in which zone memory
78a89107c0SDavid Hildenbrand		provided by a memory block is managed.  If multiple zones
79a89107c0SDavid Hildenbrand		apply (not applicable for hotplugged memory), "None" is returned
80a89107c0SDavid Hildenbrand		and the memory block cannot be offlined.
81a89107c0SDavid Hildenbrand
82a89107c0SDavid Hildenbrand		For offline memory blocks, it returns by which zone memory
83a89107c0SDavid Hildenbrand		provided by a memory block can be managed when onlining.
84a89107c0SDavid Hildenbrand		The first returned zone ("default") will be used when setting
85a89107c0SDavid Hildenbrand		the state of an offline memory block to "online".  Only one of
86a89107c0SDavid Hildenbrand		the kernel zones (DMA, DMA32, Normal) is applicable for a single
87a89107c0SDavid Hildenbrand		memory block.
88ed2f2400SZhang Zhen
89dee5d0d5SAlex ChiangWhat:		/sys/devices/system/memoryX/nodeY
90dee5d0d5SAlex ChiangDate:		October 2009
91dee5d0d5SAlex ChiangContact:	Linux Memory Management list <linux-mm@kvack.org>
92dee5d0d5SAlex ChiangDescription:
93dee5d0d5SAlex Chiang		When CONFIG_NUMA is enabled, a symbolic link that
94dee5d0d5SAlex Chiang		points to the corresponding NUMA node directory.
95dee5d0d5SAlex Chiang
96dee5d0d5SAlex Chiang		For example, the following symbolic link is created for
97dee5d0d5SAlex Chiang		memory section 9 on node0:
9854a19b4dSMauro Carvalho Chehab
99dee5d0d5SAlex Chiang		/sys/devices/system/memory/memory9/node0 -> ../../node/node0
100dee5d0d5SAlex Chiang
101dee5d0d5SAlex Chiang
102c04fc586SGary HadeWhat:		/sys/devices/system/node/nodeX/memoryY
103c04fc586SGary HadeDate:		September 2008
104c04fc586SGary HadeContact:	Gary Hade <garyhade@us.ibm.com>
105c04fc586SGary HadeDescription:
106c04fc586SGary Hade		When CONFIG_NUMA is enabled
107c04fc586SGary Hade		/sys/devices/system/node/nodeX/memoryY is a symbolic link that
108c04fc586SGary Hade		points to the corresponding /sys/devices/system/memory/memoryY
109c04fc586SGary Hade		memory section directory.  For example, the following symbolic
110c04fc586SGary Hade		link is created for memory section 9 on node0.
11154a19b4dSMauro Carvalho Chehab
112c04fc586SGary Hade		/sys/devices/system/node/node0/memory9 -> ../../memory/memory9
11388a6f899SEric DeVolder
11488a6f899SEric DeVolderWhat:		/sys/devices/system/memory/crash_hotplug
11588a6f899SEric DeVolderDate:		Aug 2023
11688a6f899SEric DeVolderContact:	Linux kernel mailing list <linux-kernel@vger.kernel.org>
11788a6f899SEric DeVolderDescription:
118*c91c6062SSourabh Jain		(RO) indicates whether or not the kernel updates relevant kexec
119*c91c6062SSourabh Jain		segments on memory hot un/plug and/or on/offline events, avoiding the
120*c91c6062SSourabh Jain		need to reload kdump kernel.
121