Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched_ext: Add scx_bpf_now() for BPF scheduler

scx_bpf_now() is added to the header files so the BPF scheduler
can use it.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Changwoo Min and committed by
Tejun Heo
2e1ce39f 3a9910b5

+6
+1
tools/sched_ext/include/scx/common.bpf.h
··· 76 76 s32 scx_bpf_task_cpu(const struct task_struct *p) __ksym; 77 77 struct rq *scx_bpf_cpu_rq(s32 cpu) __ksym; 78 78 struct cgroup *scx_bpf_task_cgroup(struct task_struct *p) __ksym __weak; 79 + u64 scx_bpf_now(void) __ksym __weak; 79 80 80 81 /* 81 82 * Use the following as @it__iter when calling scx_bpf_dsq_move[_vtime]() from
+5
tools/sched_ext/include/scx/compat.bpf.h
··· 125 125 false; \ 126 126 }) 127 127 128 + #define scx_bpf_now() \ 129 + (bpf_ksym_exists(scx_bpf_now) ? \ 130 + scx_bpf_now() : \ 131 + bpf_ktime_get_ns()) 132 + 128 133 /* 129 134 * Define sched_ext_ops. This may be expanded to define multiple variants for 130 135 * backward compatibility. See compat.h::SCX_OPS_LOAD/ATTACH().