162306a36Sopenharmony_ciWhat: /sys/devices/system/memory 262306a36Sopenharmony_ciDate: June 2008 362306a36Sopenharmony_ciContact: Badari Pulavarty <pbadari@us.ibm.com> 462306a36Sopenharmony_ciDescription: 562306a36Sopenharmony_ci The /sys/devices/system/memory contains a snapshot of the 662306a36Sopenharmony_ci internal state of the kernel memory blocks. Files could be 762306a36Sopenharmony_ci added or removed dynamically to represent hot-add/remove 862306a36Sopenharmony_ci operations. 962306a36Sopenharmony_ciUsers: hotplug memory add/remove tools 1062306a36Sopenharmony_ci http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ciWhat: /sys/devices/system/memory/memoryX/removable 1362306a36Sopenharmony_ciDate: June 2008 1462306a36Sopenharmony_ciContact: Badari Pulavarty <pbadari@us.ibm.com> 1562306a36Sopenharmony_ciDescription: 1662306a36Sopenharmony_ci The file /sys/devices/system/memory/memoryX/removable is a 1762306a36Sopenharmony_ci legacy interface used to indicated whether a memory block is 1862306a36Sopenharmony_ci likely to be offlineable or not. Newer kernel versions return 1962306a36Sopenharmony_ci "1" if and only if the kernel supports memory offlining. 2062306a36Sopenharmony_ciUsers: hotplug memory remove tools 2162306a36Sopenharmony_ci http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils 2262306a36Sopenharmony_ci lsmem/chmem part of util-linux 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ciWhat: /sys/devices/system/memory/memoryX/phys_device 2562306a36Sopenharmony_ciDate: September 2008 2662306a36Sopenharmony_ciContact: Badari Pulavarty <pbadari@us.ibm.com> 2762306a36Sopenharmony_ciDescription: 2862306a36Sopenharmony_ci The file /sys/devices/system/memory/memoryX/phys_device 2962306a36Sopenharmony_ci is read-only; it is a legacy interface only ever used on s390x 3062306a36Sopenharmony_ci to expose the covered storage increment. 3162306a36Sopenharmony_ciUsers: Legacy s390-tools lsmem/chmem 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ciWhat: /sys/devices/system/memory/memoryX/phys_index 3462306a36Sopenharmony_ciDate: September 2008 3562306a36Sopenharmony_ciContact: Badari Pulavarty <pbadari@us.ibm.com> 3662306a36Sopenharmony_ciDescription: 3762306a36Sopenharmony_ci The file /sys/devices/system/memory/memoryX/phys_index 3862306a36Sopenharmony_ci is read-only and contains the section ID in hexadecimal 3962306a36Sopenharmony_ci which is equivalent to decimal X contained in the 4062306a36Sopenharmony_ci memory section directory name. 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ciWhat: /sys/devices/system/memory/memoryX/state 4362306a36Sopenharmony_ciDate: September 2008 4462306a36Sopenharmony_ciContact: Badari Pulavarty <pbadari@us.ibm.com> 4562306a36Sopenharmony_ciDescription: 4662306a36Sopenharmony_ci The file /sys/devices/system/memory/memoryX/state 4762306a36Sopenharmony_ci is read-write. When read, it returns the online/offline 4862306a36Sopenharmony_ci state of the memory block. When written, root can toggle 4962306a36Sopenharmony_ci the online/offline state of a memory block using the following 5062306a36Sopenharmony_ci commands:: 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci # echo online > /sys/devices/system/memory/memoryX/state 5362306a36Sopenharmony_ci # echo offline > /sys/devices/system/memory/memoryX/state 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ci On newer kernel versions, advanced states can be specified 5662306a36Sopenharmony_ci when onlining to select a target zone: "online_movable" 5762306a36Sopenharmony_ci selects the movable zone. "online_kernel" selects the 5862306a36Sopenharmony_ci applicable kernel zone (DMA, DMA32, or Normal). However, 5962306a36Sopenharmony_ci after successfully setting one of the advanced states, 6062306a36Sopenharmony_ci reading the file will return "online"; the zone information 6162306a36Sopenharmony_ci can be obtained via "valid_zones" instead. 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ci While onlining is unlikely to fail, there are no guarantees 6462306a36Sopenharmony_ci that offlining will succeed. Offlining is more likely to 6562306a36Sopenharmony_ci succeed if "valid_zones" indicates "Movable". 6662306a36Sopenharmony_ciUsers: hotplug memory remove tools 6762306a36Sopenharmony_ci http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ciWhat: /sys/devices/system/memory/memoryX/valid_zones 7162306a36Sopenharmony_ciDate: July 2014 7262306a36Sopenharmony_ciContact: Zhang Zhen <zhenzhang.zhang@huawei.com> 7362306a36Sopenharmony_ciDescription: 7462306a36Sopenharmony_ci The file /sys/devices/system/memory/memoryX/valid_zones is 7562306a36Sopenharmony_ci read-only. 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ci For online memory blocks, it returns in which zone memory 7862306a36Sopenharmony_ci provided by a memory block is managed. If multiple zones 7962306a36Sopenharmony_ci apply (not applicable for hotplugged memory), "None" is returned 8062306a36Sopenharmony_ci and the memory block cannot be offlined. 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci For offline memory blocks, it returns by which zone memory 8362306a36Sopenharmony_ci provided by a memory block can be managed when onlining. 8462306a36Sopenharmony_ci The first returned zone ("default") will be used when setting 8562306a36Sopenharmony_ci the state of an offline memory block to "online". Only one of 8662306a36Sopenharmony_ci the kernel zones (DMA, DMA32, Normal) is applicable for a single 8762306a36Sopenharmony_ci memory block. 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ciWhat: /sys/devices/system/memoryX/nodeY 9062306a36Sopenharmony_ciDate: October 2009 9162306a36Sopenharmony_ciContact: Linux Memory Management list <linux-mm@kvack.org> 9262306a36Sopenharmony_ciDescription: 9362306a36Sopenharmony_ci When CONFIG_NUMA is enabled, a symbolic link that 9462306a36Sopenharmony_ci points to the corresponding NUMA node directory. 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci For example, the following symbolic link is created for 9762306a36Sopenharmony_ci memory section 9 on node0: 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci /sys/devices/system/memory/memory9/node0 -> ../../node/node0 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ciWhat: /sys/devices/system/node/nodeX/memoryY 10362306a36Sopenharmony_ciDate: September 2008 10462306a36Sopenharmony_ciContact: Gary Hade <garyhade@us.ibm.com> 10562306a36Sopenharmony_ciDescription: 10662306a36Sopenharmony_ci When CONFIG_NUMA is enabled 10762306a36Sopenharmony_ci /sys/devices/system/node/nodeX/memoryY is a symbolic link that 10862306a36Sopenharmony_ci points to the corresponding /sys/devices/system/memory/memoryY 10962306a36Sopenharmony_ci memory section directory. For example, the following symbolic 11062306a36Sopenharmony_ci link is created for memory section 9 on node0. 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ciWhat: /sys/devices/system/memory/crash_hotplug 11562306a36Sopenharmony_ciDate: Aug 2023 11662306a36Sopenharmony_ciContact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 11762306a36Sopenharmony_ciDescription: 11862306a36Sopenharmony_ci (RO) indicates whether or not the kernel directly supports 11962306a36Sopenharmony_ci modifying the crash elfcorehdr for memory hot un/plug and/or 12062306a36Sopenharmony_ci on/offline changes. 121