]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched_ext: Add error logging for dsq creation failures
authorGeorge Guo <guodongtai@kylinos.cn>
Fri, 9 Jan 2026 16:12:14 +0000 (00:12 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 12 Jan 2026 18:44:11 +0000 (08:44 -1000)
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>
tools/sched_ext/scx_central.bpf.c
tools/sched_ext/scx_flatcg.bpf.c
tools/sched_ext/scx_qmap.bpf.c

index 55df8b7988657bf145c871d7aec05a10fdc08bca..1c2376b75b5d03bdb7512de0b551af60c60c9f6b 100644 (file)
@@ -301,8 +301,10 @@ int BPF_STRUCT_OPS_SLEEPABLE(central_init)
        int ret;
 
        ret = scx_bpf_create_dsq(FALLBACK_DSQ_ID, -1);
-       if (ret)
+       if (ret) {
+               scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
                return ret;
+       }
 
        timer = bpf_map_lookup_elem(&central_timer, &key);
        if (!timer)
index 43126858b8e4c5b300e78f842ebdd03f60888fa6..c216480c3ee05d2ff6f33d4686f60b21f503fcdf 100644 (file)
@@ -842,8 +842,10 @@ int BPF_STRUCT_OPS_SLEEPABLE(fcg_cgroup_init, struct cgroup *cgrp,
         * unlikely case that it breaks.
         */
        ret = scx_bpf_create_dsq(cgid, -1);
-       if (ret)
+       if (ret) {
+               scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
                return ret;
+       }
 
        cgc = bpf_cgrp_storage_get(&cgrp_ctx, cgrp, 0,
                                   BPF_LOCAL_STORAGE_GET_F_CREATE);
index df21fad0c43817f5cf0e3da433033c86da2b1381..d51d8c38f1cf9efa38af00859d503e20dd9ae67c 100644 (file)
@@ -866,12 +866,16 @@ s32 BPF_STRUCT_OPS_SLEEPABLE(qmap_init)
                print_cpus();
 
        ret = scx_bpf_create_dsq(SHARED_DSQ, -1);
-       if (ret)
+       if (ret) {
+               scx_bpf_error("failed to create DSQ %d (%d)", SHARED_DSQ, ret);
                return ret;
+       }
 
        ret = scx_bpf_create_dsq(HIGHPRI_DSQ, -1);
-       if (ret)
+       if (ret) {
+               scx_bpf_error("failed to create DSQ %d (%d)", HIGHPRI_DSQ, ret);
                return ret;
+       }
 
        timer = bpf_map_lookup_elem(&monitor_timer, &key);
        if (!timer)