Skip to content

Commit 046a5a9

Browse files
ricardonPeter Zijlstra
authored and
Peter Zijlstra
committed
x86/sched/itmt: Give all SMT siblings of a core the same priority
X86 does not have the SD_ASYM_PACKING flag in the SMT domain. The scheduler knows how to handle SMT and non-SMT cores of different priority. There is no reason for SMT siblings of a core to have different priorities. Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Len Brown <len.brown@intel.com> Tested-by: Zhang Rui <rui.zhang@intel.com> Link: https://lore.kernel.org/r/20230406203148.19182-12-ricardo.neri-calderon@linux.intel.com
1 parent 995998e commit 046a5a9

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

arch/x86/kernel/itmt.c

+5-18
Original file line numberDiff line numberDiff line change
@@ -165,32 +165,19 @@ int arch_asym_cpu_priority(int cpu)
165165

166166
/**
167167
* sched_set_itmt_core_prio() - Set CPU priority based on ITMT
168-
* @prio: Priority of cpu core
169-
* @core_cpu: The cpu number associated with the core
168+
* @prio: Priority of @cpu
169+
* @cpu: The CPU number
170170
*
171171
* The pstate driver will find out the max boost frequency
172172
* and call this function to set a priority proportional
173-
* to the max boost frequency. CPU with higher boost
173+
* to the max boost frequency. CPUs with higher boost
174174
* frequency will receive higher priority.
175175
*
176176
* No need to rebuild sched domain after updating
177177
* the CPU priorities. The sched domains have no
178178
* dependency on CPU priorities.
179179
*/
180-
void sched_set_itmt_core_prio(int prio, int core_cpu)
180+
void sched_set_itmt_core_prio(int prio, int cpu)
181181
{
182-
int cpu, i = 1;
183-
184-
for_each_cpu(cpu, topology_sibling_cpumask(core_cpu)) {
185-
int smt_prio;
186-
187-
/*
188-
* Ensure that the siblings are moved to the end
189-
* of the priority chain and only used when
190-
* all other high priority cpus are out of capacity.
191-
*/
192-
smt_prio = prio * smp_num_siblings / (i * i);
193-
per_cpu(sched_core_priority, cpu) = smt_prio;
194-
i++;
195-
}
182+
per_cpu(sched_core_priority, cpu) = prio;
196183
}

0 commit comments

Comments
 (0)