mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
sched: walt: Setup complex sibling hints at init
Currently, we are determining the L2 cache sibling of silvers at runtime on every iteration FBT. It is better to do this setup once, and gather this information from hardware rather than hardcoding the results. Change-Id: I06ec2f590dc9ccc2ec9161f1a60eb47d77244153 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org> Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
parent
d5046c9052
commit
ee77eeeb73
|
|
@ -2517,6 +2517,41 @@ static void walt_get_possible_siblings(int cpuid, struct cpumask *cluster_cpus)
|
|||
}
|
||||
}
|
||||
|
||||
int cpu_l2_sibling[WALT_NR_CPUS] = {[0 ... WALT_NR_CPUS-1] = -1};
|
||||
static void find_cache_siblings(void)
|
||||
{
|
||||
int cpu, cpu2;
|
||||
struct device_node *cpu_dev, *cpu_dev2, *cpu_l2_cache_node, *cpu_l2_cache_node2;
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
cpu_dev = of_get_cpu_node(cpu, NULL);
|
||||
if (!cpu_dev)
|
||||
continue;
|
||||
|
||||
cpu_l2_cache_node = of_parse_phandle(cpu_dev, "next-level-cache", 0);
|
||||
if (!cpu_l2_cache_node)
|
||||
continue;
|
||||
|
||||
for_each_possible_cpu(cpu2) {
|
||||
if (cpu == cpu2)
|
||||
continue;
|
||||
|
||||
cpu_dev2 = of_get_cpu_node(cpu2, NULL);
|
||||
if (!cpu_dev2)
|
||||
continue;
|
||||
|
||||
cpu_l2_cache_node2 = of_parse_phandle(cpu_dev2, "next-level-cache", 0);
|
||||
if (!cpu_l2_cache_node2)
|
||||
continue;
|
||||
|
||||
if (cpu_l2_cache_node == cpu_l2_cache_node2) {
|
||||
cpu_l2_sibling[cpu] = cpu2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void walt_update_cluster_topology(void)
|
||||
{
|
||||
struct cpumask cpus = *cpu_possible_mask;
|
||||
|
|
@ -2584,6 +2619,7 @@ static void walt_update_cluster_topology(void)
|
|||
|
||||
init_cpu_array();
|
||||
build_cpu_array();
|
||||
find_cache_siblings();
|
||||
|
||||
create_util_to_cost();
|
||||
walt_clusters_parsed = true;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ extern unsigned int sched_capacity_margin_up[WALT_NR_CPUS];
|
|||
extern unsigned int sched_capacity_margin_down[WALT_NR_CPUS];
|
||||
extern cpumask_t asym_cap_sibling_cpus;
|
||||
extern cpumask_t __read_mostly **cpu_array;
|
||||
|
||||
extern int cpu_l2_sibling[WALT_NR_CPUS];
|
||||
extern void sched_update_nr_prod(int cpu, int enq);
|
||||
extern unsigned int walt_big_tasks(int cpu);
|
||||
extern void walt_rotate_work_init(void);
|
||||
|
|
|
|||
|
|
@ -215,12 +215,8 @@ enum fastpaths {
|
|||
|
||||
static inline bool is_complex_sibling_idle(int cpu)
|
||||
{
|
||||
if (is_min_capacity_cpu(cpu)) {
|
||||
if (cpu % 2)
|
||||
return available_idle_cpu(cpu - 1);
|
||||
return available_idle_cpu(cpu + 1);
|
||||
}
|
||||
|
||||
if (cpu_l2_sibling[cpu] != -1)
|
||||
return available_idle_cpu(cpu_l2_sibling[cpu]);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user