xref: /linux/Documentation/ABI/testing/sysfs-devices-memory (revision a89107c0478137115c6647aa28caef75513b9f40)
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:
16*a89107c0SDavid Hildenbrand		The file /sys/devices/system/memory/memoryX/removable is a
17*a89107c0SDavid Hildenbrand		legacy interface used to indicated whether a memory block is
18*a89107c0SDavid Hildenbrand		likely to be offlineable or not.  Newer kernel versions return
19*a89107c0SDavid 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
22*a89107c0SDavid 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
47*a89107c0SDavid Hildenbrand		is read-write.  When read, it returns the online/offline
48*a89107c0SDavid Hildenbrand		state of the memory block.  When written, root can toggle
49*a89107c0SDavid Hildenbrand		the online/offline state of a memory block using the following
50*a89107c0SDavid 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
55*a89107c0SDavid Hildenbrand		On newer kernel versions, advanced states can be specified
56*a89107c0SDavid Hildenbrand		when onlining to select a target zone: "online_movable"
57*a89107c0SDavid Hildenbrand		selects the movable zone.  "online_kernel" selects the
58*a89107c0SDavid Hildenbrand		applicable kernel zone (DMA, DMA32, or Normal).  However,
59*a89107c0SDavid Hildenbrand		after successfully setting one of the advanced states,
60*a89107c0SDavid Hildenbrand		reading the file will return "online"; the zone information
61*a89107c0SDavid Hildenbrand		can be obtained via "valid_zones" instead.
6254a19b4dSMauro Carvalho Chehab
63*a89107c0SDavid Hildenbrand		While onlining is unlikely to fail, there are no guarantees
64*a89107c0SDavid Hildenbrand		that offlining will succeed.  Offlining is more likely to
65*a89107c0SDavid 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
75*a89107c0SDavid Hildenbrand		read-only.
76*a89107c0SDavid Hildenbrand
77*a89107c0SDavid Hildenbrand		For online memory blocks, it returns in which zone memory
78*a89107c0SDavid Hildenbrand		provided by a memory block is managed.  If multiple zones
79*a89107c0SDavid Hildenbrand		apply (not applicable for hotplugged memory), "None" is returned
80*a89107c0SDavid Hildenbrand		and the memory block cannot be offlined.
81*a89107c0SDavid Hildenbrand
82*a89107c0SDavid Hildenbrand		For offline memory blocks, it returns by which zone memory
83*a89107c0SDavid Hildenbrand		provided by a memory block can be managed when onlining.
84*a89107c0SDavid Hildenbrand		The first returned zone ("default") will be used when setting
85*a89107c0SDavid Hildenbrand		the state of an offline memory block to "online".  Only one of
86*a89107c0SDavid Hildenbrand		the kernel zones (DMA, DMA32, Normal) is applicable for a single
87*a89107c0SDavid 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
113