powerpc/smp: Enable Asym packing for cores on shared processor
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Thu, 14 Dec 2023 18:07:11 +0000 (23:37 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 15 Dec 2023 02:51:34 +0000 (13:51 +1100)
commitaa80c6343fcf53cbc29f84ba9f89ca87d4e41350
tree6e9f6dcbde0f272d3dcbb9e0e71337283e8146ae
parent98b1cc82c4affc16f5598d4fa14b1858671b2263
powerpc/smp: Enable Asym packing for cores on shared processor

If there are shared processor LPARs, underlying Hypervisor can have more
virtual cores to handle than actual physical cores.

Starting with Power 9, a big core (aka SMT8 core) has 2 nearly
independent thread groups. On a shared processors LPARs, it helps to
pack threads to lesser number of cores so that the overall system
performance and utilization improves. PowerVM schedules at a big core
level. Hence packing to fewer cores helps.

Since each thread-group is independent, running threads on both the
thread-groups of a SMT8 core, should have a minimal adverse impact in
non over provisioned scenarios. These changes in this patchset will not
affect in the over provisioned scenario. If there are more threads than
SMT domains, then asym_packing will not kick-in

For example: Lets says there are two 8-core Shared LPARs that are
actually sharing a 8 Core shared physical pool, each running 8 threads
each. Then Consolidating 8 threads to 4 cores on each LPAR would help
them to perform better. This is because each of the LPAR will get
100% time to run applications and there will no switching required by
the Hypervisor.

To achieve this, enable SD_ASYM_PACKING flag at CACHE, MC and DIE level
when the system is running in shared processor mode and has big cores.

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231214180720.310852-2-srikar@linux.vnet.ibm.com
arch/powerpc/kernel/smp.c