Finding out the memory block size

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest

On an IBM Z® mainframe, memory is provided to Linux® as memory blocks of equal size.

Procedure

  • Use the lsmem command to find out the size of your memory blocks.
    Example:
    # lsmem
    Address range                          Size (MB)  State    Removable  Device
    ===============================================================================
    0x0000000000000000-0x000000000fffffff        256  online   no         0
    0x0000000010000000-0x000000002fffffff        512  online   yes        1-2
    0x0000000030000000-0x000000003fffffff        256  online   no         3
    0x0000000040000000-0x000000006fffffff        768  online   yes        4-6
    0x0000000070000000-0x00000000ffffffff       2304  offline  -          7-15
    
    Memory device size  : 256 MB
    Memory block size   : 256 MB
    Total online memory : 1792 MB
    Total offline memory: 2304 MB
    In the example, the block size is 256 MB.
  • Alternatively, you can read /sys/devices/system/memory/block_size_bytes. This sysfs attribute contains the block size in byte in hexadecimal notation.
    Example:
    # cat /sys/devices/system/memory/block_size_bytes
    10000000

    This hexadecimal value corresponds to 256 MB.