21 August 2026

Cleanup LDom Memory Fragmentation

Over time after many online memory changes, the memory may become
fragmented like this example. The small blocks prevent the system 
from allocating large pages which causes degraded performance.

The fragments typically arise when you reduce memory
while the domain is running. It is recommended to reduce
memory while the guest domain is down and use start-reconf
for the control domain.

# ldm list-devices -a memory

MEMORY
    PA                   SIZE            BOUND
    0x0                  60M             _sys_
    0x3c00000            32M             _sys_
    0x5c00000            94M             _sys_
    0xba00000            1030M           _sys_
    0x4c000000           64M             _sys_
    0x50000000           2560M           primary
    0xf0000000           256M            marcel
    0x100000000          2560M           primary
    0x1a0000000          256M            marcel
    0x1b0000000          5888M           primary
    0x320000000          256M            marcel
    0x330000000          768M            primary
    0x360000000          256M            marcel
    0x370000000          3584M           primary
    0x450000000          11G             marcel
    0x710000000          15G             g0075
    0xad0000000          6G              g0095
    0xc50000000          8G              g0081
    0xe50000000          1792M
    0xec0000000          2304M           primary
    0xf50000000          2560M
    0xff0000000          128M            _sys_
    0xff8000000          64M             _sys_
    0xffc000000          64M             _sys_
    0x400000000000       2G              g0056
    0x400080000000       1G              primary
    0x4000c0000000       1G              g0056
    0x400100000000       5888M           primary
    0x400270000000       8G              g0056
    0x400470000000       8G              g0079
    0x400670000000       1G              g0056
    0x4006b0000000       8G              g0107
    0x4008b0000000       10G             g0058
    0x400b30000000       4G              g0082
    0x400c30000000       8G              s0004
    0x400e30000000       4G              g0082
    0x400f30000000       3G
    0x400ff0000000       192M            _sys_
    0x400ffc000000       64M             _sys_

Since Solaris 11.4 SRU39 the ldm command add-spconfig offers
the new -m flag to cleanup the memory configuration.

# ldm add-spconfig -m s0003m

we need to power cycle the control domain.
shutdown all guest domains.

For users of JomaSoft VDCF you can use
gdom -c shutdown cdom=s0003

afterwards we poweroff and poweron the control domain
to activate the new configuration.

# init 0

after the system is down at the ok prompt.

{0} ok
Serial console stopped.

-> stop /SYS
Are you sure you want to stop /SYS (y/n)? y
Stopping /SYS

-> show /SYS power_state

 /SYS
    Properties:
        power_state = Off

-> start /SYS
Are you sure you want to start /SYS (y/n)? y
Starting /SYS


this improved the memory allocation of all the domains

# ldm list-devices -a memory

MEMORY
    PA                   SIZE            BOUND
    0x0                  60M             _sys_
    0x3c00000            32M             _sys_
    0x5c00000            94M             _sys_
    0xba00000            1030M           _sys_
    0x4c000000           64M             _sys_
    0x50000000           24G             primary
    0x650000000          15G             g0075
    0xa10000000          8G              g0081
    0xc10000000          8G              g0082
    0xe10000000          6G              g0095
    0xf90000000          1536M           marcel
    0xff0000000          128M            _sys_
    0xff8000000          64M             _sys_
    0xffc000000          64M             _sys_
    0x400000000000       12G             g0056
    0x400300000000       10G             g0058
    0x400580000000       8G              g0079
    0x400780000000       8G              g0107
    0x400980000000       10752M          marcel
    0x400c20000000       8G              s0004
    0x400e20000000       7424M
    0x400ff0000000       192M            _sys_
    0x400ffc000000       64M             _sys_


No comments:

Post a Comment