Commit 046a5a95 authored by Ricardo Neri's avatar Ricardo Neri Committed by Peter Zijlstra

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: default avatarRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarLen Brown <len.brown@intel.com>
Tested-by: default avatarZhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20230406203148.19182-12-ricardo.neri-calderon@linux.intel.com
parent 995998eb
...@@ -165,32 +165,19 @@ int arch_asym_cpu_priority(int cpu) ...@@ -165,32 +165,19 @@ int arch_asym_cpu_priority(int cpu)
/** /**
* sched_set_itmt_core_prio() - Set CPU priority based on ITMT * sched_set_itmt_core_prio() - Set CPU priority based on ITMT
* @prio: Priority of cpu core * @prio: Priority of @cpu
* @core_cpu: The cpu number associated with the core * @cpu: The CPU number
* *
* The pstate driver will find out the max boost frequency * The pstate driver will find out the max boost frequency
* and call this function to set a priority proportional * and call this function to set a priority proportional
* to the max boost frequency. CPU with higher boost * to the max boost frequency. CPUs with higher boost
* frequency will receive higher priority. * frequency will receive higher priority.
* *
* No need to rebuild sched domain after updating * No need to rebuild sched domain after updating
* the CPU priorities. The sched domains have no * the CPU priorities. The sched domains have no
* dependency on CPU priorities. * dependency on CPU priorities.
*/ */
void sched_set_itmt_core_prio(int prio, int core_cpu) void sched_set_itmt_core_prio(int prio, int cpu)
{ {
int cpu, i = 1; per_cpu(sched_core_priority, cpu) = prio;
for_each_cpu(cpu, topology_sibling_cpumask(core_cpu)) {
int smt_prio;
/*
* Ensure that the siblings are moved to the end
* of the priority chain and only used when
* all other high priority cpus are out of capacity.
*/
smt_prio = prio * smp_num_siblings / (i * i);
per_cpu(sched_core_priority, cpu) = smt_prio;
i++;
}
} }
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