Commit 0e93f1c7 authored by Srikar Dronamraju's avatar Srikar Dronamraju Committed by Michael Ellerman

powerpc/smp: Avoid asym packing within thread_group of a core

PowerVM Hypervisor will schedule at a core granularity. However each
core can have more than one thread_groups. For better utilization in
case of a shared processor, its preferable for the scheduler to pack to
the lowest core. However there is no benefit of moving a thread between
two thread groups of the same core.
Signed-off-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231214180720.310852-5-srikar@linux.vnet.ibm.com
parent fd535a85
......@@ -1763,6 +1763,19 @@ void __init smp_cpus_done(unsigned int max_cpus)
set_sched_topology(powerpc_topology);
}
/*
* For asym packing, by default lower numbered CPU has higher priority.
* On shared processors, pack to lower numbered core. However avoid moving
* between thread_groups within the same core.
*/
int arch_asym_cpu_priority(int cpu)
{
if (static_branch_unlikely(&splpar_asym_pack))
return -cpu / threads_per_core;
return -cpu;
}
#ifdef CONFIG_HOTPLUG_CPU
int __cpu_disable(void)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment