Configuring a Memory Reservation Pool for Kernel Zones

An MRP is managed by the svc:/system/memory-reserve:zones service on both x86 and SPARC systems.

Use the svccfg SMF command to configure an MRP. Specify values for each of the following svc:/system/memory-reserve:zones service instance properties:

  • config/size specifies the amount of memory to reserve for the MRP.

    For example, specify a value of 64G to reserve (allocate) 64 Gbytes to the MRP.

  • config/pagesize-policy mimics the zonecfg capped-memory:pagesize-policy property where valid values are fixed, largest-available, largest-only, and smallest-only.

    The default value is largest-available. This property value interacts with any kernel zone that uses the pool.

  • config/type specifies the MRP type. The valid value for an MRP is solaris-kz, which is the default value.

  • config/lgrps specifies the locality group (LGRP) ID or IDs to use. By default, this property specifies the root LGRP (lgrp 0), which spreads the reservation across all available LGRPs. The default property value is "".

  • SPARC only. config/npt-reservation specifies the number of kernel zones that use this MRP instance simultaneously. Based on this property value, the MRP reserves npt-reservation-value x 16 Mbytes of memory.

By default, you configure a host to have a single MRP from which all kernel zones allocate memory.

On SPARC systems, configuring a kernel zone to use an MRP might require that you allocate NPT memory on a per-kernel-zone basis. This NPT memory is shared between the kernel zone virtual machine manager (ZVMM) and the SPARC hypervisor. To ensure that sufficient memory is available to make the NPT allocation for the kernel zone on a SPARC system, set the config/npt-reservation property to the number of kernel zones that use the particular MRP instance.

If an NPT memory allocation from the MRP fails, the ZVMM allocates NPT from system memory. If that allocation fails, an error message instructs you to either specify the number of kernel zones as the value to the config/npt-reservation property or to increase the value of the config/npt-reservation property for the MRP service. If a requested adjustment to the config/npt-reservation property is not possible, the kernel zone MRP service transitions to the degraded state and logs a message to the MRP service log.

When you view memory information by running the mrpstat command, the values in the TOTAL_MEM, USED_MEM, and FREE_MEM columns include the amount of NPT memory. See the mrpstat(8) man page.

The following example shows how to configure an MRP and reserve 64 Gbytes of largest-available page size of memory for use by kernel zones:

# svccfg -s svc:/system/memory-reserve:zones setprop config/size=64g
# svccfg -s svc:/system/memory-reserve:zones setprop config/pagesize-policy=largest-available
# svccfg -s svc:/system/memory-reserve:zones setprop config/type=solaris-kz
# svccfg -s svc:/system/memory-reserve:zones setprop config/lgrps=""
# svccfg -s svc:/system/memory-reserve:zones refresh
# svcadm enable svc:/system/memory-reserve:zones

The following example helps to guarantee that four SPARC kernel zones can boot and reboot during the life cycle of a kernel zone host. Set the MRP config/npt-reservation service instance property value to 4. Setting this property is in addition to setting the config/size MRP property to the cumulative memory size of the four kernel zones. Each kernel zone requires 16 Mbytes of capped memory. The MRP contains 64 Gbytes (4x16G) of memory plus the 64 Mbytes (4x16M) of NPT memory for the kernel zones.

# svccfg -s svc:/system/memory-reserve:zones setprop config/size=64G
# svccfg -s svc:/system/memory-reserve:zones setprop config/pagesize-policy=largest-available
# svccfg -s svc:/system/memory-reserve:zones setprop config/npt-reservation=4
# svccfg -s svc:/system/memory-reserve:zones refresh
# svcadm enable svc:/system/memory-reserve:zones