scx_layered: Restrict idle selection to layer cpus

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
This commit is contained in:
Daniel Hodges 2024-09-24 09:40:38 -07:00
parent 29fb647c93
commit 87c6e276d9

View File

@ -615,6 +615,7 @@ s32 pick_idle_cpu(struct task_struct *p, s32 prev_cpu,
}
bpf_cpumask_copy(pref_idle_cpumask, idle_cpumask);
bpf_cpumask_and(pref_idle_cpumask, cache_cpumask, pref_idle_cpumask);
bpf_cpumask_and(pref_idle_cpumask, layer_cpumask, pref_idle_cpumask);
trace("pick_idle: llc idle_cpumask=%p", pref_idle_cpumask);
if ((cpu = pick_idle_cpu_from(cache_cpumask, prev_cpu, pref_idle_cpumask)) >= 0)
goto out_put;
@ -629,6 +630,7 @@ s32 pick_idle_cpu(struct task_struct *p, s32 prev_cpu,
}
bpf_cpumask_copy(pref_idle_cpumask, idle_cpumask);
bpf_cpumask_and(pref_idle_cpumask, node_cpumask, pref_idle_cpumask);
bpf_cpumask_and(pref_idle_cpumask, layer_cpumask, pref_idle_cpumask);
trace("pick_idle: node node_cpumask=%p", pref_idle_cpumask);
if ((cpu = pick_idle_cpu_from(node_cpumask, prev_cpu,
pref_idle_cpumask)) >= 0)