Skip to content

Commit 24f80a4

Browse files
committed
powerpc/smp: Avoid asym packing within thread_group of a core
JIRA: https://issues.redhat.com/browse/RHEL-118964 commit 0e93f1c Author: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Date: Thu Dec 14 23:37:14 2023 +0530 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: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231214180720.310852-5-srikar@linux.vnet.ibm.com Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent d61dd79 commit 24f80a4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arch/powerpc/kernel/smp.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,19 @@ void __init smp_cpus_done(unsigned int max_cpus)
17791779
set_sched_topology(powerpc_topology);
17801780
}
17811781

1782+
/*
1783+
* For asym packing, by default lower numbered CPU has higher priority.
1784+
* On shared processors, pack to lower numbered core. However avoid moving
1785+
* between thread_groups within the same core.
1786+
*/
1787+
int arch_asym_cpu_priority(int cpu)
1788+
{
1789+
if (static_branch_unlikely(&splpar_asym_pack))
1790+
return -cpu / threads_per_core;
1791+
1792+
return -cpu;
1793+
}
1794+
17821795
#ifdef CONFIG_HOTPLUG_CPU
17831796
int __cpu_disable(void)
17841797
{

0 commit comments

Comments
 (0)