Skip to content

Commit 2f8d489

Browse files
georgejguohtejun
authored andcommitted
sched_ext: Add error logging for dsq creation failures
Add scx_bpf_error() calls when scx_bpf_create_dsq() fails in multiple schedulers to improve debuggability: - scx_central.bpf.c: central_init() - scx_flatcg.bpf.c: fcg_cgroup_init() and fcg_init() - scx_qmap.bpf.c: qmap_init() Signed-off-by: George Guo <guodongtai@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 714d814 commit 2f8d489

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

tools/sched_ext/scx_central.bpf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ int BPF_STRUCT_OPS_SLEEPABLE(central_init)
301301
int ret;
302302

303303
ret = scx_bpf_create_dsq(FALLBACK_DSQ_ID, -1);
304-
if (ret)
304+
if (ret) {
305+
scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
305306
return ret;
307+
}
306308

307309
timer = bpf_map_lookup_elem(&central_timer, &key);
308310
if (!timer)

tools/sched_ext/scx_flatcg.bpf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,10 @@ int BPF_STRUCT_OPS_SLEEPABLE(fcg_cgroup_init, struct cgroup *cgrp,
842842
* unlikely case that it breaks.
843843
*/
844844
ret = scx_bpf_create_dsq(cgid, -1);
845-
if (ret)
845+
if (ret) {
846+
scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
846847
return ret;
848+
}
847849

848850
cgc = bpf_cgrp_storage_get(&cgrp_ctx, cgrp, 0,
849851
BPF_LOCAL_STORAGE_GET_F_CREATE);

tools/sched_ext/scx_qmap.bpf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,12 +866,16 @@ s32 BPF_STRUCT_OPS_SLEEPABLE(qmap_init)
866866
print_cpus();
867867

868868
ret = scx_bpf_create_dsq(SHARED_DSQ, -1);
869-
if (ret)
869+
if (ret) {
870+
scx_bpf_error("failed to create DSQ %d (%d)", SHARED_DSQ, ret);
870871
return ret;
872+
}
871873

872874
ret = scx_bpf_create_dsq(HIGHPRI_DSQ, -1);
873-
if (ret)
875+
if (ret) {
876+
scx_bpf_error("failed to create DSQ %d (%d)", HIGHPRI_DSQ, ret);
874877
return ret;
878+
}
875879

876880
timer = bpf_map_lookup_elem(&monitor_timer, &key);
877881
if (!timer)

0 commit comments

Comments
 (0)