Lines Matching defs:prev_cpu
428 * 3. Prefer @prev_cpu's SMT sibling:
429 * - if @prev_cpu is busy and no fully idle core is available, try to
430 * place the task on an idle SMT sibling of @prev_cpu; keeping the
450 * begin in @prev_cpu's node and proceed to other nodes in order of
458 s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
463 int node = scx_cpu_node_if_enabled(prev_cpu);
486 * Check whether @prev_cpu is still within the allowed set. If not,
489 is_prev_allowed = cpumask_test_cpu(prev_cpu, allowed);
505 const struct cpumask *cpus = numa_span(prev_cpu);
515 const struct cpumask *cpus = llc_span(prev_cpu);
530 * If the waker's CPU is cache affine and prev_cpu is idle,
534 if (is_prev_allowed && cpus_share_cache(cpu, prev_cpu) &&
535 scx_idle_test_and_clear_cpu(prev_cpu)) {
536 cpu = prev_cpu;
567 * partially idle @prev_cpu.
571 * Keep using @prev_cpu if it's part of a fully idle core.
574 cpumask_test_cpu(prev_cpu, idle_cpumask(node)->smt) &&
575 scx_idle_test_and_clear_cpu(prev_cpu)) {
576 cpu = prev_cpu;
603 * begin in prev_cpu's node and proceed to other nodes in
621 * Use @prev_cpu if it's idle.
623 if (is_prev_allowed && scx_idle_test_and_clear_cpu(prev_cpu)) {
624 cpu = prev_cpu;
629 * Use @prev_cpu's sibling if it's idle.
632 for_each_cpu_and(cpu, cpu_smt_mask(prev_cpu), allowed) {
633 if (cpu == prev_cpu)
663 * in prev_cpu's node and proceed to other nodes in order of
955 static s32 select_cpu_restricted(struct task_struct *p, s32 prev_cpu,
973 int node = scx_cpu_node_if_enabled(prev_cpu);
986 s32 prev_cpu, u64 wake_flags,
994 if (!scx_cpu_valid(sch, prev_cpu, NULL))
1034 cpu = select_cpu_restricted(p, prev_cpu, allowed, flags,
1037 cpu = scx_select_cpu_dfl(p, prev_cpu, wake_flags,
1072 * @prev_cpu: CPU @p was on previously
1085 __bpf_kfunc s32 scx_bpf_select_cpu_dfl(struct task_struct *p, s32 prev_cpu,
1098 cpu = select_cpu_from_kfunc(sch, p, prev_cpu, wake_flags, NULL, 0);
1104 return prev_cpu;
1109 s32 prev_cpu;
1119 * @args->prev_cpu: CPU @p was on previously
1133 * @p, @args->prev_cpu and @args->wake_flags match ops.select_cpu().
1152 return select_cpu_from_kfunc(sch, p, args->prev_cpu, args->wake_flags,
1159 __bpf_kfunc s32 scx_bpf_select_cpu_and(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
1188 return select_cpu_from_kfunc(sch, p, prev_cpu, wake_flags,