Skip to content

Commit ef7009d

Browse files
theihorhtejun
authored andcommitted
selftests/sched_ext: fix build after renames in sched_ext API
The selftests are falining to build on current tip of bpf-next and sched_ext [1]. This has broken BPF CI [2] after merge from upstream. Use appropriate function names in the selftests according to the recent changes in the sched_ext API [3]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=fc39fb56917bb3cb53e99560ca3612a84456ada2 [2] https://github.com/kernel-patches/bpf/actions/runs/11959327258/job/33340923745 [3] https://lore.kernel.org/all/20241109194853.580310-1-tj@kernel.org/ Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me> Acked-by: Andrea Righi <arighi@nvidia.com> Acked-by: David Vernet <void@manifault.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 793baff commit ef7009d

12 files changed

+19
-19
lines changed

tools/testing/selftests/sched_ext/ddsp_bogus_dsq_fail.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ s32 BPF_STRUCT_OPS(ddsp_bogus_dsq_fail_select_cpu, struct task_struct *p,
2020
* If we dispatch to a bogus DSQ that will fall back to the
2121
* builtin global DSQ, we fail gracefully.
2222
*/
23-
scx_bpf_dispatch_vtime(p, 0xcafef00d, SCX_SLICE_DFL,
23+
scx_bpf_dsq_insert_vtime(p, 0xcafef00d, SCX_SLICE_DFL,
2424
p->scx.dsq_vtime, 0);
2525
return cpu;
2626
}

tools/testing/selftests/sched_ext/ddsp_vtimelocal_fail.bpf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ s32 BPF_STRUCT_OPS(ddsp_vtimelocal_fail_select_cpu, struct task_struct *p,
1717

1818
if (cpu >= 0) {
1919
/* Shouldn't be allowed to vtime dispatch to a builtin DSQ. */
20-
scx_bpf_dispatch_vtime(p, SCX_DSQ_LOCAL, SCX_SLICE_DFL,
21-
p->scx.dsq_vtime, 0);
20+
scx_bpf_dsq_insert_vtime(p, SCX_DSQ_LOCAL, SCX_SLICE_DFL,
21+
p->scx.dsq_vtime, 0);
2222
return cpu;
2323
}
2424

tools/testing/selftests/sched_ext/dsp_local_on.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void BPF_STRUCT_OPS(dsp_local_on_dispatch, s32 cpu, struct task_struct *prev)
4545

4646
target = bpf_get_prandom_u32() % nr_cpus;
4747

48-
scx_bpf_dispatch(p, SCX_DSQ_LOCAL_ON | target, SCX_SLICE_DFL, 0);
48+
scx_bpf_dsq_insert(p, SCX_DSQ_LOCAL_ON | target, SCX_SLICE_DFL, 0);
4949
bpf_task_release(p);
5050
}
5151

tools/testing/selftests/sched_ext/enq_select_cpu_fails.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void BPF_STRUCT_OPS(enq_select_cpu_fails_enqueue, struct task_struct *p,
3131
/* Can only call from ops.select_cpu() */
3232
scx_bpf_select_cpu_dfl(p, 0, 0, &found);
3333

34-
scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
34+
scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
3535
}
3636

3737
SEC(".struct_ops.link")

tools/testing/selftests/sched_ext/exit.bpf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ void BPF_STRUCT_OPS(exit_enqueue, struct task_struct *p, u64 enq_flags)
3333
if (exit_point == EXIT_ENQUEUE)
3434
EXIT_CLEANLY();
3535

36-
scx_bpf_dispatch(p, DSQ_ID, SCX_SLICE_DFL, enq_flags);
36+
scx_bpf_dsq_insert(p, DSQ_ID, SCX_SLICE_DFL, enq_flags);
3737
}
3838

3939
void BPF_STRUCT_OPS(exit_dispatch, s32 cpu, struct task_struct *p)
4040
{
4141
if (exit_point == EXIT_DISPATCH)
4242
EXIT_CLEANLY();
4343

44-
scx_bpf_consume(DSQ_ID);
44+
scx_bpf_dsq_move_to_local(DSQ_ID);
4545
}
4646

4747
void BPF_STRUCT_OPS(exit_enable, struct task_struct *p)

tools/testing/selftests/sched_ext/maximal.bpf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ s32 BPF_STRUCT_OPS(maximal_select_cpu, struct task_struct *p, s32 prev_cpu,
2020

2121
void BPF_STRUCT_OPS(maximal_enqueue, struct task_struct *p, u64 enq_flags)
2222
{
23-
scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
23+
scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
2424
}
2525

2626
void BPF_STRUCT_OPS(maximal_dequeue, struct task_struct *p, u64 deq_flags)
2727
{}
2828

2929
void BPF_STRUCT_OPS(maximal_dispatch, s32 cpu, struct task_struct *prev)
3030
{
31-
scx_bpf_consume(SCX_DSQ_GLOBAL);
31+
scx_bpf_dsq_move_to_local(SCX_DSQ_GLOBAL);
3232
}
3333

3434
void BPF_STRUCT_OPS(maximal_runnable, struct task_struct *p, u64 enq_flags)

tools/testing/selftests/sched_ext/select_cpu_dfl.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void BPF_STRUCT_OPS(select_cpu_dfl_enqueue, struct task_struct *p,
3030
}
3131
scx_bpf_put_idle_cpumask(idle_mask);
3232

33-
scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
33+
scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
3434
}
3535

3636
SEC(".struct_ops.link")

tools/testing/selftests/sched_ext/select_cpu_dfl_nodispatch.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void BPF_STRUCT_OPS(select_cpu_dfl_nodispatch_enqueue, struct task_struct *p,
6767
saw_local = true;
6868
}
6969

70-
scx_bpf_dispatch(p, dsq_id, SCX_SLICE_DFL, enq_flags);
70+
scx_bpf_dsq_insert(p, dsq_id, SCX_SLICE_DFL, enq_flags);
7171
}
7272

7373
s32 BPF_STRUCT_OPS(select_cpu_dfl_nodispatch_init_task,

tools/testing/selftests/sched_ext/select_cpu_dispatch.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ s32 BPF_STRUCT_OPS(select_cpu_dispatch_select_cpu, struct task_struct *p,
2929
cpu = prev_cpu;
3030

3131
dispatch:
32-
scx_bpf_dispatch(p, dsq_id, SCX_SLICE_DFL, 0);
32+
scx_bpf_dsq_insert(p, dsq_id, SCX_SLICE_DFL, 0);
3333
return cpu;
3434
}
3535

tools/testing/selftests/sched_ext/select_cpu_dispatch_bad_dsq.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ s32 BPF_STRUCT_OPS(select_cpu_dispatch_bad_dsq_select_cpu, struct task_struct *p
1818
s32 prev_cpu, u64 wake_flags)
1919
{
2020
/* Dispatching to a random DSQ should fail. */
21-
scx_bpf_dispatch(p, 0xcafef00d, SCX_SLICE_DFL, 0);
21+
scx_bpf_dsq_insert(p, 0xcafef00d, SCX_SLICE_DFL, 0);
2222

2323
return prev_cpu;
2424
}

0 commit comments

Comments
 (0)