* [PATCH] sched_ext: define missing cfi stubs for sched_ext
@ 2024-08-13 18:56 Manu Bretelle
2024-08-13 19:04 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Manu Bretelle @ 2024-08-13 18:56 UTC (permalink / raw)
To: tj, void, linux-kernel
`__bpf_ops_sched_ext_ops` was missing the initialization of some struct
attributes.
With
https://lore.kernel.org/all/20240722183049.2254692-4-martin.lau@linux.dev/
every single attributes need to be initialized programs (like scx_layered)
will fail to load.
05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_init not found in kernel, skipping it as it's set to zero
05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_exit not found in kernel, skipping it as it's set to zero
05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_prep_move not found in kernel, skipping it as it's set to zero
05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_move not found in kernel, skipping it as it's set to zero
05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_cancel_move not found in kernel, skipping it as it's set to zero
05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_set_weight not found in kernel, skipping it as it's set to zero
05:26:48 [WARN] libbpf: prog 'layered_dump': BPF program load failed: unknown error (-524)
05:26:48 [WARN] libbpf: prog 'layered_dump': -- BEGIN PROG LOAD LOG --
attach to unsupported member dump of struct sched_ext_ops
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
-- END PROG LOAD LOG --
05:26:48 [WARN] libbpf: prog 'layered_dump': failed to load: -524
05:26:48 [WARN] libbpf: failed to load object 'bpf_bpf'
05:26:48 [WARN] libbpf: failed to load BPF skeleton 'bpf_bpf': -524
Error: Failed to load BPF program
Signed-off-by: Manu Bretelle <chantr4@gmail.com>
---
kernel/sched/ext.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 143c4207a826..3560d8bed06d 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -5111,6 +5111,9 @@ static void cpu_online_stub(s32 cpu) {}
static void cpu_offline_stub(s32 cpu) {}
static s32 init_stub(void) { return -EINVAL; }
static void exit_stub(struct scx_exit_info *info) {}
+static void dump_stub(struct scx_dump_ctx *ctx) {}
+static void dump_cpu_stub(struct scx_dump_ctx *ctx, s32 cpu, bool idle) {}
+static void dump_task_stub(struct scx_dump_ctx *ctx, struct task_struct *p) {}
static struct sched_ext_ops __bpf_ops_sched_ext_ops = {
.select_cpu = select_cpu_stub,
@@ -5136,6 +5139,9 @@ static struct sched_ext_ops __bpf_ops_sched_ext_ops = {
.cpu_offline = cpu_offline_stub,
.init = init_stub,
.exit = exit_stub,
+ .dump = dump_stub,
+ .dump_cpu = dump_cpu_stub,
+ .dump_task = dump_task_stub,
};
static struct bpf_struct_ops bpf_sched_ext_ops = {
--
2.43.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sched_ext: define missing cfi stubs for sched_ext
2024-08-13 18:56 [PATCH] sched_ext: define missing cfi stubs for sched_ext Manu Bretelle
@ 2024-08-13 19:04 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-08-13 19:04 UTC (permalink / raw)
To: Manu Bretelle; +Cc: void, linux-kernel
On Tue, Aug 13, 2024 at 11:56:25AM -0700, Manu Bretelle wrote:
> `__bpf_ops_sched_ext_ops` was missing the initialization of some struct
> attributes.
> With
> https://lore.kernel.org/all/20240722183049.2254692-4-martin.lau@linux.dev/
> every single attributes need to be initialized programs (like scx_layered)
> will fail to load.
>
> 05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_init not found in kernel, skipping it as it's set to zero
> 05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_exit not found in kernel, skipping it as it's set to zero
> 05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_prep_move not found in kernel, skipping it as it's set to zero
> 05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_move not found in kernel, skipping it as it's set to zero
> 05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_cancel_move not found in kernel, skipping it as it's set to zero
> 05:26:48 [INFO] libbpf: struct_ops layered: member cgroup_set_weight not found in kernel, skipping it as it's set to zero
> 05:26:48 [WARN] libbpf: prog 'layered_dump': BPF program load failed: unknown error (-524)
> 05:26:48 [WARN] libbpf: prog 'layered_dump': -- BEGIN PROG LOAD LOG --
> attach to unsupported member dump of struct sched_ext_ops
> processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
> -- END PROG LOAD LOG --
> 05:26:48 [WARN] libbpf: prog 'layered_dump': failed to load: -524
> 05:26:48 [WARN] libbpf: failed to load object 'bpf_bpf'
> 05:26:48 [WARN] libbpf: failed to load BPF skeleton 'bpf_bpf': -524
> Error: Failed to load BPF program
>
> Signed-off-by: Manu Bretelle <chantr4@gmail.com>
Applied to sched_ext/for-6.12.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-13 19:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-13 18:56 [PATCH] sched_ext: define missing cfi stubs for sched_ext Manu Bretelle
2024-08-13 19:04 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox