sched/topology: Allow archs to override cpu_smt_mask
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Fri, 7 Aug 2020 07:45:16 +0000 (13:15 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 16 Sep 2020 12:05:18 +0000 (22:05 +1000)
commit3babbe447d76ac2919ec4d0eb3b0adfb22f5b03c
tree2be0fd8efd1fd7d5e971fe11fc01de3aef2f4518
parent3db8715ec9dc1d32ecafc67af9fb96508c98efe5
sched/topology: Allow archs to override cpu_smt_mask

cpu_smt_mask tracks topology_sibling_cpumask. This would be good for
most architectures. One of the users of cpu_smt_mask(), would be to
identify idle-cores. On Power9, a pair of SMT4 cores can be presented
by the firmware as a SMT8 core for backward compatibility reasons.

powerpc allows LPARs to be live migrated from Power8 to Power9. Do
note Power8 had only SMT8 cores. Existing software which has been
developed/configured for Power8 would expect to see SMT8 core.
Maintaining the illusion of SMT8 core is a requirement to make that
work.

In order to maintain above userspace backward compatibility with
previous versions of processor, Power9 onwards there is option to the
firmware to advertise a pair of SMT4 cores as a fused cores aka SMT8
core. On Power9 this pair shares the L2 cache as well. However, from
the scheduler's point of view, a core should be determined by SMT4,
since its a completely independent unit of compute. Hence allow
powerpc architecture to override the default cpu_smt_mask() to point
to the SMT4 cores in a SMT8 mode.

This will ensure the scheduler is always given the right information.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200807074517.27957-1-srikar@linux.vnet.ibm.com
include/linux/topology.h