]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "selftests/sched_ext: fix build after renames in sched_ext API"
authorLibo Chen <libo.chen@oracle.com>
Wed, 12 Feb 2025 01:11:37 +0000 (17:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2025 09:05:47 +0000 (10:05 +0100)
This reverts commit fc20e87419e59d86f3bbcee2d4506bcd01c6450a which is
commit ef7009decc30eb2515a64253791d61b72229c119 upstream.

Commit "selftests/sched_ext: fix build after renames in sched_ext API”
was pulled into 6.12.y without the sched_ext API renames it depends on.
The prereqs can be found in
https://lore.kernel.org/lkml/20241110200308.103681-1-tj@kernel.org/
As a result, sched_ext selftests fail to compile.

Cc: stable@vger.kernel.org
Fixes: fc20e87419e59 ("selftests/sched_ext: fix build after renames in sched_ext API")
Signed-off-by: Libo Chen <libo.chen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 files changed:
tools/testing/selftests/sched_ext/ddsp_bogus_dsq_fail.bpf.c
tools/testing/selftests/sched_ext/ddsp_vtimelocal_fail.bpf.c
tools/testing/selftests/sched_ext/dsp_local_on.bpf.c
tools/testing/selftests/sched_ext/enq_select_cpu_fails.bpf.c
tools/testing/selftests/sched_ext/exit.bpf.c
tools/testing/selftests/sched_ext/maximal.bpf.c
tools/testing/selftests/sched_ext/select_cpu_dfl.bpf.c
tools/testing/selftests/sched_ext/select_cpu_dfl_nodispatch.bpf.c
tools/testing/selftests/sched_ext/select_cpu_dispatch.bpf.c
tools/testing/selftests/sched_ext/select_cpu_dispatch_bad_dsq.bpf.c
tools/testing/selftests/sched_ext/select_cpu_dispatch_dbl_dsp.bpf.c
tools/testing/selftests/sched_ext/select_cpu_vtime.bpf.c

index 6f4c3f5a1c5d99a3f14debc30810e5fe220f91e6..37d9bf6fb7458d3ddbfd3de74b3d9f1775574664 100644 (file)
@@ -20,7 +20,7 @@ s32 BPF_STRUCT_OPS(ddsp_bogus_dsq_fail_select_cpu, struct task_struct *p,
                 * If we dispatch to a bogus DSQ that will fall back to the
                 * builtin global DSQ, we fail gracefully.
                 */
-               scx_bpf_dsq_insert_vtime(p, 0xcafef00d, SCX_SLICE_DFL,
+               scx_bpf_dispatch_vtime(p, 0xcafef00d, SCX_SLICE_DFL,
                                       p->scx.dsq_vtime, 0);
                return cpu;
        }
index e4a55027778fd08b5e769c37291810462481f952..dffc97d9cdf141beffdeecce79f9e8751b0a3a52 100644 (file)
@@ -17,8 +17,8 @@ s32 BPF_STRUCT_OPS(ddsp_vtimelocal_fail_select_cpu, struct task_struct *p,
 
        if (cpu >= 0) {
                /* Shouldn't be allowed to vtime dispatch to a builtin DSQ. */
-               scx_bpf_dsq_insert_vtime(p, SCX_DSQ_LOCAL, SCX_SLICE_DFL,
-                                        p->scx.dsq_vtime, 0);
+               scx_bpf_dispatch_vtime(p, SCX_DSQ_LOCAL, SCX_SLICE_DFL,
+                                      p->scx.dsq_vtime, 0);
                return cpu;
        }
 
index fbda6bf5467128810bf14cf0da6255eb507d8b7d..c9a2da0575a0fa11ab922824cee62c27f2650640 100644 (file)
@@ -48,7 +48,7 @@ void BPF_STRUCT_OPS(dsp_local_on_dispatch, s32 cpu, struct task_struct *prev)
        else
                target = scx_bpf_task_cpu(p);
 
-       scx_bpf_dsq_insert(p, SCX_DSQ_LOCAL_ON | target, SCX_SLICE_DFL, 0);
+       scx_bpf_dispatch(p, SCX_DSQ_LOCAL_ON | target, SCX_SLICE_DFL, 0);
        bpf_task_release(p);
 }
 
index a7cf868d5e311d8f9e7649657a53e63237b0e516..1efb50d61040ad3832d5cea89c11200593691069 100644 (file)
@@ -31,7 +31,7 @@ void BPF_STRUCT_OPS(enq_select_cpu_fails_enqueue, struct task_struct *p,
        /* Can only call from ops.select_cpu() */
        scx_bpf_select_cpu_dfl(p, 0, 0, &found);
 
-       scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
+       scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
 }
 
 SEC(".struct_ops.link")
index 4bc36182d3ffc2fb10e4e2c4eb92fccbfd7fec41..d75d4faf07f6d5690801695288306c358e3a5e84 100644 (file)
@@ -33,7 +33,7 @@ void BPF_STRUCT_OPS(exit_enqueue, struct task_struct *p, u64 enq_flags)
        if (exit_point == EXIT_ENQUEUE)
                EXIT_CLEANLY();
 
-       scx_bpf_dsq_insert(p, DSQ_ID, SCX_SLICE_DFL, enq_flags);
+       scx_bpf_dispatch(p, DSQ_ID, SCX_SLICE_DFL, enq_flags);
 }
 
 void BPF_STRUCT_OPS(exit_dispatch, s32 cpu, struct task_struct *p)
@@ -41,7 +41,7 @@ void BPF_STRUCT_OPS(exit_dispatch, s32 cpu, struct task_struct *p)
        if (exit_point == EXIT_DISPATCH)
                EXIT_CLEANLY();
 
-       scx_bpf_dsq_move_to_local(DSQ_ID);
+       scx_bpf_consume(DSQ_ID);
 }
 
 void BPF_STRUCT_OPS(exit_enable, struct task_struct *p)
index 430f5e13bf554492e6505822f1654b7ebfd4d3af..361797e10ed5d53efffa03082e9c08f9bb8c91da 100644 (file)
@@ -22,7 +22,7 @@ s32 BPF_STRUCT_OPS(maximal_select_cpu, struct task_struct *p, s32 prev_cpu,
 
 void BPF_STRUCT_OPS(maximal_enqueue, struct task_struct *p, u64 enq_flags)
 {
-       scx_bpf_dsq_insert(p, DSQ_ID, SCX_SLICE_DFL, enq_flags);
+       scx_bpf_dispatch(p, DSQ_ID, SCX_SLICE_DFL, enq_flags);
 }
 
 void BPF_STRUCT_OPS(maximal_dequeue, struct task_struct *p, u64 deq_flags)
@@ -30,7 +30,7 @@ void BPF_STRUCT_OPS(maximal_dequeue, struct task_struct *p, u64 deq_flags)
 
 void BPF_STRUCT_OPS(maximal_dispatch, s32 cpu, struct task_struct *prev)
 {
-       scx_bpf_dsq_move_to_local(DSQ_ID);
+       scx_bpf_consume(DSQ_ID);
 }
 
 void BPF_STRUCT_OPS(maximal_runnable, struct task_struct *p, u64 enq_flags)
index 13d0f5be788d1206f28a15c8415679c52fb74989..f171ac47097060be0ff3a72ef13385cc00502126 100644 (file)
@@ -30,7 +30,7 @@ void BPF_STRUCT_OPS(select_cpu_dfl_enqueue, struct task_struct *p,
        }
        scx_bpf_put_idle_cpumask(idle_mask);
 
-       scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
+       scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
 }
 
 SEC(".struct_ops.link")
index 815f1d5d61ac4352c8952332f7ce9cadfcd75345..9efdbb7da92887d0eec403e130783bd7b106e88e 100644 (file)
@@ -67,7 +67,7 @@ void BPF_STRUCT_OPS(select_cpu_dfl_nodispatch_enqueue, struct task_struct *p,
                saw_local = true;
        }
 
-       scx_bpf_dsq_insert(p, dsq_id, SCX_SLICE_DFL, enq_flags);
+       scx_bpf_dispatch(p, dsq_id, SCX_SLICE_DFL, enq_flags);
 }
 
 s32 BPF_STRUCT_OPS(select_cpu_dfl_nodispatch_init_task,
index 4bb99699e9209c722f361a53fbe1953803236d4f..59bfc4f36167a704c8980304dc09fc7a51ff1456 100644 (file)
@@ -29,7 +29,7 @@ s32 BPF_STRUCT_OPS(select_cpu_dispatch_select_cpu, struct task_struct *p,
        cpu = prev_cpu;
 
 dispatch:
-       scx_bpf_dsq_insert(p, dsq_id, SCX_SLICE_DFL, 0);
+       scx_bpf_dispatch(p, dsq_id, SCX_SLICE_DFL, 0);
        return cpu;
 }
 
index 2a75de11b2cfd59b86ce6ed36ee676b4655708ba..3bbd5fcdfb18e0aa64a3a68b79d6db4573218d03 100644 (file)
@@ -18,7 +18,7 @@ s32 BPF_STRUCT_OPS(select_cpu_dispatch_bad_dsq_select_cpu, struct task_struct *p
                   s32 prev_cpu, u64 wake_flags)
 {
        /* Dispatching to a random DSQ should fail. */
-       scx_bpf_dsq_insert(p, 0xcafef00d, SCX_SLICE_DFL, 0);
+       scx_bpf_dispatch(p, 0xcafef00d, SCX_SLICE_DFL, 0);
 
        return prev_cpu;
 }
index 99d075695c9743a4b817e48263f4467b8024ff9f..0fda57fe0ecfaecc5a5cfaebe2589f563f7ad579 100644 (file)
@@ -18,8 +18,8 @@ s32 BPF_STRUCT_OPS(select_cpu_dispatch_dbl_dsp_select_cpu, struct task_struct *p
                   s32 prev_cpu, u64 wake_flags)
 {
        /* Dispatching twice in a row is disallowed. */
-       scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, 0);
-       scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, 0);
+       scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, 0);
+       scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, 0);
 
        return prev_cpu;
 }
index bfcb96cd4954bdd65b3c5f8217eb145aafd9010e..e6c67bcf5e6e35f82e47ce139476a375f509c2cb 100644 (file)
@@ -2,8 +2,8 @@
 /*
  * A scheduler that validates that enqueue flags are properly stored and
  * applied at dispatch time when a task is directly dispatched from
- * ops.select_cpu(). We validate this by using scx_bpf_dsq_insert_vtime(),
- * and making the test a very basic vtime scheduler.
+ * ops.select_cpu(). We validate this by using scx_bpf_dispatch_vtime(), and
+ * making the test a very basic vtime scheduler.
  *
  * Copyright (c) 2024 Meta Platforms, Inc. and affiliates.
  * Copyright (c) 2024 David Vernet <dvernet@meta.com>
@@ -47,13 +47,13 @@ s32 BPF_STRUCT_OPS(select_cpu_vtime_select_cpu, struct task_struct *p,
        cpu = prev_cpu;
        scx_bpf_test_and_clear_cpu_idle(cpu);
 ddsp:
-       scx_bpf_dsq_insert_vtime(p, VTIME_DSQ, SCX_SLICE_DFL, task_vtime(p), 0);
+       scx_bpf_dispatch_vtime(p, VTIME_DSQ, SCX_SLICE_DFL, task_vtime(p), 0);
        return cpu;
 }
 
 void BPF_STRUCT_OPS(select_cpu_vtime_dispatch, s32 cpu, struct task_struct *p)
 {
-       if (scx_bpf_dsq_move_to_local(VTIME_DSQ))
+       if (scx_bpf_consume(VTIME_DSQ))
                consumed = true;
 }