About Memory Page Size Policy and Physical Memory
The pagesize-policy
property of the capped-memory
resource controls how the system selects a page size for a kernel zone.
The default kernel zone template SYSsolaris-kz
sets the pagesize-policy
property to largest-available
, which is the recommended value for best performance. This setting enables the system to select the appropriate page size to use with the kernel zone's amount of physical memory. The physical memory size must be a multiple of the page size, so the system selects the largest page size that aligns with the amount of physical memory specified for the kernel zone. Booting with pagesize-policy=largest-available
always succeeds.
For best performance, set an appropriate amount of physical memory that will enable the largest page size to be selected when pagesize-policy=largest-available
is set.
If you have enabled memory live zone reconfiguration by setting the host-compatible
property to the native
, level2
, or memlzr
value, you can specify the pagesize-policy
property to fixed
. When pagesize-policy=fixed
, you can use the pagesize
property value to specify the exact page size that you want to allocate as kernel zone memory. The minimum page size is 2 Mbytes on x86 systems and 256 Mbytes on SPARC systems. Run the pagesize -a
command to determine the available page size values on your platform.
If a kernel zone's pagesize-policy
property is cleared or not set, the kernel zone uses the lowest allowable page size required to boot on the particular hardware platform on which it is running. This page size might not be appropriate. The physical
property must be set to an amount that is a multiple of the largest page size supported, as shown in Example 2-4.
The amount of memory allocated must align perfectly with the page size being requested. Therefore, you must clear pagesize-policy
if either of the following conditions apply:
-
If the target system has a smaller page size than the source system.
-
If the source kernel zone was created in an update of Oracle Solaris 11.4 and the target is an Oracle Solaris release that does not support the
pagesize-policy
property, such as the initial release of Oracle Solaris 11.3.See Example 2-5.
Use the zonecfg
command to specify the page size policy of a kernel zone guest by setting the capped-memory:pagesize-policy
property to one of the following valid values: fixed
, largest-available
, largest-only
, and smallest-only
. The default value is largest-available
. See the solaris-kz
(7) man page.
When capped-memory:pagesize-policy=largest-available
, the operating system chooses the page size as follows:
-
Selects the largest page size whose pages are available in a sufficient amount for the kernel zone to boot
-
Ensures that the page size is aligned to the
capped-memory:physical
property value
Note that a kernel zone fails to boot if insufficient pages of the specified size are available or if the specified page size is invalid. Rather than falling back to the previous page size, the kernel zone fails to boot and issues an appropriate error message. See Kernel Zone Boot Failures.
If you specify capped-memory:pagesize-policy=fixed
, you can specify any valid page size as the value of the capped-memory:pagesize
property. Run the pagesize -a
command to determine a valid page size value for your platform. The memory page size is the page size used by the address space of the kernel zone guest, not the page size of the guest system. The capped-memory:pagesize
value is an integer with an optional scale unit (K
for kilobytes, M
for metabytes, G
for gigabytes, and T
for terabytes).
When you change the capped-memory:pagesize-policy
property, the capped-memory:pagesize
property, or both, reboot the kernel zone for the changes to take affect.
When you set the capped-memory:pagesize-policy
and capped-memory:pagesize
properties, you can update the kernel zone's memory (capped-memory:physical
) in page-size chunks specified by capped-memory:pagesize
. By specifying a smaller page size for your platform, you can increase or decrease the kernel zone's memory in a fine-grained way. The minimum memory page size for SPARC is 256 Mbytes and 2 Mbytes for x86. See Memory Live Zone Reconfiguration for Kernel Zones.
For example, you create a kernel zone with a memory size of 16 Gbytes that you might want to increase later to 20 Gbytes. If you specify capped-memory:pagesize-policy=largest-only
, the page size is set to 16 Gbytes. This page size prevents you from increasing the memory size to 20 Gbytes because 20 Gbytes is not 16-Gbyte-aligned. Instead, specify capped-memory:pagesize-policy=fixed
and specify a smaller valid page size, such as 2G
or 4G
, as the value of the capped-memory:pagesize
property. Then, you can update the capped-memory:physical
property value in page-size chunks specified by capped-memory:pagesize
. So, setting capped-memory:pagesize=2G
enables you to change the kernel zone's physical memory size in 2-Gbyte increments such as 12 Gbytes, 14 Gbytes, 18 Gbytes, 20 Gbytes, and so on.
Example 2-4 Setting Physical Memory to Use the Largest Page Size
The SPARC T5 supports various page sizes, as the following output shows. The largest is 2147483648 bytes or 2GB.
Using 2GB pagesize increments, the capped-memory:physical
property is set to 8GB. This value enables the system to use the largest page size when pagesize-policy
is set to largest-available
.
global$ pfbash pagesize -a 8192 65536 4194304 268435456 2147483648 global$ pfbash zonecfg -z kzone1 zonecfg:kzone1> select capped-memory zonecfg:kzone1:capped-memory> set physical=8G zonecfg:kzone1:capped-memory> info capped-memory: physical: 8G pagesize-policy: largest-available zonecfg:kzone1:capped-memory> end ; exit global$ reboot
Example 2-5 Clearing the pagesize-policy
Property Before Migrating a Kernel Zone to an Earlier Oracle Solaris Release
This example shows how to clear the pagesize-policy
property to prepare for migrating a kernel zone to an Oracle Solaris release that does not support the property.
global$ pfbash -z kzone1 zonecfg:kzone1> select capped-memory zonecfg:kzone1:capped-memory> clear pagesize-policy zonecfg:kzone1:capped-memory> end zonecfg:kzone1> commit global$ reboot
You can perform a trial run of the migration by using the zoneadm migrate -n
command to see if the pagesize-policy
needs to be cleared. For more information, see About the zoneadm migrate Command.
Tip:
If the kernel zone is hosting a database or other application where performance depends on using the largest page size, you might want to setpagesize-policy=largest-only
to prevent booting unless the largest page size is used.
For more information about setting the physical
and pagesize-policy
properties, see Capped Memory Guidelines for a solaris-kz Zone in Oracle Solaris Zones Configuration Resources.