Adding memory

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest

You can add memory to your Linux® instance by setting unused memory blocks online.

Procedure

  • Use the chmem command with the -e parameter to set memory online.
    You can specify the amount of memory you want to add with the command without specifying particular memory blocks. If there are enough eligible memory blocks to satisfy your request, the tool finds them for you and sets the most suitable blocks online.
  • Alternatively, you can write online to the sysfs state attribute of an unused memory block.
    Issue a command of the form:
    # echo online_value > /sys/devices/system/memory/memory<n>/state
    where online_value is one of:
    online
    sets the memory block online to the default zone. The default zone is the first zone listed in the valid_zones sysfs attribute.
    online_movable
    sets the memory block online to the Movable zone. Setting the block online fails if the Movable zone is not listed in the valid_zones sysfs attribute.
    online_kernel
    sets the memory block online to the first non-Movable zone listed in the valid_zones directory. Setting the block online fails if the Movable zone is the only zone listed in the valid_zones sysfs attribute.
    <n> is an integer that identifies the memory unit.

Results

Adding the memory block fails if the memory block is already in use. The state attribute changes to online when the memory block has been added successfully.