Skip to content

Commit cf58326

Browse files
committed
sched_ext: Rename CFI stubs to names that are recognized by BPF
CFI stubs can be used to tag arguments with __nullable (and possibly other tags in the future) but for that to work the CFI stubs must have names that are recognized by BPF. Rename them. Signed-off-by: Tejun Heo <[email protected]> Acked-by: David Vernet <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Acked-by: Alexei Starovoitov <[email protected]>
1 parent dfa4ed2 commit cf58326

File tree

1 file changed

+66
-66
lines changed

1 file changed

+66
-66
lines changed

kernel/sched/ext.c

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5634,78 +5634,78 @@ static int bpf_scx_validate(void *kdata)
56345634
return 0;
56355635
}
56365636

5637-
static s32 select_cpu_stub(struct task_struct *p, s32 prev_cpu, u64 wake_flags) { return -EINVAL; }
5638-
static void enqueue_stub(struct task_struct *p, u64 enq_flags) {}
5639-
static void dequeue_stub(struct task_struct *p, u64 enq_flags) {}
5640-
static void dispatch_stub(s32 prev_cpu, struct task_struct *p) {}
5641-
static void tick_stub(struct task_struct *p) {}
5642-
static void runnable_stub(struct task_struct *p, u64 enq_flags) {}
5643-
static void running_stub(struct task_struct *p) {}
5644-
static void stopping_stub(struct task_struct *p, bool runnable) {}
5645-
static void quiescent_stub(struct task_struct *p, u64 deq_flags) {}
5646-
static bool yield_stub(struct task_struct *from, struct task_struct *to) { return false; }
5647-
static bool core_sched_before_stub(struct task_struct *a, struct task_struct *b) { return false; }
5648-
static void set_weight_stub(struct task_struct *p, u32 weight) {}
5649-
static void set_cpumask_stub(struct task_struct *p, const struct cpumask *mask) {}
5650-
static void update_idle_stub(s32 cpu, bool idle) {}
5651-
static void cpu_acquire_stub(s32 cpu, struct scx_cpu_acquire_args *args) {}
5652-
static void cpu_release_stub(s32 cpu, struct scx_cpu_release_args *args) {}
5653-
static s32 init_task_stub(struct task_struct *p, struct scx_init_task_args *args) { return -EINVAL; }
5654-
static void exit_task_stub(struct task_struct *p, struct scx_exit_task_args *args) {}
5655-
static void enable_stub(struct task_struct *p) {}
5656-
static void disable_stub(struct task_struct *p) {}
5637+
static s32 sched_ext_ops__select_cpu(struct task_struct *p, s32 prev_cpu, u64 wake_flags) { return -EINVAL; }
5638+
static void sched_ext_ops__enqueue(struct task_struct *p, u64 enq_flags) {}
5639+
static void sched_ext_ops__dequeue(struct task_struct *p, u64 enq_flags) {}
5640+
static void sched_ext_ops__dispatch(s32 prev_cpu, struct task_struct *p) {}
5641+
static void sched_ext_ops__tick(struct task_struct *p) {}
5642+
static void sched_ext_ops__runnable(struct task_struct *p, u64 enq_flags) {}
5643+
static void sched_ext_ops__running(struct task_struct *p) {}
5644+
static void sched_ext_ops__stopping(struct task_struct *p, bool runnable) {}
5645+
static void sched_ext_ops__quiescent(struct task_struct *p, u64 deq_flags) {}
5646+
static bool sched_ext_ops__yield(struct task_struct *from, struct task_struct *to) { return false; }
5647+
static bool sched_ext_ops__core_sched_before(struct task_struct *a, struct task_struct *b) { return false; }
5648+
static void sched_ext_ops__set_weight(struct task_struct *p, u32 weight) {}
5649+
static void sched_ext_ops__set_cpumask(struct task_struct *p, const struct cpumask *mask) {}
5650+
static void sched_ext_ops__update_idle(s32 cpu, bool idle) {}
5651+
static void sched_ext_ops__cpu_acquire(s32 cpu, struct scx_cpu_acquire_args *args) {}
5652+
static void sched_ext_ops__cpu_release(s32 cpu, struct scx_cpu_release_args *args) {}
5653+
static s32 sched_ext_ops__init_task(struct task_struct *p, struct scx_init_task_args *args) { return -EINVAL; }
5654+
static void sched_ext_ops__exit_task(struct task_struct *p, struct scx_exit_task_args *args) {}
5655+
static void sched_ext_ops__enable(struct task_struct *p) {}
5656+
static void sched_ext_ops__disable(struct task_struct *p) {}
56575657
#ifdef CONFIG_EXT_GROUP_SCHED
5658-
static s32 cgroup_init_stub(struct cgroup *cgrp, struct scx_cgroup_init_args *args) { return -EINVAL; }
5659-
static void cgroup_exit_stub(struct cgroup *cgrp) {}
5660-
static s32 cgroup_prep_move_stub(struct task_struct *p, struct cgroup *from, struct cgroup *to) { return -EINVAL; }
5661-
static void cgroup_move_stub(struct task_struct *p, struct cgroup *from, struct cgroup *to) {}
5662-
static void cgroup_cancel_move_stub(struct task_struct *p, struct cgroup *from, struct cgroup *to) {}
5663-
static void cgroup_set_weight_stub(struct cgroup *cgrp, u32 weight) {}
5658+
static s32 sched_ext_ops__cgroup_init(struct cgroup *cgrp, struct scx_cgroup_init_args *args) { return -EINVAL; }
5659+
static void sched_ext_ops__cgroup_exit(struct cgroup *cgrp) {}
5660+
static s32 sched_ext_ops__cgroup_prep_move(struct task_struct *p, struct cgroup *from, struct cgroup *to) { return -EINVAL; }
5661+
static void sched_ext_ops__cgroup_move(struct task_struct *p, struct cgroup *from, struct cgroup *to) {}
5662+
static void sched_ext_ops__cgroup_cancel_move(struct task_struct *p, struct cgroup *from, struct cgroup *to) {}
5663+
static void sched_ext_ops__cgroup_set_weight(struct cgroup *cgrp, u32 weight) {}
56645664
#endif
5665-
static void cpu_online_stub(s32 cpu) {}
5666-
static void cpu_offline_stub(s32 cpu) {}
5667-
static s32 init_stub(void) { return -EINVAL; }
5668-
static void exit_stub(struct scx_exit_info *info) {}
5669-
static void dump_stub(struct scx_dump_ctx *ctx) {}
5670-
static void dump_cpu_stub(struct scx_dump_ctx *ctx, s32 cpu, bool idle) {}
5671-
static void dump_task_stub(struct scx_dump_ctx *ctx, struct task_struct *p) {}
5665+
static void sched_ext_ops__cpu_online(s32 cpu) {}
5666+
static void sched_ext_ops__cpu_offline(s32 cpu) {}
5667+
static s32 sched_ext_ops__init(void) { return -EINVAL; }
5668+
static void sched_ext_ops__exit(struct scx_exit_info *info) {}
5669+
static void sched_ext_ops__dump(struct scx_dump_ctx *ctx) {}
5670+
static void sched_ext_ops__dump_cpu(struct scx_dump_ctx *ctx, s32 cpu, bool idle) {}
5671+
static void sched_ext_ops__dump_task(struct scx_dump_ctx *ctx, struct task_struct *p) {}
56725672

56735673
static struct sched_ext_ops __bpf_ops_sched_ext_ops = {
5674-
.select_cpu = select_cpu_stub,
5675-
.enqueue = enqueue_stub,
5676-
.dequeue = dequeue_stub,
5677-
.dispatch = dispatch_stub,
5678-
.tick = tick_stub,
5679-
.runnable = runnable_stub,
5680-
.running = running_stub,
5681-
.stopping = stopping_stub,
5682-
.quiescent = quiescent_stub,
5683-
.yield = yield_stub,
5684-
.core_sched_before = core_sched_before_stub,
5685-
.set_weight = set_weight_stub,
5686-
.set_cpumask = set_cpumask_stub,
5687-
.update_idle = update_idle_stub,
5688-
.cpu_acquire = cpu_acquire_stub,
5689-
.cpu_release = cpu_release_stub,
5690-
.init_task = init_task_stub,
5691-
.exit_task = exit_task_stub,
5692-
.enable = enable_stub,
5693-
.disable = disable_stub,
5674+
.select_cpu = sched_ext_ops__select_cpu,
5675+
.enqueue = sched_ext_ops__enqueue,
5676+
.dequeue = sched_ext_ops__dequeue,
5677+
.dispatch = sched_ext_ops__dispatch,
5678+
.tick = sched_ext_ops__tick,
5679+
.runnable = sched_ext_ops__runnable,
5680+
.running = sched_ext_ops__running,
5681+
.stopping = sched_ext_ops__stopping,
5682+
.quiescent = sched_ext_ops__quiescent,
5683+
.yield = sched_ext_ops__yield,
5684+
.core_sched_before = sched_ext_ops__core_sched_before,
5685+
.set_weight = sched_ext_ops__set_weight,
5686+
.set_cpumask = sched_ext_ops__set_cpumask,
5687+
.update_idle = sched_ext_ops__update_idle,
5688+
.cpu_acquire = sched_ext_ops__cpu_acquire,
5689+
.cpu_release = sched_ext_ops__cpu_release,
5690+
.init_task = sched_ext_ops__init_task,
5691+
.exit_task = sched_ext_ops__exit_task,
5692+
.enable = sched_ext_ops__enable,
5693+
.disable = sched_ext_ops__disable,
56945694
#ifdef CONFIG_EXT_GROUP_SCHED
5695-
.cgroup_init = cgroup_init_stub,
5696-
.cgroup_exit = cgroup_exit_stub,
5697-
.cgroup_prep_move = cgroup_prep_move_stub,
5698-
.cgroup_move = cgroup_move_stub,
5699-
.cgroup_cancel_move = cgroup_cancel_move_stub,
5700-
.cgroup_set_weight = cgroup_set_weight_stub,
5695+
.cgroup_init = sched_ext_ops__cgroup_init,
5696+
.cgroup_exit = sched_ext_ops__cgroup_exit,
5697+
.cgroup_prep_move = sched_ext_ops__cgroup_prep_move,
5698+
.cgroup_move = sched_ext_ops__cgroup_move,
5699+
.cgroup_cancel_move = sched_ext_ops__cgroup_cancel_move,
5700+
.cgroup_set_weight = sched_ext_ops__cgroup_set_weight,
57015701
#endif
5702-
.cpu_online = cpu_online_stub,
5703-
.cpu_offline = cpu_offline_stub,
5704-
.init = init_stub,
5705-
.exit = exit_stub,
5706-
.dump = dump_stub,
5707-
.dump_cpu = dump_cpu_stub,
5708-
.dump_task = dump_task_stub,
5702+
.cpu_online = sched_ext_ops__cpu_online,
5703+
.cpu_offline = sched_ext_ops__cpu_offline,
5704+
.init = sched_ext_ops__init,
5705+
.exit = sched_ext_ops__exit,
5706+
.dump = sched_ext_ops__dump,
5707+
.dump_cpu = sched_ext_ops__dump_cpu,
5708+
.dump_task = sched_ext_ops__dump_task,
57095709
};
57105710

57115711
static struct bpf_struct_ops bpf_sched_ext_ops = {

0 commit comments

Comments
 (0)