Lines Matching defs:prev_cpu

427  * 3. Prefer @prev_cpu's SMT sibling:
428 * - if @prev_cpu is busy and no fully idle core is available, try to
429 * place the task on an idle SMT sibling of @prev_cpu; keeping the
449 * begin in @prev_cpu's node and proceed to other nodes in order of
457 s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
462 int node = scx_cpu_node_if_enabled(prev_cpu);
485 * Check whether @prev_cpu is still within the allowed set. If not,
488 is_prev_allowed = cpumask_test_cpu(prev_cpu, allowed);
504 const struct cpumask *cpus = numa_span(prev_cpu);
514 const struct cpumask *cpus = llc_span(prev_cpu);
529 * If the waker's CPU is cache affine and prev_cpu is idle,
533 if (is_prev_allowed && cpus_share_cache(cpu, prev_cpu) &&
534 scx_idle_test_and_clear_cpu(prev_cpu)) {
535 cpu = prev_cpu;
564 * partially idle @prev_cpu.
568 * Keep using @prev_cpu if it's part of a fully idle core.
571 cpumask_test_cpu(prev_cpu, idle_cpumask(node)->smt) &&
572 scx_idle_test_and_clear_cpu(prev_cpu)) {
573 cpu = prev_cpu;
600 * begin in prev_cpu's node and proceed to other nodes in
618 * Use @prev_cpu if it's idle.
620 if (is_prev_allowed && scx_idle_test_and_clear_cpu(prev_cpu)) {
621 cpu = prev_cpu;
627 * Use @prev_cpu's sibling if it's idle.
630 for_each_cpu_and(cpu, cpu_smt_mask(prev_cpu), allowed) {
631 if (cpu == prev_cpu)
662 * in prev_cpu's node and proceed to other nodes in order of
913 s32 prev_cpu, u64 wake_flags,
920 if (!ops_cpu_valid(sch, prev_cpu, NULL))
959 if (cpumask_test_cpu(prev_cpu, allowed ?: p->cpus_ptr) &&
960 scx_idle_test_and_clear_cpu(prev_cpu))
961 cpu = prev_cpu;
965 cpu = scx_select_cpu_dfl(p, prev_cpu, wake_flags,
1001 * @prev_cpu: CPU @p was on previously
1014 __bpf_kfunc s32 scx_bpf_select_cpu_dfl(struct task_struct *p, s32 prev_cpu,
1027 cpu = select_cpu_from_kfunc(sch, p, prev_cpu, wake_flags, NULL, 0);
1033 return prev_cpu;
1038 s32 prev_cpu;
1048 * @args->prev_cpu: CPU @p was on previously
1062 * @p, @args->prev_cpu and @args->wake_flags match ops.select_cpu().
1081 return select_cpu_from_kfunc(sch, p, args->prev_cpu, args->wake_flags,
1088 __bpf_kfunc s32 scx_bpf_select_cpu_and(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
1110 return select_cpu_from_kfunc(sch, p, prev_cpu, wake_flags,