1*4882a593SmuzhiyunWhat: /sys/devices/system/memory 2*4882a593SmuzhiyunDate: June 2008 3*4882a593SmuzhiyunContact: Badari Pulavarty <pbadari@us.ibm.com> 4*4882a593SmuzhiyunDescription: 5*4882a593Smuzhiyun The /sys/devices/system/memory contains a snapshot of the 6*4882a593Smuzhiyun internal state of the kernel memory blocks. Files could be 7*4882a593Smuzhiyun added or removed dynamically to represent hot-add/remove 8*4882a593Smuzhiyun operations. 9*4882a593SmuzhiyunUsers: hotplug memory add/remove tools 10*4882a593Smuzhiyun http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunWhat: /sys/devices/system/memory/memoryX/removable 13*4882a593SmuzhiyunDate: June 2008 14*4882a593SmuzhiyunContact: Badari Pulavarty <pbadari@us.ibm.com> 15*4882a593SmuzhiyunDescription: 16*4882a593Smuzhiyun The file /sys/devices/system/memory/memoryX/removable 17*4882a593Smuzhiyun indicates whether this memory block is removable or not. 18*4882a593Smuzhiyun This is useful for a user-level agent to determine 19*4882a593Smuzhiyun identify removable sections of the memory before attempting 20*4882a593Smuzhiyun potentially expensive hot-remove memory operation 21*4882a593SmuzhiyunUsers: hotplug memory remove tools 22*4882a593Smuzhiyun http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils 23*4882a593Smuzhiyun 24*4882a593SmuzhiyunWhat: /sys/devices/system/memory/memoryX/phys_device 25*4882a593SmuzhiyunDate: September 2008 26*4882a593SmuzhiyunContact: Badari Pulavarty <pbadari@us.ibm.com> 27*4882a593SmuzhiyunDescription: 28*4882a593Smuzhiyun The file /sys/devices/system/memory/memoryX/phys_device 29*4882a593Smuzhiyun is read-only; it is a legacy interface only ever used on s390x 30*4882a593Smuzhiyun to expose the covered storage increment. 31*4882a593SmuzhiyunUsers: Legacy s390-tools lsmem/chmem 32*4882a593Smuzhiyun 33*4882a593SmuzhiyunWhat: /sys/devices/system/memory/memoryX/phys_index 34*4882a593SmuzhiyunDate: September 2008 35*4882a593SmuzhiyunContact: Badari Pulavarty <pbadari@us.ibm.com> 36*4882a593SmuzhiyunDescription: 37*4882a593Smuzhiyun The file /sys/devices/system/memory/memoryX/phys_index 38*4882a593Smuzhiyun is read-only and contains the section ID in hexadecimal 39*4882a593Smuzhiyun which is equivalent to decimal X contained in the 40*4882a593Smuzhiyun memory section directory name. 41*4882a593Smuzhiyun 42*4882a593SmuzhiyunWhat: /sys/devices/system/memory/memoryX/state 43*4882a593SmuzhiyunDate: September 2008 44*4882a593SmuzhiyunContact: Badari Pulavarty <pbadari@us.ibm.com> 45*4882a593SmuzhiyunDescription: 46*4882a593Smuzhiyun The file /sys/devices/system/memory/memoryX/state 47*4882a593Smuzhiyun is read-write. When read, its contents show the 48*4882a593Smuzhiyun online/offline state of the memory section. When written, 49*4882a593Smuzhiyun root can toggle the the online/offline state of a removable 50*4882a593Smuzhiyun memory section (see removable file description above) 51*4882a593Smuzhiyun using the following commands:: 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun # echo online > /sys/devices/system/memory/memoryX/state 54*4882a593Smuzhiyun # echo offline > /sys/devices/system/memory/memoryX/state 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun For example, if /sys/devices/system/memory/memory22/removable 57*4882a593Smuzhiyun contains a value of 1 and 58*4882a593Smuzhiyun /sys/devices/system/memory/memory22/state contains the 59*4882a593Smuzhiyun string "online" the following command can be executed by 60*4882a593Smuzhiyun by root to offline that section:: 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun # echo offline > /sys/devices/system/memory/memory22/state 63*4882a593Smuzhiyun 64*4882a593SmuzhiyunUsers: hotplug memory remove tools 65*4882a593Smuzhiyun http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils 66*4882a593Smuzhiyun 67*4882a593Smuzhiyun 68*4882a593SmuzhiyunWhat: /sys/devices/system/memory/memoryX/valid_zones 69*4882a593SmuzhiyunDate: July 2014 70*4882a593SmuzhiyunContact: Zhang Zhen <zhenzhang.zhang@huawei.com> 71*4882a593SmuzhiyunDescription: 72*4882a593Smuzhiyun The file /sys/devices/system/memory/memoryX/valid_zones is 73*4882a593Smuzhiyun read-only and is designed to show which zone this memory 74*4882a593Smuzhiyun block can be onlined to. 75*4882a593Smuzhiyun 76*4882a593SmuzhiyunWhat: /sys/devices/system/memoryX/nodeY 77*4882a593SmuzhiyunDate: October 2009 78*4882a593SmuzhiyunContact: Linux Memory Management list <linux-mm@kvack.org> 79*4882a593SmuzhiyunDescription: 80*4882a593Smuzhiyun When CONFIG_NUMA is enabled, a symbolic link that 81*4882a593Smuzhiyun points to the corresponding NUMA node directory. 82*4882a593Smuzhiyun 83*4882a593Smuzhiyun For example, the following symbolic link is created for 84*4882a593Smuzhiyun memory section 9 on node0: 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun /sys/devices/system/memory/memory9/node0 -> ../../node/node0 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun 89*4882a593SmuzhiyunWhat: /sys/devices/system/node/nodeX/memoryY 90*4882a593SmuzhiyunDate: September 2008 91*4882a593SmuzhiyunContact: Gary Hade <garyhade@us.ibm.com> 92*4882a593SmuzhiyunDescription: 93*4882a593Smuzhiyun When CONFIG_NUMA is enabled 94*4882a593Smuzhiyun /sys/devices/system/node/nodeX/memoryY is a symbolic link that 95*4882a593Smuzhiyun points to the corresponding /sys/devices/system/memory/memoryY 96*4882a593Smuzhiyun memory section directory. For example, the following symbolic 97*4882a593Smuzhiyun link is created for memory section 9 on node0. 98*4882a593Smuzhiyun 99*4882a593Smuzhiyun /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 100