CPU polarization

6.10 LPAR mode

You can modify the operation of a vertical SMP environment by adjusting the SMP factor.

Before you begin

CPU polarization is relevant only to Linux® in LPAR mode.
Warning: Turning on vertical CPU polarization without careful configuration can result in significant performance degradation. See Configuration note for details.

About this task

Horizontal CPU polarization means that the PR/SM hypervisor dispatches each virtual CPU of an LPAR for the same amount of time.

With vertical CPU polarization, the PR/SM hypervisor dispatches certain CPUs for a longer time than others. For example, if an LPAR has three virtual CPUs, each of them with a share of 33%, then in case of vertical CPU polarization, all of the processing time would be combined to a single CPU. This CPU would run most of the time while the other two CPUs would get nearly no time.

There are three types of vertical CPUs: high, medium, and low. Low CPUs hardly get any real CPU time, while high CPUs get a full real CPU. Medium CPUs get something in between.

Configuration note: Switching to vertical CPU polarization usually results in a system with different types of vertical CPUs. Running a system with different types of vertical CPUs can result in significant performance degradation. If possible, use only one type of vertical CPUs. Set all other CPUs offline and deconfigure them.

Procedure

To change the polarization, issue a command of this form:
# chcpu -p horizontal|vertical
Alternatively, you can write a 0 for horizontal polarization (the default) or a 1 for vertical polarization to /sys/devices/system/cpu/dispatching.
Example: The following chcpu command sets the polarization to vertical.
# chcpu -p vertical
You can achieve the same results by issuing the following command:
# echo 1 > /sys/devices/system/cpu/dispatching

What to do next

You can issue the lscpu command with the -e option to find out the polarization of your CPUs. For more detailed information for a particular CPU, read the polarization attribute of the CPU in sysfs.
# cat /sys/devices/system/cpu/cpu<N>/polarization
The polarization can have one of the following values:
  • horizontal - each of the guests' virtual CPUs is dispatched for the same amount of time.
  • vertical:high - full CPU time is allocated.
  • vertical:medium - medium CPU time is allocated.
  • vertical:low - very little CPU time is allocated.
  • unknown - temporary value following a polarization change until the change is completed and the kernel has established the new polarization of each CPU.