Adding a dedicated-cpu Resource to a Kernel Zone

For best performance, configure a dedicated-cpu resource. By setting this value, you tell the kernel zone to run only on those selected CPUs. No other processes on the system can run on the CPUs that are dedicated to the kernel zone.

You can assign the CPU value in terms of available cores or processors. Use psrinfo -vp to obtain processor information about the system. For example, the following psrinfo -vp output shows that there are six available cores on the system global:

global$ psrinfo -vp
The physical processor has 6 cores and 48 virtual processors (0-47)
The core has 8 virtual processors (0-7)
The core has 8 virtual processors (8-15)
The core has 8 virtual processors (16-23)
The core has 8 virtual processors (24-31)
The core has 8 virtual processors (32-39)
The core has 8 virtual processors (40-47)
SPARC-T4 (chipid 0, clock 2998 MHz)

Note:

By default, setting dedicated-cpu:ncpus does not provide any control over which of the system's CPUs are allocated. This can lead to inconsistent results if the system is rebooted. For consistent results, see Example 2-1.

Example 2-1 Allocating Dedicated CPUs to a Kernel Zone

This example shows how to verify that no CPUs are allocated or dedicated to kzone1, and then allocates them. It assumes that kzone1 is on the global system that is running a SPARC T4 with six cores.

global$ pfbash zonecfg -z kzone1
zonecfg:kzone1> info dedicated-cpu
zonecfg:kzone1> add dedicated-cpu
zonecfg:kzone1:dedicated-cpu> set cpus=8-15
zonecfg:kzone1:dedicated-cpu> end
zonecfg:kzone1> info dedicated-cpu
cpus:  8-15
zonecfg:kzone1:dedicated-cpu> end
zonecfg:kzone1> exit

For more information, see dedicated-cpu Resource Type in Oracle Solaris Zones Configuration Resources.