SCX eBPF function scx_bpf_select_cpu_and
The scx_bpf_select_cpu_and function wraps the scx_bpf_select_cpu_and and __scx_bpf_select_cpu_and kfuncs. It implements the CO-RE logic needed to select the proper kfunc to use depending on the kernel being used.
Definition
static inline s32
scx_bpf_select_cpu_and(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
const struct cpumask *cpus_allowed, u64 flags)
{
if (bpf_core_type_exists(struct scx_bpf_select_cpu_and_args)) {
struct scx_bpf_select_cpu_and_args args = {
.prev_cpu = prev_cpu,
.wake_flags = wake_flags,
.flags = flags,
};
return __scx_bpf_select_cpu_and(p, cpus_allowed, &args);
} else {
return scx_bpf_select_cpu_and___compat(p, prev_cpu, wake_flags,
cpus_allowed, flags);
}
}